-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
374 lines (313 loc) · 18.1 KB
/
README.txt
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
Incipit:
A Unicode-based Text Markup Language.
Seninha (aka phillbush)
The ‘Incipit Markup Language’ (or ‘Incipit’, for short) is a plain text
markup language that uses Unicode characters and the structure of the
text itself to format documents.
In the ‘Incipit Markup Language’, a paragraph is a block of text
delimited by blank lines. A paragraph may be preceded by a section
header and succeded by a figure. Enumerations (also known as “lists”)
are a set of items that extend the paragraph before.
In this document, the word “period” refers sentences delimited by a
period. And the word “colon” refers to a segment of text delimited
by a colon or semi-colon.
§ Punctuation
Incipit uses Unicode characters (called “punctuation” in this document),
alongside the structure of the text, to format documents. For example,
the section character (⟨§⟩, U+00A7) is used to markup section headers.
The bullet character (⟨•⟩, U+2022) is used to markup bulleted lists.
.Inline punctuation.
Punctuations are mostly used within paragraphs and enumerations. Those
punctuations (called inline punctuation) markup references, topics or
preformated text. Punctuations cannot be nested: a portion of text is
either topicalized, or it is preformated, never both. The types of
inline punctuations are enumerated below.
• Topic: Text ‘between single quotes’ is topicalized. The single
quotes must be Unicode characters ⟨‘⟩ (U+2018) and ⟨’⟩
(U+2019). Topic text is formated in italic font and the
punctuation is removed in the final document.
• Reference: Text «between double angle quotes» is reference. The angle
quotes must be Unicode characters ⟨«⟩ (U+00AB) and ⟨»⟩
(U+00BB). References are not supported yet.
• Preformated: Text `between grave accents` or {between curly braces}
is preformated. Those punctuation are regular ASCII
punctuation. Preformated text is formated in monospaced
font and the punctuation is removed in the final
document.
.Typing punctuation.
If you use Unix, you can either configure your keybindings or configure
the Compose key to insert punctuation and other characters not found on
a regular keyboard.
§§ Sections
Paragraphs can be grouped in sections, which can be nested. A section
is a line whose first characters are section punctuations (`§`, U+00A7).
A section can be marked by one or more section punctuations. How many
times that punctuation occurs represents the level of the section. For
example, a first-level section begins with `§`; a second-level section
begins with `§§`, and so on.
§§ Enumerations
An enumeration, also known as list, is a hierarchical grouping of
periods, called the enumeration items. Each item begins with zero
or more tab characters followed by the enumeration punctuation (`•`,
U+2022), also knon as ‘bullet’. The number of tabs in the beginning
of an item identifies the item level: zero tab for first-level items;
one tab for second-level items; and so on.
.Enumeration label.
When formated, each enumeration item is usually preceded by a bullet.
However, it can be changed by following the enumeration punctuation by
a string between parentheses. This can be used for ordered lists, when
the label is a number or letter.
.Enumeration incipit.
Each enumeration item can have a incipit colon, which will be explained
on the “§ Incipit” section below. The incipit colon is a colon
describing the topic of the item.
The following is an example of enumeration.
• (A) First item:
This is the first item of a labeled enumeration.
This item also contains an incipit colon.
• (B) Second item:
This is the second item of a labeled enumeration.
It also contains an incipit colon.
• (C) Third item.
• First subitem of third item.
• Second subitem of third item.
• Third subitem of third item.
• Fourth subitem of third item.
• (D) Fourth item.
• (E) Fifth item.
§ Footnotes
A footnote is a text placed at the bottom of a page in an incipit
document. Footnotes are marked by an asterisk between square brackets
in a paragraph or enumeration.[*] The content of the footnote must
immediately follow the paragraph and must be preceded by the same
mark (an asterisk between square brackets) followed by a colon.
[*]: This is an example of footnote.
§ Incipit
The word “incipit” comes from the Latin and means “it begins”. The
incipit of a text is the first few words of the text. In the ‘Incipit
Markup Language’, incipits are initial elements of the text used to
format the text itself. The incipit of a document is its first
paragraph (which contains the title and some meta information); the
incipit of a paragraph is its first period (its first sentence); the
incipit of a period is its first colon (the part separated by colon).
In the ‘Incipit’ Markup Language, a text unit can have no incipit.
A document without incipit is a document without title.
A paragraph without incipit is a paragraph without its special first
period. This implies that certain units of text are made up of two
parts: an optional incipit and a body.
.The incipit of a document.
The first paragraph of a document is its incipit. If the document
begins with a blank line or with a figure or enumeration, the document
has no incipit. The first period (ie', the first sentence) of the
document's incipit is the title. If this period has a incipit colon,
this colon is the main title and the rest is the subtitle. For example,
this document has an incipit paragraph, which has an incipit period (the
full title), which has an incipit colon (the main title). The remaining
periods are interpreted depending on the output format. In troff, the
following periods are the authors and their institution.
.The incipit of a paragraph.
If the first period of a paragraph begins with a period punctuation,
this paragraph contains a incipit period. This incipit period, called
the title of the paragraph, is formated in bold font. In the source
plain text of this document, the incipit of a paragraph is written alone
in a line above the rest of the paragraph.
.The incipit of a period.
In an enumeration, the first colon of the first period of a enumerated
item is the item's incipit colon. This incipit colon, called title of
the enumeration, is formated in bold font. The first enumeration of
this document, listing the types of inline punctuations, contains
incipit colons.
§ Figures
Figures are text delimited between curly brackets. The opening curly
bracket must be the last character in a line and the closing curly
bracket must be the first character in a line. The content of a figure
is usually idented with a tab, so the first tab of each code line is
removed in the final document. A tag before the open curly bracket and
followed by a colon indicates the type of the figure. The content
between the tag and the open curly bracket is the caption
.Code Listings.
The simplest form of figure is a code listing, an example of which,
copied from the second edition of “The C Programming Language” book,
is presented below.
CODE: Hello World. {
#include <stdio.h>
main()
{
printf("hello, world\n");
}
}
.PIC Diagrams.
When converting to troff, diagrams can be written in the PIC language.
Diagrams are marked with the ⟨PIC:⟩ keyword before the opening curly
bracket. The only punctuation that are processed inside a PIC figure
are topics.
PIC: Troff compilation process. {
box “file.roff”
arrow
ellipse “troff”
arrow
ellipse “dpost”
arrow
box “file.ps”
}
.Images.
Images can be inserted on a document by preceding the opening bracket
with the ⟨IMAGE:⟩ keyword, optionally followed by a caption. Note that
only `.eps` images are supported when converting to troff. When
converting to html, however, common formats such as `.jpg` and `.png`
are supported.
IMAGE: A monkey riding a parrot. {
figure.eps
}
.Tables.
Tables are special figures in the sense that they are not written
between curly brackets. Tables must be written using box drawing
Unicode characters. Columns must be separated by a vertical light
box drawing character. The first row separator must contain double
box drawing characters, and the following ones must be separated by
light double box drawing characters. The following is an example of
table.
┌─────────┬──────┬────────────┬───────────────┐
│ COUNTRY │ AREA │ POPULATION │ CONTINENT │
╞═════════╪══════╪════════════╪═══════════════╡
│ Brazil │ 3286 │ 134 │ South America │
├─────────┼──────┼────────────┼───────────────┤
│ Canada │ 3852 │ 25 │ North America │
├─────────┼──────┼────────────┼───────────────┤
│ China │ 3705 │ 1032 │ Asia │
├─────────┼──────┼────────────┼───────────────┤
│ England │ 94 │ 56 │ Europe │
├─────────┼──────┼────────────┼───────────────┤
│ France │ 211 │ 55 │ Europe │
├─────────┼──────┼────────────┼───────────────┤
│ Germany │ 96 │ 61 │ Europe │
├─────────┼──────┼────────────┼───────────────┤
│ India │ 1267 │ 746 │ Asia │
├─────────┼──────┼────────────┼───────────────┤
│ Japan │ 144 │ 120 │ Asia │
├─────────┼──────┼────────────┼───────────────┤
│ Mexico │ 762 │ 78 │ North America │
├─────────┼──────┼────────────┼───────────────┤
│ USA │ 3615 │ 237 │ North America │
├─────────┼──────┼────────────┼───────────────┤
│ USSR │ 8649 │ 275 │ Asia │
└─────────┴──────┴────────────┴───────────────┘
Country table from The AWK Book.
.Tables (row span).
If a cell in a table contains only two apostrophes (⟨''⟩, called
‘ditto’), this cell contains the same content of the the cell above it,
and both cells are merged into a single one. We call this phenomenon a
‘row span’. Row spans are only supported when converting to troff.
Column span is not supported at all. The following is an example of a
table with row span.
┌─────────┬──────┬────────────┬───────────────┐
│ COUNTRY │ AREA │ POPULATION │ CONTINENT │
╞═════════╪══════╪════════════╪═══════════════╡
│ Brazil │ 3286 │ 134 │ South America │
├─────────┼──────┼────────────┼───────────────┤
│ Canada │ 3852 │ 25 │ North America │
├─────────┼──────┼────────────┼───────────────┤
│ Mexico │ 762 │ 78 │ '' │
├─────────┼──────┼────────────┼───────────────┤
│ USA │ 3615 │ 237 │ '' │
├─────────┼──────┼────────────┼───────────────┤
│ France │ 211 │ 55 │ Europe │
├─────────┼──────┼────────────┼───────────────┤
│ Germany │ 96 │ 61 │ '' │
├─────────┼──────┼────────────┼───────────────┤
│ England │ 94 │ 56 │ '' │
├─────────┼──────┼────────────┼───────────────┤
│ China │ 3705 │ 1032 │ Asia │
├─────────┼──────┼────────────┼───────────────┤
│ Japan │ 144 │ 120 │ '' │
├─────────┼──────┼────────────┼───────────────┤
│ India │ 1267 │ 746 │ '' │
├─────────┼──────┼────────────┼───────────────┤
│ USSR │ 8649 │ 275 │ '' │
└─────────┴──────┴────────────┴───────────────┘
Country table from The AWK Book.
.Tables (alternative form).
‘Incipit’ supports an alternative format for tables, in which the first
row separator contains light box drawing characters, and the following
rows are not separated by any character but a new line. An example of
such table is presented below.
┌─────────┬──────┬────────────┬───────────────┐
│ COUNTRY │ AREA │ POPULATION │ CONTINENT │
├─────────┼──────┼────────────┼───────────────┤
│ Brazil │ 3286 │ 134 │ South America │
│ Canada │ 3852 │ 25 │ North America │
│ China │ 3705 │ 1032 │ Asia │
│ England │ 94 │ 56 │ Europe │
│ France │ 211 │ 55 │ Europe │
│ Germany │ 96 │ 61 │ Europe │
│ India │ 1267 │ 746 │ Asia │
│ Japan │ 144 │ 120 │ Asia │
│ Mexico │ 762 │ 78 │ North America │
│ USA │ 3615 │ 237 │ North America │
│ USSR │ 8649 │ 275 │ Asia │
└─────────┴──────┴────────────┴───────────────┘
Country table from The AWK Book.
.Quotation.
Quotations are special figures which, instead of curly braces, are
written between double quotes.
“
I'd just like to interject for a moment. What you're referring
to as Linux, is in fact, GNU/Linux, or as I've recently taken to
calling it, GNU plus Linux. Linux is not an operating system
unto itself, but rather another free component of a fully
functioning GNU system made useful by the GNU corelibs, shell
utilities and vital system components comprising a full OS as
defined by POSIX.
”
§ Conventions
Texts written in the Incipit markup languages use some unusual
conventions that are described below.
.Apostrophe for abbreviations.
In usual non-Incipit text, a full stop can be used both to mark the end
of a period and to mark the end of an abbreviations. This ambiguity
does not exist in Incipit. In Incipit, abbreviations should be marked
with appostrophes.
.Uppercase for emphasis.
In usual non-Incipit text, the italic (or bold) font is used to render
segments of text with emphasis. In Incipit, non-roman fonts are used
for syntactic purposes (for example, bold text is used for the title of
a paragraph, and italic is used for topics and quotations). In Incipit,
text with emphasis should be written in all caps.
.Parentheses for parenthesis.
While some texts use em-dashes to mark parenthetical text, in Incipit,
only parentheses are used for that.
§ Conversion
The `i2roff(1)` and `i2html` awk scripts convert a text written in
Incipit to pdf (using the `mt(7)`, `mb(7)`, or `mp(7)` troff macro
packages), or to HTML formats.
Converting an Incipit text to HTML is simple, just use the `i2html(1)`
script to read the text file, and the converted document is printed to
standard output.
{
i2html <file.txt >file.html
}
Converting an Incipit text to PDF is more complex. First, the text must
be converted to `mt(7)`, `mb(7)`, or `mp(7)`, which are `troff(1)` macro
packages.
{
i2roff <file.txt >file.roff
}
Then, we need to convert the `.roff` file to a `.ps` (postscript) file,
this is done with a series of commands in a pipeline. Those commands
depend on the troff system and vary between Groff, Heirloom Doctools,
etc. We need to chose one of the macro packages: `mt(7)` if we are
formatting a A4 paper; `mb(7)` if we are formatting a book; or `mp(7)`
if we are formatting a slide presentation;. Using Heirloom Doctools,
the command is the following to generate a `mt(7)` document.
{
<file.roff pic | tbl | troff -mt -mpictures | dpost >file.ps
}
Then, we need to convert the `.ps` file into a `.pdf` file. This is
done with the `ps2pdf(1)` command. This command accepts as argument
the papersize, which can be `a4`, `letter`, `isob5`, etc.
{
ps2pdf "-sPAPERSIZE=a4" file.ps file.pdf
}
A Makefile automatizing the conversion process is distributed with
Incipit. For more information on the `mt(7)`, `mb(7)` and `mp(7)`
macro packages, manuals for them are distributed as well.