-
Notifications
You must be signed in to change notification settings - Fork 1
/
respec-documentation.html
252 lines (206 loc) · 6.46 KB
/
respec-documentation.html
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<html>
<head>
<title>How-to: writing documentation with respec</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c-common" class="remove"></script>
<script class='remove'>
var respecConfig = {
// document info
specStatus: "unofficial",
shortName: "respec",
copyrightStart: "2017",
edDraftURI: "http://github.com/desmovalvo/sepa-documentation",
extraCSS: ["css/respec.css"],
// editors
editors: [{
name: "Fabio Viola",
url: "http://wot.arces.unibo.it",
mailto: "fabio.viola@unibo.it",
company: "ARCES",
companyURL: "http://wot.arces.unibo.it"
}],
// WG
wg: "Web of Things working group of the ARCES laboratory",
wgURI: "http://wot.arces.unibo.it/",
};
</script>
</head>
<body>
<section id="abstract">
<p>
This document describes how to use respec to build documentation
according to the W3C style.
</p>
</section>
<section id="sotd">
This is a first draft.
</section>
<section>
<h2>Introduction</h2>
<p>
To write documentation using the W3C format there are several tools
available. Currently the best choice is *respec*. The documentation is
composed by an HTML file properly structured as follows.
</p>
</section>
<section>
<h2>The head section</h2>
<section>
<h3>Title of the document</h3>
<p>
The head section of the HTML file must contain the title of
the page using
tags <code><title<...</title></code>. respec will
automatically extract the title and put it into
the <code><h1>...</h1></code> tags of the body.
</p>
</section>
<section>
<h3>Including respec</h3>
<p>
The respec script is included in the head section of the html
file with:
<pre class="example">
<script src="http://pandora.aptest.com/w3c/respec-style/builds/respec-w3c-common.js"
class="remove">
</script>
</pre>
</p>
<p>
Online it is possible to find other URLs through which import respec,
but using them I experienced problems, so I strongly advice to use
this one from aptest.
</p>
</section>
<section>
<h3>Settings for respec</h3>
<p>
Writing documentation is as simple as writing an HTML file, but a few
lines of javascript are necessary to set respec parameters. An example
is reported here:
<pre class="example">
<script class='remove'>
var respecConfig = {
// document info
specStatus: "ED",
shortName: "sap",
copyrightStart: "2017",
edDraftURI: "http://github.com/desmovalvo/sap-documentation",
extraCSS: ["css/respec.css"],
// editors
editors: [{
name: "Fabio Viola",
url: "http://wot.arces.unibo.it",
mailto: "fabio.viola@unibo.it",
company: "ARCES",
companyURL: "http://wot.arces.unibo.it"
},
{
name: "Luca Roffia",
url: "http://wot.arces.unibo.it",
mailto: "luca.roffia@unibo.it",
company: "ARCES",
companyURL: "http://wot.arces.unibo.it"
}],
// WG
wg: "Web of Things working group of the ARCES laboratory",
wgURI: "http://wot.arces.unibo.it/",
};
</script>
</pre>
</p>
<p>
For a complete list of javascript variables have a look at
the <a href="https://github.com/w3c/respec/wiki/">respec wiki
on github</a>
</p>
</section>
</section>
<section>
<h2>The body section</h2>
<p>
The body of the HTML page is structured defining one or more
(eventually
nested) <code><section>...</section></code>
blocks, each one provided with a
proper <code><h*>...</h*></code> tag (to state the
title of the (sub)section).
</p>
<section>
<h3>The abstract</h3>
<p>
The first <code><section>...</section></code>
block should be named abstract and should contain the
abstract of the document. Here's an example:
<pre class="example">
<section id="abstract">
<p>
This is a simple abstract for my document.
</p>
</section>
</pre>
</p>
</section>
<section>
<h3>Status of the document</h3>
<p>
If a section named <code>sotd</code> is present, then respec will build the
section "Status of this document".
Inside every section, text should be organized in paragraphs using
<code><p>...</p></code>.
Examples of source code should be enclosed
between <code><pre
class="example">...</pre></code>,
while
short
pieces
of code
should
be
enclosed
between <code><code>...</code></code>.
</p>
</section>
<section>
<h3>Keywords</h3>
<p>
respec automatically recognizes the
following keywords: MUST, MUST NOT, REQUIRED, SHALL, SHALL
NOT, SHOULD, SHOULD NOT, RECOMMENDED, NOT RECOMMENDED, MAY,
</p>
</section>
<section>
<h3>References</h3>
<p>
If you need to refer to a document present
on <a href="http://www.specref.org/"><b>SpecRef</b></a> (pay
attention, specref, not respec!), the process is really
easy! Find the document and take note of the friendly
name. Then, references can be included in an easy way with a
couple of double square brackets surrounding the friendly
name. If this name is preceeded by an exclamation mark, then
it is a <b>normative reference</b>, otherwise it is
an <b>informative reference</b>.
For example to refer to the JSON RFC, we simply look for
JSON on specref and find that <code>[[rfc7159]]</code> may
be right for us. It produces: [[rfc7159]].
</p>
</section>
<section>
<h3>Writing acknowledgements</h3>
<p>
To include acknowlegements
in a document a particular section belonging to
class <code>appendix</code> must be created.
</p>
</section>
</section>
<!-- APPENDIX -->
<section class="appendix">
<!-- ACKNOWLEDGEMENTS -->
<h2>Acknowledgements</h2>
<p>
Authors would like to thanks the Advanced Research Center on Electronic Systems (ARCES) of the University of Bologna.
</p>
</section>
</body>
</html>