PageRenderTime 44ms CodeModel.GetById 20ms app.highlight 5ms RepoModel.GetById 15ms app.codeStats 1ms

/bundles/plugins-trunk/XML/test_data/slackerdoc/styletest.xml

#
XML | 198 lines | 146 code | 51 blank | 1 comment | 0 complexity | c80acd787eefc35910d4f41f30b86649 MD5 | raw file
  1<section id="styletest" c="remark"  
  2    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3    xsi:noNamespaceSchemaLocation='http://slackerdoc.tigris.org/xsd/slackerdoc.xsd'
  4>
  5<!-- :xml.root=index.xml: -->
  6    <title> Stylesheet Test  </title>
  7
  8  <abstract> <p> 
  9  This file is an example that uses all Slacker document elements, and a subset of common/popular elements from the <a href="@docbookdoc@/part2.html">Docbook</a> language. It's also a testcase for the scripts and stylesheets. </p> 
 10  </abstract>
 11
 12<question>
 13<title> What is Slacker's Docbook? </title>
 14<p> hi there </p>
 15</question>
 16
 17<indexterm><primary>Slacker's Docbook</primary>  </indexterm>
 18<indexterm><primary>Docbook/XML</primary>  </indexterm>
 19
 20<p> Slacker's Docbook is two things. </p>
 21<ol>
 22<li> A language which you can write books in </li>
 23<li> A set of scripts and files which convert from Slacker's Docbook (the language) into Docbook/XML, and later to other file formats such as HTML, PDF, LaTex. </li>
 24</ol>
 25
 26<p> The motivation for developing this is explained in <xref linkend="motivation" />. </p>
 27
 28<p> Most of the non-Docbook tags added to Slacker's Docbook will be familiar to anyone who has edited an HTML page, since they were taken from HTML. </p>
 29
 30<p> It is much faster and easier to compose Slacker's than to use standard Docbook/XML. </p>
 31
 32<p> The scripts are organized and deployed by <a href="http://ant.apache.org"> Apache Ant,</a> an open source, cross platform, Java-based build tool.</p>
 33
 34<p> Output format is controlled by easily customizable stylesheets which we have provided. </p>
 35
 36<p> The use of several Slacker's Docbook tags and directives is demonstrated below. </p>
 37
 38<p condition="textbook">
 39  This text is in a condition="textbook" element, so it only appears
 40  in the textbook version. 
 41</p>
 42
 43<p c="textbook">
 44    <tt>ant bookhtml</tt> or <tt>ant pdf</tt> both generate versions that include textbook elements. An alternate way of describing textbook conditionals is with the <tag>textbook</tag> tag. This is equivalent to a <tag>p condition="textbook"</tag> 
 45</p>
 46
 47
 48 <figure id="examplefigure">
 49 <title> A title for a figure </title>
 50 <img scale="50" src="./uml/entitymgr.png" alt="a beautiful UML diagram" />
 51 </figure>
 52
 53 <p condition="slides" >
 54 <tt>ant slides</tt> generates a slides version of the document. Like <tag>textbook</tag>, <tag>slides</tag> is another conditional name and tag.  
 55 </p>
 56 
 57  <ol>
 58     <li> Here is an ordered list. item. 
 59     It should look familiar since it's tag is borrowed from XHTML. </li>
 60     <li> 
 61       This ordered list shows you which version(s) you are reading: </li>
 62        <li condition="textbook"> You are reading textbook text. </li>
 63        <li condition="slides"> You are reading slides text.  </li>
 64        <li condition="remark"> You are also reading draft remarks. These are notes to other authors and reviewers, and some sections under construction.  </li>
 65        <li condition="solution"> Solutions to exercises </li>
 66        <li condition="instructor"> Instructor's notes </li>        
 67        <li condition="junk"> This is a junk tag. It shouldn't appear at all since I haven't defined it as a condition in the script yet.</li>
 68        <li condition="todo"> Make it possible to detect new conditions? Or have "all" blindly include everything?
 69        </li>        
 70        <li> This listitem item appears in every version </li>
 71    </ol>
 72 
 73    <p> An <b>admonition</b> is a Docbook tag with a title and an associated icon. </p>
 74    
 75    <p> Here are the available admonitions. The original Docbook admonitions are all supported in Slacker's Docbook; however, we have added two new tags: <tag>prereq</tag> and <tag>question</tag>.
 76     </p>  
 77    
 78   <warning> <title> Warning </title>
 79   <p> 
 80   Danger Will Robinson. Things to be careful about. </p> 
 81   </warning>
 82
 83   <caution> <title> Caution </title> 
 84   <p> 
 85   Cautions can be dangerous to your health.
 86   They happen to be mapped to <tag>warning</tag> anyway. </p> 
 87   </caution>
 88   
 89  <note> <title> This is a note </title>
 90  <p> 
 91   Take note of that. It's important! 
 92   </p>
 93   </note>
 94   
 95   <important> <title> Important </title>
 96   <p> 
 97   This is actually not so important, since it's
 98   mapped to <tag>note</tag>. </p>
 99   </important>
100   
101   <tip> <title> Tip </title> <p> 
102   This is a tip. It's very good advice. It could save you time. </p>
103   
104   </tip>
105
106   <question> 
107   <p> 
108   The Docbook meaning of <tag>question</tag> remains the same if it appears inside a <tag>qandaset</tag>. However, if it appears where a other admonitions are allowed, <tag>question</tag> is mapped to the docbook <tt>important</tt> admonition. </p>  
109   </question>
110  
111   <prereq>
112   <p> 
113   This is inside a <tag>prereq</tag>. It's mapped to the  
114   <tag>caution</tag> admonition since we are not using it.
115   </p>
116   </prereq>
117   
118 <p> 
119    The glyphs are taken from Bobco fonts, with copyrights held by the <a href="http://www.subgenius.com/">Subgenius Foundation</a> <footnote><para> Praise Bob! </para></footnote>.</p>
120 
121 <sidebar>
122 <title> This is the title of a sidebar </title> <p> 
123 This is a sidebar. Passages which elaborate further
124 ideas in the slides belong in a sidebar.  </p>
125 </sidebar>
126 
127<formalpara>
128   <title> A formalpara about parabullet (<tag>pb</tag>)  </title>
129   <p>
130   This is a <tag>formalpara</tag> which is discussing the parabullet that follows. parabullets are very interesting because they are rendered quite differently depending on which version you are generating. In order to simultaneously write bullet-text for the slides version and paragraph text in the book version without repeating yourself, mark each paragraph as a <tag>pb</tag>, marking up each major idea in it as an <tag>li</tag>. </p> 
131 </formalpara>
132   
133    <pb>
134        <li> This content is inside <tag>pb</tag>, which is short for <i>parabullet</i>. </li>
135        <li> When a <tag>pb</tag> is encountered, and condition['slides'] is not true, we translate <tag>pb</tag> into <tag>para</tag>, stripping all <tag>li</tag>s. 
136        </li>
137        <li> Otherwise, the preprocessor translates each <tag>li</tag> into a <tag>listitem</tag> <tag>para</tag>
138              and the <tag>pb</tag> maps to an <tag>unorderedlist</tag>. They appear as bullets in the slides version and paragraphs in the textbook. </li>
139
140        <li> This means that unordered lists inside <tag>pb</tag>should be properly punctuated.  </li>
141        <li> <tag>li</tag> is much easier to type than <tag>listitem</tag> <tag>para</tag>.  </li> 
142    </pb>
143
144
145    <ul>
146      <li> This is a regular unordered list. </li>
147      <li> It should appear always as a bullet in all versions. </li>
148    </ul>
149    
150    <todo>   
151      The <tag>todo</tag> element is mapped to <tag>p</tag> but also has a bold heading that says "Todo Items". </todo>
152      
153      <ol>
154      <li> Add keyword-processing with hyperlinks to the
155      <a href="@docbookdoc@/ref-elements.html">Element
156      Reference Guide</a>. We have it already in the C++ textbook. </li>
157      </ol>
158    
159    
160    <p c="remark"> 
161       This is a paragraph marked conditionally with remark, but using the abbreviated c= attribuite. Since it is a remark, it should only be visible in the  development version, and is styled for remark. </p>
162
163   <remark>
164         The <tag>remark</tag> tag is just shorthand for a
165         <tag>para class=&quot;remark&quot;</tag>
166     </remark>
167   
168    <solution> 
169       We have a solution tag which creates a formalpara with a "solution" title, and wraps around whatever needs to be part of the solution. Content between solution tags can easily be excluded from a particular target if you want to control the time and place of its release (e.g., to students). 
170    </solution>
171       
172<p condition="remark"> <tt>ant dev</tt> Generates the HTML "development" version which contains every conditional included in the output, highlighted in different colors as specified in the css file.
173</p>
174
175<bridgehead> About including files </bridgehead>
176
177    <p> We can include xml files as <tt>mode="text"</tt> (the default for all files which do not have a .cpp or .h suffix). It does simple line-wrap. </p>
178
179 <include src="impl.xml" mode="text" />
180
181   <todo> Add conditional inclusion tags for XML
182          inside proper XML comments. </todo>
183 
184    <p> When including C++, you can use //start and //end comments to switch on/off inclusion. </p>
185        
186    <p> In addition, c-style comments appear as callouts in the listings. </p>
187
188<p> Click on filename, or the "link" icon below the included code to see the original file before processing. Notice we only see a small piece.
189 </p>
190
191    <include src="dialogs.cpp" mode="cpp" segid="menu"/> 
192
193    <p> In this next example, there is no link, and in fact, the included file has restricted permissions, so you should not be able to see it even if you guessed at its url.
194    </p>
195        
196    <include src="sample.cpp" mode="cpp" segid="main" link="false"/>
197        
198</section>