Formatting XML and other computer code

Art Campbell art.campbell at gmail.com
Fri Nov 16 08:08:29 PST 2007


Carol,
As Lester points out, keeping a line intact, even if it wraps, and
improving legibility are the primary reasons.
But using tables also gives you a lot more formatting options.
For instance, you can make the background shading any color and make
the text contrasting, which lets you mimic a screen display as well as
making the code jump out from the text.
(I didn't point out that the table format has no rules, or just an
exterior boundary rule.)
Art


On Nov 16, 2007 10:56 AM, Lester C. Smalley <lsmalley at infocon.com> wrote:
> I also use the table approach (although I use a monospace font at 10 pt
> for legibility) for formatting program code examples.
>
> The advantage of a table is that if you have long code lines, they wrap
> within the table cell, and will be kept together on the same page as FM
> won't split a cell over a column or page break.  You can fine-tune the
> spacing between lines by adjusting the table's top and bottom cell
> margins via the table designer.
>
> You can improve a bit on this perhaps by setting the left indent of the
> paragraph format so the 'continuation' lines are offset from the initial
> line, making it clearer to the reader that it is a single line of code
> (or even provide a note to that effect) and this could be set up in
> format rules if you're using a structured template.  If not, you might
> create a few 'code sample' paragraph formats to control indentation
> level if desired.
>
> You can convert any number of sequential paragraphs into a table by
> selecting them and choosing "Convert to Table" from the table menu.  If
> you wish, you can use the table to preserve indentations by setting
> multiple columns based on tabs (or another character or multiple spaces)
> but then you usually have a very large amount of work to do to straddle
> cells to get the appearance correct.  A single column with appropriate
> tab stops/different paragraph formats for indentation as desired is much
> more automatic...
>
> On Thursday, November 15, 2007 09:45 AM, Carol Wade wrote:
>
> | Thanks, all who responded. Over time, I'll try all the
> | approaches & will report back.
> |
> | Art: What is the advantage of putting the text in a table,
> | with each line a separate row? (which I assume can be done
> | automatically based on carriage returns)
> |
> | Paul: I'm downloading UltraEdit now - looks like a good tool!
> |
> | - Carol
> ....
> | > I copy it from the screen into FM as raw text with Paste Special >
> | > Text with a para at the end of each line. If it has too many tabs,
> | > you can do a find-and-replace to clean them out or convert to
> | > multiple spaces.
> | > Then convert it to a single column table, one line per cell. The
> | > para tag for each cell is a 6 or 7 point monospace font, such as
> | > Courier.
>
> - Lester
> -------------------------------------------------------
> Lester C. Smalley              Email: lsmalley AT infocon DOT com
> Information Consultants, Inc.  Phone: 302-239-2942 FAX: 302-239-1712
> Yorklyn, DE  19736               Web: www.infocon.com
> -------------------------------------------------------
>
>
> _______________________________________________
>
>
> You are currently subscribed to Framers as art.campbell at gmail.com.
>
> Send list messages to framers at lists.frameusers.com.
>
> To unsubscribe send a blank email to
> framers-unsubscribe at lists.frameusers.com
> or visit http://lists.frameusers.com/mailman/options/framers/art.campbell%40gmail.com
>
> Send administrative questions to listadmin at frameusers.com. Visit
> http://www.frameusers.com/ for more resources and info.
>



-- 
Art Campbell                                             art.campbell at gmail.com
  "... In my opinion, there's nothing in this world beats a '52 Vincent
               and a redheaded girl." -- Richard Thompson
                             No disclaimers apply.
                                     DoD 358



More information about the framers mailing list