[Pro] Cleaning up code?

Are there any applications that’ll take a jumbled mess of CCS or HTML code and clean it up for you with proper indents and such?

Will Coda2 do this?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s lots of apps that perform the “tidy” function… there is even a
plugin for Coda2 that will tidy (or minify) html and css and whatever.
Whether that is what you’re looking for, I don’t know.

On Thursday, February 6, 2014, RavenManiac email@hidden wrote:

Are there any applications that’ll take a jumbled mess of CCS or HTML
code and clean it up for you with proper indents and such?

Will Coda2 do this?


Ernie Simpson


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

CSSEdit (no longer sold) will do this for CSS. TextMate 1.5 (or 2.0 alpha, if you want to be all cutting-edge) can do this for nearly any language. There are lots of command-line tools for this, often written in Node.js, but they are all pretty neck-beard in their user interface. As the old joke goes, “Of course Unix is user-friendly – it’s just very particular about who its friends are.”

Walter

On Feb 6, 2014, at 1:05 PM, RavenManiac wrote:

Are there any applications that’ll take a jumbled mess of CCS or HTML code and clean it up for you with proper indents and such?

Will Coda2 do this?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, that helps. Thanks.

BTW, is it possible to create a universal unordered

    or ordered list tag in FWP much, like an

    ,

    , etc., or is that something I shouldn’t do?

    The reason I ask is I need it for default CMS content, otherwise I’ll need to edit a lot of CMS templates.


    offtopic mailing list
    email@hidden
    Update your subscriptions at:
    http://freewaytalk.net/person/options

You can’t make a style like that (ul) in the Styles palette and then apply it to text, but anything you create in that style will apply to all lists that aren’t otherwise styled. Try this:

  1. Make a new style with the Tag set to ul and the Name set to nothing. (Don’t forget to tab out of the name field so style23 doesn’t sneak back into there!) Set the color to red or something.
  2. Type three lines of text, separated by returns. Select all three lines and press the List → button once to create a list.
  3. Note that your color may or may not apply, depending on how you added it (generally, Extended stuff is invisible in the design view).
  4. Preview in a browser. Your list items should be red.

Walter

On Feb 6, 2014, at 1:30 PM, RavenManiac wrote:

Yes, that helps. Thanks.

BTW, is it possible to create a universal unordered

    or ordered list tag in FWP much, like an

    ,

    , etc., or is that something I shouldn’t do?

    The reason I ask is I need it for default CMS content, otherwise I’ll need to edit a lot of CMS templates.


    offtopic mailing list
    email@hidden
    Update your subscriptions at:
    http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Cool. BTW, I found this online and it seems to work pretty well:


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, that worked perfectly. Is there any reason why I wouldn’t want to set a universal ul tag?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just the lack of feedback in the UI while you’re designing. These sorts of hidden defaults are great until they confuse you. I don’t know how many times I have gone down the rabbit-hole only to find that I set line-height on the body tag or something like that, and I didn’t remove it lower down the tree.

t is possible to make a Name-only style that sets the UL list behavior and sets up the defaults for all list items within it, and those you would apply by selecting a range of paragraphs and clicking the style name to apply it. That would force a list into being out of a bunch of ordinary paragraphs.

Walter

On Feb 6, 2014, at 2:33 PM, RavenManiac wrote:

Walter, that worked perfectly. Is there any reason why I wouldn’t want to set a universal ul tag?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hmm.

Basically, my client is editing content through Perch using Redactor. As you know, Redactor allows the user to includes ordered and unordered lists.

Previously, I was simply editing the code from within the Perch desktop using Redactor’s code insert feature. The problem is if my client deleted the existing content, my ul and ol class tags would also be deleted.

From what I understand, I can have a universal ul tag, but not an ol tag, so my current “universal ul” solution is still a problem. What do you recommend?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can certainly have an ol tag, just like the ul tag. They are different tags, so they will take different selectors. You can also scope the li tag to be differently styled depending on whether it is inside an ol or a ul.

html:
<ol>
	<li>Thing one</li>
	<li>Thing two</li>
</ol>
<ul>
	<li>Thing one</li>
	<li>Thing two</li>
</ul>

CSS:
ol li {
	color: blue;
}
ul li {
	color: green;
}

Give that a play.

Walter

On Feb 6, 2014, at 3:10 PM, RavenManiac wrote:

Hmm.

Basically, my client is editing content through Perch using Redactor. As you know, Redactor allows the user to includes ordered and unordered lists.

Previously, I was simply editing the code from within the Perch desktop using Redactor’s code insert feature. The problem is if my client deleted the existing content, my ul and ol class tags would also be deleted.

From what I understand, I can have a universal ul tag, but not an ol tag, so my current “universal ul” solution is still a problem. What do you recommend?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

From what I understand, I can have a universal ul tag, but not an ol tag,

Why not?

You can use any kind of selector in the Tag field - so you can even style
everything about ul and ol lists that are common in a single group selector

  Tag: ul, ol

or create a separate ul and ol style.

I prefer class styles for lists as I often use them for different things -
menus, text lists. Remember class styles are Name field styles and must be
applied to the item in FWP. Of course, I know nothing about Perch or how to
use it in FWP so maybe I won’t have anything valuable to contribute.

li tags (List Items) are both children of ol and ul tags - you can style
most text characteristics in the ol and ul tags and the li will inherit
them - except for margins or padding (eg., top and bottom). The ul and ol
elements act as containers for the li elements, and margins/padding on ul
and ol affect them as containers, and are un-inherited by the li.


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just so I’m clear, you’re manually adding a class to the ul via Redactor, correct? If so then this is a common mistake when using a CMS. You obviously discovered the problem and are moving in the right direction. In addition to using global styles you may also need to target specific elements within a CMS-controlled area which is where more specialized selectors come into play. Some of the especially useful ones (at least to me) are the numerous pseudo, adjacent and descendant selectors, among others. What this allows you to do is setup specific styles without mucking up the Redactor code with styling info the client could destroy.

Todd

Previously, I was simply editing the code from within the Perch desktop using Redactor’s code insert feature. The problem is if my client deleted the existing content, my ul and ol class tags would also be deleted.


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 6 Feb 2014, 7:36 pm, Todd wrote:

Just so I’m clear, you’re manually adding a class to the ul via Redactor, correct? If so then this is a common mistake when using a CMS. You obviously discovered the problem and are moving in the right direction. In addition to using global styles you may also need to target specific elements within a CMS-controlled area which is where more specialized selectors come into play. Some of the especially useful ones (at least to me) are the numerous pseudo, adjacent and descendant selectors, among others. What this allows you to do is setup specific styles without mucking up the Redactor code with styling info the client could destroy.

Todd
http://xiiro.com

Yes, that is correct. My goal was to strip all of the code out of Redactor and let FWP or Perch handle the styling. Unfortunately, I was just informed by Perch that when it comes to lists, Redactor adds its own CSS, which doesn’t make a lot of sense to me. Here’s the code Redactor added:

<li><span style="font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif; font-size: 15px; line-height: 1.45em;">Client copy goes here</span><br></li>

offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

uggggg. That is very ugly inline span code. One tiny step above the bad old days of the tag!

Walter

On Feb 6, 2014, at 3:47 PM, RavenManiac wrote:

. Here’s the code Redactor added:

<li><span style="font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif; font-size: 15px; line-height: 1.45em;">Client copy goes here</span><br></li>

offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m confused, in my Perch demo (using Redactor) when I insert a list there’s no inline CSS.

Todd

Unfortunately, I was just informed by Perch that when it comes to lists, Redactor adds its own CSS


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Weird. I’m using Perch v2.4.3 and Redactor v8.2.5.

I resisted upgrading to the latest version because I don’t like the new black background, but perhaps I should.


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m using the same.

Todd

Weird. I’m using Perch v2.4.3 and Redactor v8.2.5.


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That is too weird. I just upgraded to Redactor v9.1.9 and everything is fine now. Perhaps something was corrupted in my version of Redactor v8.2.5.


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Since we’re on the topic of CMS editors, which one do you all prefer and why?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I prefer CKEditor for two reasons:

  1. Easily and highly customizable.
  2. I prefer the code formatting vs. Redactor’s.
  • Bonus: It’s not TinyMCE

But I also like Redactor.

XStandard http://www.xstandard.com is appealing because it’s standards-compliant, though it’s ugly.

Todd

Since we’re on the topic of CMS editors, which one do you all prefer and why?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options