diff options
author | Dima Dorfman <dd@FreeBSD.org> | 2001-04-09 00:33:58 +0000 |
---|---|---|
committer | Dima Dorfman <dd@FreeBSD.org> | 2001-04-09 00:33:58 +0000 |
commit | caa699491488660cc9525f719a50d577aa288600 (patch) | |
tree | 51aa35f45822bdfb1d59f95710edb37889ea9cd7 /en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml | |
parent | cb3edc96919b078a23cc8e4d500058cd467a7703 (diff) | |
download | doc-caa699491488660cc9525f719a50d577aa288600.tar.gz doc-caa699491488660cc9525f719a50d577aa288600.zip |
DocBook police: open and close tags for <programlisting> should cuddle
up to the contents within.
Approved by: nik
Notes
Notes:
svn path=/head/; revision=9149
Diffstat (limited to 'en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml')
-rw-r--r-- | en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml | 101 |
1 files changed, 34 insertions, 67 deletions
diff --git a/en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml b/en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml index 3cb5589b31..a0ac827d5b 100644 --- a/en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml +++ b/en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml @@ -27,7 +27,7 @@ ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - $FreeBSD: doc/en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml,v 1.14 2000/10/31 19:36:16 nik Exp $ + $FreeBSD: doc/en_US.ISO_8859-1/books/fdp-primer/sgml-primer/chapter.sgml,v 1.15 2000/11/01 22:38:35 jim Exp $ --> <chapter id="sgml-primer"> @@ -215,8 +215,7 @@ the element is a paragraph, called <literal>p</literal>. This element has both start and end tags.</para> - <programlisting> -<![ CDATA [<p>This is a paragraph. It starts with the start tag for + <programlisting><![ CDATA [<p>This is a paragraph. It starts with the start tag for the 'p' element, and it will end with the end tag for the 'p' element.</p> @@ -235,8 +234,7 @@ <literal>hr</literal>. This element does not wrap content, so only has a start tag.</para> - <programlisting> -<![ CDATA [<p>This is a paragraph.</p> + <programlisting><![ CDATA [<p>This is a paragraph.</p> <hr> @@ -252,8 +250,7 @@ <example> <title>Elements within elements; <sgmltag>em</sgmltag></title> - <programlisting> -<![ CDATA [<p>This is a simple <em>paragraph</em> where some + <programlisting><![ CDATA [<p>This is a simple <em>paragraph</em> where some of the <em>words</em> have been <em>emphasised</em>.</p>]]></programlisting> </example> @@ -303,8 +300,7 @@ <example> <title>Using an element with an attribute</title> - <programlisting> -<![ CDATA [<p align="left">The inclusion of the align attribute + <programlisting><![ CDATA [<p align="left">The inclusion of the align attribute on this paragraph was superfluous, since the default is left.</p> <p align="center">This may appear in the center.</p>]]></programlisting> @@ -319,8 +315,7 @@ <example> <title>Single quotes around attributes</title> - <programlisting> -<![ CDATA [<p align='right'>I'm on the right!</p>]]></programlisting> + <programlisting><![ CDATA [<p align='right'>I'm on the right!</p>]]></programlisting> </example> <para>Sometimes you do not need to use quotes around attribute values at @@ -352,8 +347,7 @@ <title><filename>.profile</filename>, for &man.sh.1; and &man.bash.1; users</title> - <programlisting> -SGML_ROOT=/usr/local/share/sgml + <programlisting>SGML_ROOT=/usr/local/share/sgml SGML_CATALOG_FILES=${SGML_ROOT}/jade/catalog SGML_CATALOG_FILES=${SGML_ROOT}/iso8879/catalog:$SGML_CATALOG_FILES SGML_CATALOG_FILES=${SGML_ROOT}/html/catalog:$SGML_CATALOG_FILES @@ -365,8 +359,7 @@ export SGML_CATALOG_FILES</programlisting> <title><filename>.login</filename>, for &man.csh.1; and &man.tcsh.1; users</title> - <programlisting> -setenv SGML_ROOT /usr/local/share/sgml + <programlisting>setenv SGML_ROOT /usr/local/share/sgml setenv SGML_CATALOG_FILES ${SGML_ROOT}/jade/catalog setenv SGML_CATALOG_FILES ${SGML_ROOT}/iso8879/catalog:$SGML_CATALOG_FILES setenv SGML_CATALOG_FILES ${SGML_ROOT}/html/catalog:$SGML_CATALOG_FILES @@ -383,8 +376,7 @@ setenv SGML_CATALOG_FILES ${SGML_ROOT}/docbook/catalog:$SGML_CATALOG_FILES</prog <para>Create <filename>example.sgml</filename>, and enter the following text;</para> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> @@ -532,8 +524,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen> <para>A typical declaration for a document written to conform with version 4.0 of the HTML DTD looks like this;</para> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">]]></programlisting> + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">]]></programlisting> <para>That line contains a number of different components.</para> @@ -603,8 +594,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen> <para>FPIs must follow a specific syntax. This syntax is as follows;</para> - <programlisting> -"<replaceable>Owner</replaceable>//<replaceable>Keyword</replaceable> <replaceable>Description</replaceable>//<replaceable>Language</replaceable>"</programlisting> + <programlisting>"<replaceable>Owner</replaceable>//<replaceable>Keyword</replaceable> <replaceable>Description</replaceable>//<replaceable>Language</replaceable>"</programlisting> <variablelist> <varlistentry> @@ -693,8 +683,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen> map FPIs to filenames. For example, if the catalog file contained the line;</para> - <programlisting> -PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> + <programlisting>PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>The SGML processor would know to look up the DTD from <filename>strict.dtd</filename> in the <filename>4.0</filename> @@ -754,8 +743,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>The syntax for this is slightly different:</para> - <programlisting> -<![ CDATA [<!DOCTYPE html SYSTEM "/path/to/file.dtd">]]></programlisting> + <programlisting><![ CDATA [<!DOCTYPE html SYSTEM "/path/to/file.dtd">]]></programlisting> <para>The <literal>SYSTEM</literal> keyword indicates that the SGML processor should locate the DTD in a system specific fashion. This @@ -807,8 +795,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <example> <title>SGML generic comment</title> - <programlisting> -<!-- test comment --></programlisting> + <programlisting><!-- test comment --></programlisting> <programlisting><![ CDATA [ <!-- This is inside the comment --> @@ -864,20 +851,17 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>The SGML parser will treat this as though it were actually;</para> - <programlisting> -<!THIS IS OUTSIDE THE COMMENT></programlisting> + <programlisting><!THIS IS OUTSIDE THE COMMENT></programlisting> <para>This is not valid SGML, and may give confusing error messages.</para> - <programlisting> -<![ CDATA [<!--------------- This is a very bad idea --------------->]]></programlisting> + <programlisting><![ CDATA [<!--------------- This is a very bad idea --------------->]]></programlisting> <para>As the example suggests, <emphasis>do not</emphasis> write comments like that.</para> - <programlisting> -<![ CDATA [<!--===================================================-->]]></programlisting> + <programlisting><![ CDATA [<!--===================================================-->]]></programlisting> <para>That is a (slightly) better approach, but it still potentially confusing to people new to SGML.</para> @@ -933,8 +917,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <literal>current.version</literal> which expanded to the current version number of your product. You could write;</para> - <programlisting> -<![ CDATA [<para>The current version of our product is + <programlisting><![ CDATA [<para>The current version of our product is ¤t.version;.</para>]]></programlisting> <para>When the version number changes you can simply change the @@ -958,8 +941,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <example> <title>Defining general entities</title> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!ENTITY current.version "3.0-RELEASE"> <!ENTITY last.version "2.2.7-RELEASE"> ]>]]></programlisting> @@ -998,8 +980,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <example> <title>Defining parameter entities</title> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!ENTITY % param.some "some"> <!ENTITY % param.text "text"> <!ENTITY % param.new "%param.some more %param.text"> @@ -1019,8 +1000,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>Add a general entity to <filename>example.sgml</filename>.</para> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" [ + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" [ <!ENTITY version "1.1"> ]> @@ -1118,8 +1098,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <example> <title>Using general entities to include files</title> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!ENTITY chapter.1 SYSTEM "chapter1.sgml"> <!ENTITY chapter.2 SYSTEM "chapter2.sgml"> <!ENTITY chapter.3 SYSTEM "chapter3.sgml"> @@ -1173,8 +1152,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <filename>chapters.ent</filename>. This file contains the following;</para> - <programlisting> -<![ CDATA [<!ENTITY chapter.1 SYSTEM "chapter1.sgml"> + <programlisting><![ CDATA [<!ENTITY chapter.1 SYSTEM "chapter1.sgml"> <!ENTITY chapter.2 SYSTEM "chapter2.sgml"> <!ENTITY chapter.3 SYSTEM "chapter3.sgml">]]></programlisting> @@ -1183,8 +1161,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> document, which will then make all the general entities available for use. Then use the general entities as before;</para> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!-- Define a parameter entity to load in the chapter general entities --> <!ENTITY % chapters SYSTEM "chapters.ent"> @@ -1214,16 +1191,14 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>Put content similar to the following in each file;</para> - <programlisting> -<![ CDATA [<p>This is the first paragraph.</p>]]></programlisting> + <programlisting><![ CDATA [<p>This is the first paragraph.</p>]]></programlisting> </step> <step> <para>Edit <filename>example.sgml</filename> so that it looks like this;</para> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!ENTITY version "1.1"> <!ENTITY para1 SYSTEM "para1.sgml"> <!ENTITY para2 SYSTEM "para2.sgml"> @@ -1273,8 +1248,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>Edit <filename>example.sgml</filename> so that it looks like this;</para> - <programlisting> -<![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><![ CDATA [<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!ENTITY % entities SYSTEM "entities.sgml"> %entities; ]> @@ -1297,8 +1271,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>Create a new file, <filename>entities.sgml</filename>, with this content:</para> - <programlisting> -<![ CDATA [<!ENTITY version "1.1"> + <programlisting><![ CDATA [<!ENTITY version "1.1"> <!ENTITY para1 SYSTEM "para1.sgml"> <!ENTITY para2 SYSTEM "para2.sgml"> <!ENTITY para3 SYSTEM "para3.sgml">]]></programlisting> @@ -1332,8 +1305,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <example> <title>Structure of a marked section</title> - <programlisting> -<![ <replaceable>KEYWORD</replaceable> [ + <programlisting><![ <replaceable>KEYWORD</replaceable> [ Contents of marked section ]]></programlisting> </example> @@ -1399,8 +1371,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <example> <title>Using a CDATA marked section</title> - <programlisting> -<para>Here is an example of how you would include some text + <programlisting><para>Here is an example of how you would include some text that contained many &lt; and &amp; symbols. The sample text is a fragment of HTML. The surrounding text (<para> and <programlisting>) are from DocBook.</para> @@ -1441,8 +1412,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <title>Using <literal>INCLUDE</literal> and <literal>IGNORE</literal> in marked sections</title> - <programlisting> -<![ INCLUDE [ + <programlisting><![ INCLUDE [ This text will be processed and included. ]]> @@ -1480,8 +1450,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <title>Using a parameter entity to control a marked section</title> - <programlisting> -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!ENTITY % electronic.copy "INCLUDE"> ]]> @@ -1495,8 +1464,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>When producing the hard-copy version, change the entity's definition to;</para> - <programlisting> -<!ENTITY % electronic.copy "IGNORE"></programlisting> + <programlisting><!ENTITY % electronic.copy "IGNORE"></programlisting> <para>On reprocessing the document, the marked sections that use <literal>%electronic.copy</literal> as their keyword will be @@ -1513,8 +1481,7 @@ PUBLIC "-//W3C//DTD HTML 4.0//EN" "4.0/strict.dtd"</programlisting> <para>Create a new file, <filename>section.sgml</filename>, that contains the following;</para> - <programlisting> -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ + <programlisting><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" [ <!ENTITY % text.output "INCLUDE"> ]> |