aboutsummaryrefslogtreecommitdiffhomepage
path: root/data/doc/sisu/v2/on_sisu_markup/sisu_markup.txt
blob: 0af080c5a21afde85f798304bf260fba955c12e8 (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
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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
%% Summary ---------------------------------------------------------------------

sisu takes an ASCII (UTF-8) document and abstracts the document into its
structure and smaller constituent parts, objects. This abstraction is then used
in subsequent processing to reconstitute the document into disparate document
representations, many quite different from one another, e.g. HTML, ODF, LaTeX
and to populate SQL

SiSU identifies the document structure (headings and their levels) and pulls
the document apart in to its constituent parts, objects (paragraphs, headings,
tables, images etc.) to which it assigns an object number if substantive
content.

From the marked up document SiSU need to be able to determine a documents
structure, and the objects that a document contains

The first line of a SiSU marked up document can identify itself with

%% Identify SiSU Document ------------------------------------------------------

% SiSU

%% The Basic SiSU Markup Document ----------------------------------------------

SiSU documents are divided into two parts:

(i) the document header, which contains (a)  metadata and (b) processing
instructions if any document headers take the form of a tag and the related
related information

(ii) the substantive content

%% Minimum (SiSU) Markup Requirements ------------------------------------------

minimum requirements for a SiSU document

(i)(a) document header metadata, should contain at least:

@title:

@creator:
  :author:

(i)(b) processing instructions (grouped under @make:) are not required as there
are defaults that will be used

(ii) the substantive document structure must be defined, here structure equates
to the headings and their relative levels, this can be done either by explicit
markup where each heading occurs, or in the header @make: section of the, or
both

(iii) the basic document objects are headings and paragraphs. Paragraphs are
identified automatically, and headings must be defined, so sisu is able to
determine the basic objects without anything further

sample_1.sst

%% Document Structure ----------------------------------------------------------

Document structure (heading levels) are determined from information provided in
the markup of the document. There are two ways to identify document structure:
(i) manual markup of headings with their level; (ii) in the sisu header, under
@make: :heading: provide a regex, in the manner understood by sisu, that
identifies what to look for in headings of various levels.

Document structure is the different headings in a document, and their relative
levels.

There are two sets of docment level markers :A~ and an optional :B~ & :C~ and
beneath that 1~, 2~, 3~.

For the first set of document level markers the document Title being the top
level in the hierarchy; beneath that book titles if the document contains more
than one book followed by sections

%% Document Objects ------------------------------------------------------------

Document objects are units of text that are identified, stored and processed as
a block. The most usual document objects would be paragraphs and headings. A
more complete list of objects includes: paragraphs; headings; tables; code
blocks; verse (the poem is identified, but each verse is an object); grouped
text... 

%% The Gory Details ------------------------------------------------------------


%% comments --------------------------------------------------------------------

Comments in sisu are a percentage sign at the start of a line followed by a
space and then the comment

% this would be a comment

%% headings --------------------------------------------------------------------

There are two sets of docment heading markers :A~ and an optional :B~ & :C~ and
beneath that 1~, 2~, 3~. These markers are placed at the start of the
line/paragraph, and followed by the heading

There is usually one :A~ top level heading, which is the document title,
sometimes including the author. This is such a common occurrence that there is
a shortcut where metadata headers are provided for @title: and @creator
:author:, instead of rewriting the title and author's name, you may write :A~
@title @author

If you have a document/manuscript that has subsections above the level of
chapter, such as multiple books, parts, section, two additional top level
headings are available :B~ and :C~

At the main division level, usually chapter heading level 1~ begins, followed
by 2~ and 3~ if the chapter has subheadings. Because the html and epub
segmented output breaks level 1~ into separate files it is possible to provide
the filename, e.g. 1~prologue Prologue

Where names are provided following the heading tilde, these become tagged
points within the document which can where the output format permits be
(hyper-)linked to.

%% font effect, modified font including emphasis -------------------------------

Whithin normal text it is possible to modify the font effect of a word or
phrase using the following markers:

!{ bold }!

/{ italics }/

_{ underscore }_

*{ emphasis }* (how emphasis is represented in output text can be defined in
the header @make: section of a document or in the sisurc.yml config file, and
this may be as bold, italics or underscore, the default being bold)

^{ superscript }^

,{ subscript },

+{ inserted text }+

_{ strikethrough }_

An exclamation mark followed by an underscore at the start of a line will bold
that line until the first line-break

!_ this line would be bold

It is also possible to define in the header section under the @make: section
which words or patterns should automatically be made bold or italics.

@make:
 :bold: /Gnu|Linux|Debian|Fedora|Ruby|SiSU/
 :italics: /inter alia/

%% indent ----------------------------------------------------------------------

_1 a paragraph that is indented one level

_2 a paragraph that is indented two steps

%% bullet ----------------------------------------------------------------------

_* bulleted text

_1* bulleted indented text

%% auto-numbering  -------------------------------------------------------------

Some auto-numbering occurs in the building of sisu documents, either by default
or when requested through configuration options

%% auto-numbering document objects ---------------------------------------------

Document objects are automatically given sequential object numbers, object
citation numbers (ocn). If there is text that for some reason should not be
regarded as substantive objects, it is possible to prevent a document number
being given by adding ~# to the end of the object (paragraph/heading, etc.) ~#

A variation used for headings that are added to provide document structure that
should where possible not be included in output is -# a heading that is marked
with -# is un-numbered and may be excluded from document outputs.

%% auto-numbering headings -----------------------------------------------------

Note auto-numbering of headings may be specified in the header @make: :num_top:
by providing the heading level from which numbering is to start, this is
usually at the chapter level (1~).

@make:
 :num_top: 1

numbering continues three levels down, level 1 being numbered 1, 2, 3 ...
level 2: 1.1, 1.2, 1.3 and so on
level 3: 1.1.1, 1.1.2, 1.1.3

It is also possible to make an auto-numbered list

# numbered list                numbered list 1., 2., 3, etc.

_# indented lettered list sub-level of previous list number a., b., c., d., etc.

%% line breaks -----------------------------------------------------------------

<:br> line break

In paper/ page oriented outputs, such as LaTeX/pdf the following are avaiable

<:pb> page or column break

<:pn> new page

in the header section under @make: :breaks: new and break set a page break or
new page at the levels indicated, e.g.

@make:
 :breaks: new=C; break=1

%% footnotes / endnotes --------------------------------------------------------

This paragraph contains a footnote~{ a footnote or endnote }~ which would be
automatically numbered

Footnotes and endnotes are marked up at the location where they would be
indicated within a text. They are automatically numbered. The output type
determines whether footnotes or endnotes will be produced

In addition to regular footnotes/endnotes there are astrisk and plus sign
numbered and unnumbered footnotes.

normal text ~[* editors notes, numbered asterisk footnote/endnote series ]~ continues

normal text ~[+ editors notes, numbered asterisk footnote/endnote series ]~ continues

normal text ~{* unnumbered asterisk footnote/endnote, insert multiple asterisks if required }~ continues

%% tag points ------------------------------------------------------------------

Tag points are markers within the document which may be used within the
document for (internal document) linking where the output format permits. Tag
names should use alphanumeric characters and underscores [a-z0-9_]+.

There are different types of tag point, some automatically provided by sisu,
such as each ocn (object citation number)

Manual tags may be provided either:

(a) with headings where a name is added to the heading level after the tilde:

1~prefix [heading]

(b) a tag marker can be added to a paragraph using an asterisk tilde and the
name *~tag_marker

%% links and urls --------------------------------------------------------------

Urls found within text are marked up automatically, and where the output type
permits is autmatically hyperlinked to inself and decorated with angled braces
(unless contained in a code block, or escaped by a preceeding underscore).

To link text or an image to a url the markup is as follows

{ this is the linked section of text}http://url.org

Where it is wished to include the url for the linked text in a footnote, the
long form of markup would be:
{ SiSU }http://www.jus.uio.no/sisu/ ~{ http://www.jus.uio.no/sisu/ }~

A short form is provided for achieving the same:
 {~^ SiSU }http://www.jus.uio.no/sisu/

%% images ----------------------------------------------------------------------

Images are placed in the directory beneath the location of the document to be
processed _sisu/image

The following are examples of links to images

{ tux.png 64x80 }image

{tux.png 64x80 "Gnu/Linux - a better way" }http://www.jus.uio.no/sisu/

{GnuDebianLinuxRubyBetterWay.png 100x101 "Way Better - with Gnu/Linux, Debian and Ruby" }http://www.jus.uio.no/sisu/

The 64x80 in the first example is the image dimension, (width x height). This
may be omitted if imagemagick or graphicsmagick are installed, as they will
determine the image dimensions

As with other linked text, the following markup

{~^ ruby_logo.png "Ruby" }http://www.ruby-lang.org/en/

maps to

{ ruby_logo.png "Ruby" }http://www.ruby-lang.org/en/ ~{ http://www.ruby-lang.org/en/ }~

%% grouped text ----------------------------------------------------------------

%% group -----------------------------------------------------------------------

The start and end of text that is grouped are tagged. Grouped text retains its
line breaks, and is treated as a unit, getting a single ocn

group{

License: GPL 3 or later:

SiSU, a framework for document structuring, publishing and search

Copyright (C) Ralph Amissah

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.

If you have Internet connection, the latest version of the GPL should be
available at these locations:
<http://www.fsf.org/licensing/licenses/gpl.html>
<http://www.gnu.org/licenses/gpl.html>

}group

%% poem ------------------------------------------------------------------------

The start and end of a poem are tagged. Each verse in a poem is given an object
number. Verses retain their line breaks.

poem{

verse here
declare

another verse
here

}poem

%% table -----------------------------------------------------------------------

{table~h 24; 12; 12; 12; 12; 12; 12;}
                                |Jan. 2001|Jan. 2002|Jan. 2003|Jan. 2004|July 2004|June 2006
Contributors*                   |       10|      472|    2,188|    9,653|   25,011|   48,721
Active contributors**           |        9|      212|      846|    3,228|    8,442|   16,945
Very active contributors***     |        0|       31|      190|      692|    1,639|    3,016
No. of English language articles|       25|   16,000|  101,000|  190,000|  320,000|  630,000
No. of articles, all languages  |       25|   19,000|  138,000|  490,000|  862,000|1,600,000


table{ c3; 40; 30; 30;

This is a table
this would become column two of row one
column three of row one is here

And here begins another row
column two of row two
column three of row two, and so on

}table

a second form may be easier to work with in cases where there is not much information in each column

%% code ------------------------------------------------------------------------

code{

code lines here

and so on

}code

%% headers ---------------------------------------------------------------------

%% header metadata -------------------------------------------------------------

@title: SiSU
 :subtitle: Markup

@creator:
 :author: Amissah, Ralph

@rights:
 :copyright: Copyright (C) Ralph Amissah 2007, part of SiSU documentation
 :license: GPL 3 or later

@classify:
 :type: information
 :topic_register: electronic documents:SiSU:document:markup;SiSU:document:markup;SiSU:document:markup;SiSU:manual:markup;electronic documents:SiSU:manual:markup
 :subject: ebook, epublishing, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, search

@date:
 :created: 2002-08-28
 :issued: 2002-08-28
 :available: 2002-08-28
 :published: 2008-05-22
 :modified: 2010-05-25

@links:
 { SiSU Manual }http://www.jus.uio.no/sisu/sisu_manual/
 { Book Samples and Markup Examples }http://www.jus.uio.no/SiSU/examples.html
 { SiSU @ Wikipedia }http://en.wikipedia.org/wiki/SiSU
 { SiSU Download }http://www.jus.uio.no/sisu/SiSU/download.html
 { SiSU Changelog }http://www.jus.uio.no/sisu/SiSU/changelog.html

%% header processing instructions, @make: --------------------------------------

Some document processing parameters can be set in the @make: section of the header

@make:
 :num_top: 1
 :breaks: new=C; break=1
 :skin: skin_sisu_manual
 :bold: /Gnu|Debian|Ruby|SiSU/

%% config, sisurc.yml ----------------------------------------------------------

There are default configuration settings within the program many of which can
be modified in sisurc.yml

sisurc.yml can be located in one of the following locations:
/etc/sisu/sisurc.yml    ~/.sisu/sisurc.yml    and ./_sisu/sisurc.yml

if sisu versions 1 and 2 are both in use, the v2 sisurc.yml can be placed a the
following locations:
/etc/sisu/v2/sisurc.yml ~/.sisu/v2/sisurc.yml and ./_sisu/v2/sisurc.yml

# Name: SiSU - Simple information Structuring Universe
# Author: Ralph@Amissah.com
# Description: Site wide envionment defaults set here
# system environment info / resource configuration file, for sisu
# License: GPL v3 or later
#   site environment configuration file
#   this file should be configured and live in
#      /etc/sisu     #per environment settings, overridden by:
#      ~/.sisu       #per user settings, overridden by:
#     ./_sisu        #per local markup directory settings
#% #image source directory, main path and subdirectories
#image:
#  path:         'sisu_working'
#  public:       '_sisu/image'
#% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name)
#webserv:
#  url_root:     'http://www.your.url' #without dir stub
#  path:         '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
#  images:       '_sisu/image'
#  man:          'man'
#  cgi:          '/usr/lib/cgi-bin'
#  feed:         'feed'
#  sqlite:       'sisu/sqlite'
#  webrick_url:  true
#show_output_on: 'filesystem' #for -v and -u url information, alternatives: 'filesystem','webserver','remote_webserver','local:8111','localhost','localhost:8080','webrick','path'
#show_output_on: 'local:8111'
#webserv_cgi:
#  host:         localhost
#  base_path:    ~
#  port:         '8081'
#  user:         ~
show_output_on: 'filesystem_url'
#texinfo display output
#texinfo:
#  stub:         'texinfo'
##% processing directories, main path and subdirectories (appended to $HOME), using defaults set in sysenv
#processing:
#  path:         '~'
#  dir:         '.sisu_processing~'
#  metaverse:    'metaverse'
#  tune:         'tune'
#  latex:        'tex'
#  texinfo:      'texinfo'
#  concord_max:  400000
#% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default)
flag:
  color:        true                        # making colour default -c is toggle, and will now toggle colour off
  default:      '-NhwepoabxXyYv'            # -m run by default; includes verbose
  i:            '-hwpoay'                   # -m run by default
  ii:           '-NhwepoabxXy'              # -m run by default
  iii:          '-NhwepoabxXyY'             # -m run by default
  iv:           '-NhwepoabxXYDy --update'   # -m run by default
  v:            '-NhwepoabxXYDyv --update'  # -m run by default; includes verbose
#% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal
default:
  papersize:    'A4,letter'
  #text_wrap:    78
  #emphasis:     'bold' #make *{emphasis}* 'bold', 'italics' or 'underscore', default if not configured is 'bold'
  #digest:       'sha' #sha is sha256, default is md5
  #multilingual:  false
  #language_file: 2
  #language:     'English'
#% markup, make *{emphasis}* 'bold' or 'italics', default if not configured is 'bold'
#% settings used by ssh scp
#remote:
#  -
#    user:         '[usrname]'
#    host:         '[remote.hostname]'
#    path:         '.' #no trailing slash eg 'sisu/www'
#  -
#    user:         '[usrname]'
#    host:         '[remote.hostname]'
#    path:         '.' #no trailing slash eg 'sisu/www'
#% webrick information
#webrick:
#  port:         '8081'
#% sql database info, postgresql and sqlite
#db:
#  share_source: false # boolean, default is false
#  postgresql:
#    port:       # '[port (default is 5432)]'
#    host:       # '[if not localhost, provide host tcp/ip address or domain name]''
#    user:       # '[(if different from user) provide username]'
#    password:   # '[password if required]'
#  sqlite:
#    path:       ~ # './sisu_sqlite.db'
#    port:       "**"
#% possible values ~, true, false, or command instruction e.g. editor: 'gvim -c :R -c :S'.
#will only ignore if value set to false, absence or nil will not remove program as should operate without rc file
#ie in case of ~ will ignore and use hard coded defaults within program), true, false, or command instruction e.g. editor: 'gvim -c :R -c :S'
#on value true system defaults used, to change, e.g. editor specify
permission_set:
  zap:          false
  css_modify:   false
#  remote_base_site:  true
program_set:
  rmagick:       false
#  wc:           true
#  editor:       true
#  postgresql:   true
#  sqlite:       true
#  tidy:         true
#  rexml:        true
#  pdflatex:     true
#program_select:
#  editor:       'gvim -c :R -c :S'
#  pdf_viewer:   'evince'
#  web_browser:  'firefox' #'iceweasel' #'epiphany' #'galeon' #'konqueror' #'kazehakase'
#  console_www_browser:  'links2' #'elinks'
#  odf_viewer:   'oowriter' #'abiword'
#  xml_viewer:   'xml-viewer'
#  man:          'nroff -man' #'groff -man -Tascii' # 'nroff -man'
#promo:              sisu_icon, sisu, sisu_search_libre, open_society, fsf, ruby
#search:
#  sisu:
#    flag:              true
##    action:            http://localhost:8081/cgi-bin/sisu_pgsql.cgi
#    action:            http://search.sisudoc.org
#    db:                sisu
#    title:             sample search form
#  hyperestraier:
#    flag:              true
#    action:            http://search.sisudoc.org/cgi-bin/estseek.cgi?


%% skin ------------------------------------------------------------------------

skins can be used to modify the appearance of output

[provide information]

%% css ------------------------------------------------------------------------

the default css may be replaced for the site or particular processing
directories

[provide information]