PageRenderTime 183ms CodeModel.GetById 177ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms


XML | 192 lines | 144 code | 48 blank | 0 comment | 0 complexity | 3a9c6987fae41bc312086d30d4b179f9 MD5 | raw file
  1<section id="styletest" c="remark"
  2    xmlns:xsi=""
  3    xsi:noNamespaceSchemaLocation=''>
  4    <title> Stylesheet Test  </title>
  5  <abstract> <p>
  6  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>
  7  </abstract>
 10<title> What is Slacker's Docbook? </title>
 11<p> hi there </p>
 14<indexterm><primary>Slacker's Docbook</primary>  </indexterm>
 15<indexterm><primary>Docbook/XML</primary>  </indexterm>
 17<p> Slacker's Docbook is two things. </p>
 19<li> A language which you can write books in </li>
 20<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>
 23<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>
 25<p> It is much faster and easier to compose Slacker's than to use standard Docbook/XML. </p>
 27<p> The scripts are organized and deployed by <a href=""> Apache Ant,</a> an open source, cross platform, Java-based build tool.</p>
 29<p> Output format is controlled by easily customizable stylesheets which we have provided. </p>
 31<p> The use of several Slacker's Docbook tags and directives is demonstrated below. </p>
 33<p condition="textbook">
 34  This text is in a condition="textbook" element, so it only appears
 35  in the textbook version.
 38<p c="textbook">
 39    <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>
 42 <figure id="examplefigure">
 43 <title> A title for a figure </title>
 44 <img scale="50" src="./uml/entitymgr.png" alt="a beautiful UML diagram" />
 45 </figure>
 47 <p condition="slides" >
 48 <tt>ant slides</tt> generates a slides version of the document. Like <tag>textbook</tag>, <tag>slides</tag> is another conditional name and tag.
 49 </p>
 51  <ol>
 52     <li> Here is an ordered list. item.
 53     It should look familiar since it's tag is borrowed from XHTML. </li>
 54     <li>
 55       This ordered list shows you which version(s) you are reading: </li>
 56        <li condition="textbook"> You are reading textbook text. </li>
 57        <li condition="slides"> You are reading slides text.  </li>
 58        <li condition="remark"> You are also reading draft remarks. These are notes to other authors and reviewers, and some sections under construction.  </li>
 59        <li condition="solution"> Solutions to exercises </li>
 60        <li condition="instructor"> Instructor's notes </li>
 61        <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>
 62        <li condition="todo"> Make it possible to detect new conditions? Or have "all" blindly include everything?
 63        </li>
 64        <li> This listitem item appears in every version </li>
 65    </ol>
 67    <p> An <b>admonition</b> is a Docbook tag with a title and an associated icon. </p>
 69    <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>.
 70     </p>
 72   <warning> <title> Warning </title>
 73   <p>
 74   Danger Will Robinson. Things to be careful about. </p>
 75   </warning>
 77   <caution> <title> Caution </title>
 78   <p>
 79   Cautions can be dangerous to your health.
 80   They happen to be mapped to <tag>warning</tag> anyway. </p>
 81   </caution>
 83  <note> <title> This is a note </title>
 84  <p>
 85   Take note of that. It's important!
 86   </p>
 87   </note>
 89   <important> <title> Important </title>
 90   <p>
 91   This is actually not so important, since it's
 92   mapped to <tag>note</tag>. </p>
 93   </important>
 95   <tip> <title> Tip </title> <p>
 96   This is a tip. It's very good advice. It could save you time. </p>
 98   </tip>
100   <question>
101   <p>
102   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>
103   </question>
105   <prereq>
106   <p>
107   This is inside a <tag>prereq</tag>. It's mapped to the
108   <tag>caution</tag> admonition since we are not using it.
109   </p>
110   </prereq>
112 <p>
113    The glyphs are taken from Bobco fonts, with copyrights held by the <a href="">Subgenius Foundation</a> <footnote><para> Praise Bob! </para></footnote>.</p>
115 <sidebar>
116 <title> This is the title of a sidebar </title> <p>
117 This is a sidebar. Passages which elaborate further
118 ideas in the slides belong in a sidebar.  </p>
119 </sidebar>
122   <title> A formalpara about parabullet (<tag>pb</tag>)  </title>
123   <p>
124   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>
125 </formalpara>
127    <pb>
128        <li> This content is inside <tag>pb</tag>, which is short for <i>parabullet</i>. </li>
129        <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.
130        </li>
131        <li> Otherwise, the preprocessor translates each <tag>li</tag> into a <tag>listitem</tag> <tag>para</tag>
132              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>
134        <li> This means that unordered lists inside <tag>pb</tag>should be properly punctuated.  </li>
135        <li> <tag>li</tag> is much easier to type than <tag>listitem</tag> <tag>para</tag>.  </li>
136    </pb>
139    <ul>
140      <li> This is a regular unordered list. </li>
141      <li> It should appear always as a bullet in all versions. </li>
142    </ul>
144    <todo>
145      The <tag>todo</tag> element is mapped to <tag>p</tag> but also has a bold heading that says "Todo Items". </todo>
147      <ol>
148      <li> Add keyword-processing with hyperlinks to the
149      <a href="@docbookdoc@/ref-elements.html">Element
150      Reference Guide</a>. We have it already in the C++ textbook. </li>
151      </ol>
154    <p c="remark">
155       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>
157   <remark>
158         The <tag>remark</tag> tag is just shorthand for a
159         <tag>para class=&quot;remark&quot;</tag>
160     </remark>
162    <solution>
163       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).
164    </solution>
166<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.
169<bridgehead> About including files </bridgehead>
171    <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>
173 <include src="impl.xml" mode="text" />
175   <todo> Add conditional inclusion tags for XML
176          inside proper XML comments. </todo>
178    <p> When including C++, you can use //start and //end comments to switch on/off inclusion. </p>
180    <p> In addition, c-style comments appear as callouts in the listings. </p>
182<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.
183 </p>
185    <include src="dialogs.cpp" mode="cpp" segid="menu"/>
187    <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.
188    </p>
190    <include src="sample.cpp" mode="cpp" segid="main" link="false"/>