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

Re: example with source code

From: Lee Kowalkowski <lee.kowalkowski@googlemail.com>
Date: Tue, 15 Jul 2008 10:16:24 +0100
Message-ID: <610592c90807150216v62931e3dmf1a66f2a334c0fc7@mail.gmail.com>
To: "Dailey, David P." <david.dailey@sru.edu>
Cc: public-html@w3.org

On 14/07/2008, Dailey, David P. <david.dailey@sru.edu> wrote:
> Hi folks.

Hi David,

> Is there some way to just write the source code (or wysiwyg plaintext) just once inside the appropriate tag(s), instead of having to parrot onesself?
>
> 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).

I've done this recently using script, by using XHR to get the current
page into a JS variable and extract the snippets.  DOM or innerHTML
methods were not consistent cross-browser, or just not simple enough.

<!-- snippetStart --><p><b>Hello World</b></p><!-- snippetEnd -->

This also makes it possible for a fallback to a server-side
implementation, if requried.

-- 
Lee
Received on Tuesday, 15 July 2008 09:17:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:56 UTC