summaryrefslogtreecommitdiffstats
path: root/share/sgml/FreeBSD/doc/example.sgml
blob: a16b684d16aad3c504a46a6e6e4f1b5ddd1e5462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE linuxdoc PUBLIC "-//FreeBSD//DTD linuxdoc//EN">

<!-- Here's an SGML example file. Format it and print out the source, and
     use it as a model for your own SGML files. As you can see this is a
     comment. 
 -->

<article>

<!-- Title information -->

<title>Quick SGML Example
<author>Matt Welsh, <tt/mdw@cs.cornell.edu/
<date>v1.0, 28 March 1994
<abstract>
This document is a brief example using the Linuxdoc-SGML DTD.
</abstract>

<!-- Table of contents -->
<toc>

<!-- Begin the document -->

<sect>Introduction

<p>
This is an SGML example file using the Linuxdoc-SGML DTD. You can format it 
using the command
<tscreen><verb>
$ format -Tnroff | qroff | pg
</verb></tscreen>
this will produce plain ASCII. You can also produce LaTeX, and (soon) HTML
and Texinfo.

<sect>The source

<p>
Looking at the source for this file will be instructive to show you how
to use many of the Linuxdoc-SGML constructs. You should also read the
<em/Linuxdoc-SGML User's Guide/, in the file <tt/guide.sgml/.

The source looks and feels like LaTeX, as you can see. Paragraphs are
separated by blank lines, macros are enclosed in angle brackets. It's 
quite simple. 

<sect>Some examples

<p>
Here are examples of things that you'll be using in the source. First,
let's decend into a subsection:

<sect1>This is a subsection

<p>
As the header says. Note that you need to use the <tt/p/ command to
start the body of the section, after the <tt/sect1/ command.
Here's a subsubsection:

<sect2>This is a subsubsection

<p>
Right. 5 levels of sections are available. Use the commands
<tt/sect/, <tt/sect1/, <tt/sect2/, <tt/sect3/, and <tt/sect4/ to get them.
This document uses the <tt>article</> document style, which is 
appropriate for HOWTOs and other docs; the <tt>report</> style (which 
includes the <tt/chapt/ sectioning command) should be used for the LDP docs. 

<sect1>Example text

<p>
All right, so you're typing along, and you want to show some example code,
or example I/O with a program, whatever. Use the <tt/code/ or <tt/verb/
``environments'' for this, wrapped in a <tt/tscreen/ environment, as so:
<tscreen><verb>
This is an example verb environment.
</verb></tscreen>
As well as:
<tscreen><code>
This is an example code environment.
</code></tscreen>
The <tt/tscreen/ environment just sets the font to small type and 
indents it nicely. It's not required for using <tt/verb/ or <tt/code/,
but I suggest that you do. 

The <em/Linuxdoc-SGML User's Guide/ explains what special characters you
can and can't use in the <tt/verb/ and <tt/code/ environments. 

<sect1><heading>Cross references<label id="test-ref"></>

<p>
What about cross-references? This section has been marked with the
<tt>label</> command; using <tt>ref</> will provide a cross reference,
as in ``See Section <ref id="test-ref">'' for more. 

Right now cross-references don't work in the <tt/nroff/ translation for 
plain ASCII.

<sect1>Using fonts

<p>
You want fonts, we got fonts. Of course these won't show up in the
plain ASCII text, but they all map into the various output formats:
<bf/boldface/, <em/emphasis/, <sf/sans serif/, <sl/slanted/,
<tt/typewriter/, and <it/italics/.

<sect1>Lists

<p>
Lists are easy as well. Just use the <tt/itemize/ element with the
<tt/item/ commands, seen here:
<itemize>
<item> This is a list.
<item> Nothing exciting about that.
       <itemize> 
       <item> Multiple levels are supported as well.
       <item> Again, that's no surprise.
       </itemize>
       <enum>
       <item> Enumerated lists using <tt>enum</> also work.
       <item> Description environments using <tt>descrip</> along
	      with <tt>tag</> are also available, as seen here.
       </enum>
       <descrip>
       <tag/First item./ Here's one item.
       <tag/Second item./ Here's another.
       <tag/Third item./ Can we go for three?
       </descrip>
<item> A final item to top it all off.
</itemize>

This is just about everything that you need to get started with
writing SGML docs using the <tt/linuxdoc-sgml/ DTD. Please let me know
if you think something should be changed or added to this document.

</article>
OpenPOWER on IntegriCloud