neysx 06/02/20 12:17:24 Modified: xml/htdocs/doc/en xml-guide.xml Log: #106017 Add colour coding to <pre>
Revision Changes Path 1.58 +79 -16 xml/htdocs/doc/en/xml-guide.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/xml-guide.xml?rev=1.58&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/xml-guide.xml?rev=1.58&content-type=text/plain&cvsroot=gentoo diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/xml-guide.xml.diff?r1=1.57&r2=1.58&cvsroot=gentoo Index: xml-guide.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/xml-guide.xml,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- xml-guide.xml 9 Jan 2006 14:44:14 -0000 1.57 +++ xml-guide.xml 20 Feb 2006 12:17:24 -0000 1.58 @@ -1,11 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/xml-guide.xml,v 1.57 2006/01/09 14:44:14 neysx Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/xml-guide.xml,v 1.58 2006/02/20 12:17:24 neysx Exp $ --> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> <guide link="/doc/en/xml-guide.xml"> <title>Gentoo XML Guide</title> <author title="Author"> + <mail link="[EMAIL PROTECTED]">Xavier Neys</mail> +</author> +<author title="Author"> <mail link="[EMAIL PROTECTED]">Daniel Robbins</mail> </author> <author title="Author"><!-- [EMAIL PROTECTED] --> @@ -17,9 +20,6 @@ <author title="Editor"> <mail link="[EMAIL PROTECTED]">Sven Vermeulen</mail> </author> -<author title="Editor"> - <mail link="[EMAIL PROTECTED]">Xavier Neys</mail> -</author> <abstract> This guide shows you how to compose web documentation using the new lightweight @@ -32,8 +32,8 @@ <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> <license/> -<version>2.29</version> -<date>2005-10-13</date> +<version>3</version> +<date>2006-02-18</date> <chapter> <title>Guide basics</title> @@ -247,7 +247,7 @@ Make HTML/XML easier to read by using selective emphasis: <foo><i>bar</i></foo> -<comment>(This is how to insert an inline note into the code block)</comment> +<comment>(This is how to insert a comment into a code block)</comment> </pre> <note> @@ -280,7 +280,7 @@ Make HTML/XML easier to read by using selective emphasis: <foo><i>bar</i></foo> -<comment>(This is how to insert an inline note into the code block)</comment> +<comment>(This is how to insert a comment into a code block)</comment> </pre> <note> @@ -353,15 +353,14 @@ </section> <section> <title> - <path>, <c>, <i>, <b>, <e>, <sub> and <sup> + <path>, <c>, <b>, <e>, <sub> and <sup> </title> <body> <p> The <c><path></c>, <c><c></c>, <c><b></c>, <c><e></c>, <c><sub></c> and <c><sup></c> elements can be used inside any child -<c><body></c> tag, except for <c><pre></c>. The <c><i></c> -element can only be used inside <c><pre></c>. +<c><body></c> tag, except for <c><pre></c>. </p> <p> @@ -387,11 +386,6 @@ </p> <p> -When you want to highlight some text as user input inside a <c><pre></c>, -use <c><i></c> instead. -</p> - -<p> As you might have guessed, <c><b></c> is used to <b>boldface</b> some text. </p> @@ -411,6 +405,75 @@ </body> </section> <section> +<title>Code samples and colour-coding</title> +<body> + +<p> +To improve the readability of code samples, the following tags are allowed +inside <c><pre></c> blocks: +</p> + +<dl> + <dt><c><i></c></dt> + <dd>Distinguishes user input from displayed text</dd> + <dt><c><comment></c></dt> + <dd>Comments relevant to the action(s) that appear after the comment</dd> + <dt><c><keyword></c></dt> + <dd>Denotes a keyword in the language used in the code sample + </dd> + <dt><c><ident></c></dt> + <dd>Used for an identifier + </dd> + <dt><c><const></c></dt> + <dd>Used for a constant + </dd> + <dt><c><stmt></c></dt> + <dd>Used for a statement + </dd> + <dt><c><var></c></dt> + <dd>Used for a variable + </dd> +</dl> + +<note> +Remember that all leading and trailing spaces, and line breaks in +<c><pre></c> blocks will appear in the displayed html page. +</note> + +<p> +Sample colour-coded <c><pre></c> block: +</p> + +<pre caption="My first ebuild"> +<comment># Copyright 1999-2006 <b>Gentoo Foundation</b> +# Distributed under the terms of the GNU General Public License v2 +# $Header: $</comment> + +<ident>DESCRIPTION</ident>=<const>"Exuberant ctags generates tags files for quick source navigation"</const> +<ident>HOMEPAGE</ident>=<const>"http://ctags.sourceforge.net"</const> +<ident>SRC_URI</ident>=<const>"mirror://sourceforge/ctags/<var>${P}</var>.tar.gz"</const> + +<ident>LICENSE</ident>=<const>"GPL-2"</const> +<ident>SLOT</ident>=<const>"0"</const> +<ident>KEYWORDS</ident>=<const>"~mips ~sparc ~x86"</const> +<ident>IUSE</ident>=<const>""</const> + +<stmt>src_compile()</stmt> { + <keyword>econf</keyword> --with-posix-regex || <keyword>die</keyword> <const>"econf failed"</const> + <keyword>emake</keyword> || <keyword>die</keyword> <const>"emake failed"</const> +} + +<stmt>src_install()</stmt> { + <keyword>make</keyword> <ident>DESTDIR</ident>="<var>${D}</var>" install || <keyword>die</keyword> <const>"install failed"</const> + + <keyword>dodoc</keyword> FAQ NEWS README + <keyword>dohtml</keyword> EXTENDING.html ctags.html +} +</pre> + +</body> +</section> +<section> <title><mail> and <uri></title> <body> -- [email protected] mailing list
