W3C home > Mailing lists > Public > public-html@w3.org > July 2008

Re: example with source code

From: Thomas Broyer <t.broyer@gmail.com>
Date: Wed, 16 Jul 2008 10:07:14 +0200
Message-ID: <a9699fd20807160107l5c337ca7ic7fea40aff57eb77@mail.gmail.com>
To: public-html@w3.org
On Mon, Jul 14, 2008 at 5:54 AM, Dailey, David P. wrote:
>
> In writing instructional materials (we in teaching might call the stuff "lessons" and
> those in industry affectionately refer to it as "doco" *), one might often wish to
> speak to one's audience at two levels simultaneously, displaying both the
> appearance of something and its underlying mystery (source code) in the same
> immediate vicinity (whether vicinity be defined spatially or temporally or otherwise).
>
> -------begin example-----------
> Here is the text the way it appears in a browserlike application. With a line break,
> an ellipsis, a comma....,
> and then,       several spaces in the second line.
> ---------------appearance above----source below---------
> <p>Here is the text the way it appears in a browserlike application.  With a line
> break, an ellipsis, a comma...., <br/>and then,(%nbsp;5) several spaces in the
> second line.</p>
> -----end example------
>
> The markup language (be it (x)HTMLy.z, SVG, CDF, docBook ...) is largely irrelevant.

Er, in the context of HTML5, yes it is… it has to be an HTML5
fragment, otherwise it could be a complete document (that could be
rendered with an <object>)

> I'm thinking of something like <sourceAndDisplay><p><b>Hello World</b></p></sourceAndDisplay>
> which would allow the author to maintain only one sequence of characters (rather
> than markup and appearance being maintained separately and in parallel).

How would you style it? (e.g. I want the "appearance" part to have 3px
green left border, and the "source" part to have be in Lucida Mono
with a grey background)

And if I want to emphasize some parts of the source code (a very
common use case) I have to go "back" to "parrotting myself".


-- 
Thomas Broyer
Received on Wednesday, 16 July 2008 08:07:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:19 GMT