From 2cd558f67f44cca787013c02b665533b97c90f0e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 3 Sep 2007 21:46:47 +0100 Subject: sisu-0.58 work towards making it possible to describe sisu and sisu markup within sisu --- CHANGELOG | 22 ++- data/doc/sisu/html/sisu.1.html | 318 +++++++++++++++++++------------------- data/doc/sisu/on_markup.txt | 136 ++++++++-------- data/sisu/image/bullet_08.png | Bin 0 -> 223 bytes data/sisu/image/bullet_09.png | Bin 0 -> 230 bytes data/sisu/image/bullet_10.png | Bin 0 -> 270 bytes data/sisu/image/bullet_11.png | Bin 0 -> 277 bytes data/sisu/image/bullet_12.png | Bin 0 -> 295 bytes lib/sisu/v0/css.rb | 2 +- lib/sisu/v0/dal.rb | 105 +++++++------ lib/sisu/v0/dal_doc_str_code.rb | 37 +++-- lib/sisu/v0/dal_doc_str_tables.rb | 6 +- lib/sisu/v0/dal_syntax.rb | 4 +- lib/sisu/v0/html.rb | 30 ++-- lib/sisu/v0/html_scroll.rb | 3 +- lib/sisu/v0/html_segments.rb | 2 +- lib/sisu/v0/html_tune.rb | 104 +++++++------ lib/sisu/v0/odf.rb | 14 +- lib/sisu/v0/param.rb | 9 +- lib/sisu/v0/shared_html_lite.rb | 18 ++- lib/sisu/v0/shared_xml.rb | 4 +- lib/sisu/v0/texpdf.rb | 10 +- man/man1/sisu.1 | 15 +- 23 files changed, 448 insertions(+), 391 deletions(-) create mode 100644 data/sisu/image/bullet_08.png create mode 100644 data/sisu/image/bullet_09.png create mode 100644 data/sisu/image/bullet_10.png create mode 100644 data/sisu/image/bullet_11.png create mode 100644 data/sisu/image/bullet_12.png diff --git a/CHANGELOG b/CHANGELOG index d107d21b..fb8310f4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,11 +1,25 @@ -* See homepage at: http://www.jus.uio.no/sisu -* & http://www.jus.uio.no/sisu/SiSU/download -* & http://www.jus.uio.no/sisu/SiSU/changelog - +* See homepage at: http://www.jus.uio.no/sisu * & http://www.jus.uio.no/sisu/SiSU/download * & http://www.jus.uio.no/sisu/SiSU/changelog Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.58.0.orig.tar.gz (2007-09-03:36/1) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.58.0.orig.tar.gz + sisu_0.58.0.orig.tar.gz + sisu_0.58.0-1.dsc + sisu_0.58.0-1.diff.gz + +* code block, exclude from most markup, should make it possible (eventually) to + describe sisu markup using sisu, which was not an initial goal, but useful + nonetheless. + * pdf, some issues with some line-wraps, changed code-block fontsize to tiny, + (consider footnotesize also should prefer use of ttfamily (texttt)) + +* html css, odf, xml, use black bullets instead of red, and introduce + black_bullet images in sizes 8px to 12px default used 9px + +* man page update on sources of markup examples + %% sisu_0.57.0.orig.tar.gz (2007-08-22:34/3) http://www.jus.uio.no/sisu/pkg/src/sisu_0.57.0.orig.tar.gz 1f730ef349606c02cd90c8cd7cb6b790 1274006 sisu_0.57.0.orig.tar.gz diff --git a/data/doc/sisu/html/sisu.1.html b/data/doc/sisu/html/sisu.1.html index ff71161d..a5bbc0fc 100644 --- a/data/doc/sisu/html/sisu.1.html +++ b/data/doc/sisu/html/sisu.1.html @@ -10,7 +10,7 @@

Name

SiSU - Structured information, Serialized Units - a document -publishing system +publishing system

Synopsis

sisu [ -AabcDdEeFHhIMmNnopqRrSsTtUuVvwXxYyZz0-9 ] [ filename/ wildcard ]

@@ -18,7 +18,7 @@ publishing system sisu [ -CcFLSVvW ]

Note: commands should be issued from within the directory that contains -the marked up files, cd to markup directory. +the marked up files, cd to markup directory.

Description

SiSU SiSU is a document publishing system, that from a simple single marked-up document, @@ -27,7 +27,7 @@ pdf, xhtml, XML, info, and SQL (PostgreSQL and SQLite), which share numbered text objects ("object citation numbering") and the same document structure information. For more see: <http://www.jus.uio.no/sisu >

- +

Summary of man page

@@ -367,7 +367,7 @@ removes specified data to postgresql db (rb.dbi) [ -d --remove sqlite equ
- +

Shortcuts, Shorthand for multiple flags

@@ -398,28 +398,34 @@ default action run when no options are give, i.e. on ’sisu [filename]&rsqu

add -v for verbose mode and -c for color, e.g. sisu -2vc [filename or wildcard]

-consider -u for appended url info or -v for verbose output +consider -u for appended url info or -v for verbose output

Document Markup

SiSU Markup an incomplete summary.

Note: files should be marked up for SiSU using UTF-8 encoding.

Some interactive help on markup is available, by typing sisu -and selecting markup or sisu --help markup +and selecting markup or sisu --help markup

-
Sample markup files can be used -as examples:
-
<http://www.jus.uio.no/sisu/sample +
Online markup examples together +with the respective outputs produced are available from:
+
<http://www.jus.uio.no/sisu/SiSU/2.html +> +
+ +
or from the document:
+
<http://www.jus.uio.no/sisu/sisu_examples/ >
-
actual marked up plaintext -files ready for use:
-
<http://www.jus.uio.no/sisu/sample/markup +
The following +document gives a cursory overview of sisu markup and the respective output +produced:
+
<http://www.jus.uio.no/sisu/sisu_markup/ >
-
as html with -syntax highlighting for viewing:
+
Some example marked up files +are available as html with syntax highlighting for viewing:
<http://www.jus.uio.no/sisu/sample/syntax >
@@ -451,7 +457,7 @@ which by default html segments are made)

,{ subscript },

+{ inserted text }+

--{ strikethrough }- +-{ strikethrough }-

Footnotes/Endnotes

~{ a footnote @@ -466,7 +472,7 @@ alternative endnote pair notation:

~^ endnote marker

^~ endnote text following the paragraph in which the marker -occurs +occurs

Line Operations (marker placed at start of line)

!_ bold line

@@ -478,7 +484,7 @@ indent paragraph one level

# number paragraph (see headers for numbering document headings)

_# number paragraph level 2 (see headers for numbering document headings) - +

Links

{ link name }http://url.org @@ -520,7 +526,7 @@ if a server host name has been provided/configured, will provide a list of available output types that would be generated using the shortcut command and the markup file provided, i.e. output generated using the command (as configured): "sisu -3sS markup_source_filename.sst", using server host, directory -stub, filename to compose the link. +stub, filename to compose the link.

Adding a fixed names in html

*~[name] @@ -528,7 +534,7 @@ manual location marker/tagging at present only in html to produce <a name="[n (use sparingly)

note at a heading level the same is automatically achieved by providing names to headings 5 and 6 i.e. 5~[name] and 6~[name] or in the case of auto-heading numbering, without further intervention.
- +

Escape object citation numbering

@@ -537,7 +543,7 @@ citation numbering

-# unnumbered paragraph, delete when not required (place marker at end of paragraph) [used in dummy headings, eg. for segmented html]

- +

Page breaks (LaTeX/pdf)

@@ -549,69 +555,69 @@ which breaks a page, starting a new page in single column text and a new column in double column text

<:pn> page new, which starts a new page, in both single and double column text (leaving an empty column in double column -text if necessary). +text if necessary).

Comment line

% ignored by sisu in processing if placed at beginning of line

%% ignored by sisu in processing if placed at beginning -of line, used for folding by vim folds +of line, used for folding by vim folds

Special characters

special characters can be escaped with a backslash { } < > are contextual special characters, (in combination with other characters). ~ - _ / % ^ and occasionally ! # + , are special characters in particular circumstances, see the syntax chart. -[note that SiSU is not optimised for technical writing] +[note that SiSU is not optimised for technical writing]

Tables

table{ [number -of columns] [column width %];[column width %] +of columns] [column width %];[column width %]

[table content, line breaks are important see example below]
- -

}table + +

}table

sample table:
- -

table{~h c3; 26; 32; 32; + +

table{~h c3; 26; 32; 32;

This is a table, column1
this would become row one of column two
column three of row one is here
- +

column one row 2
column two of row two
column three of row two, and so on
- +

column one row three
and so on
here
- -

}table -

whole table gets an object citation number -

+ +

}table +

whole table gets an object citation number +

Other Grouped or Pre-formatted Text

-poem{ +poem{

[Text here]
- +

[Text here]
- -

}poem -

each verse is given an object citation number + +

}poem +

each verse is given an object citation number

----
- -

group{ + +

group{

[Text here]
- -

}group -

whole group gets an object citation number + +

}group +

whole group gets an object citation number

----
- -

code{ + +

code{

[Text here]
- -

}code -

whole group gets an object citation number -

+ +

}code +

whole group gets an object citation number +

Composite Documents

It @@ -628,32 +634,32 @@ file, or .ssi (insert/information) .sst A secondary file of the co document is built prior to processing with the same prefix and the suffix ._sst and ._sst There are a number of alternative syntaxes for requiring external documents in order to permit use of ascii hypertext linking available -in the vim editor. They are as follows: -

+in the vim editor. They are as follows: +

basic markup for importing a document
-

r{ filename } -

{ filename.si }require -

<< { filename.si } #for vim folds +

r{ filename } +

{ filename.si }require +

<< { filename.si } #for vim folds

importing a document with textlink syntax
-

|filename.si|@|^|require +

|filename.si|@|^|require

<< |filename.si|@|^| -

#for vim folds +

#for vim folds

importing a document with thlnk syntax

<url:filename.si>require -

<< <url:filename.si> #for vim folds +

<< <url:filename.si> #for vim folds

remote documents may be called with the @@ -668,64 +674,64 @@ thlnk syntax (or regular sisu syntax), e.g.

Document Headers

Header tags appear at the beginning of a document and provide meta information on the document (such as the Dublin Core), or -information as to how the document as a whole is to be processed. +information as to how the document as a whole is to be processed.

All header instructions may take either form: @headername: [introduced in 0.38] or -

0~headername All Dublin Core meta tags are available +

0~headername All Dublin Core meta tags are available

@indentifier: information -or instructions [introduced in 0.38] -

or +or instructions [introduced in 0.38] +

or

0~indentifier information or instructions, -old equivalent, depreciated +old equivalent, depreciated

where the "identifier" is a tag recognised by the program, and the "information" or "instructions" belong to the tag/indentifier -specified. +specified.

Note: a header where used should only be used once; all headers apart from @title: (0~title) are optional; the @structure: (0~toc) header -is used to describe document structure, and can be useful to know. +is used to describe document structure, and can be useful to know.

@structure: -PART; CHAPTER; SECTION; ARTICLE; none; none; +PART; CHAPTER; SECTION; ARTICLE; none; none;

structure can be defined by a match words or regular expression (the regular expression is assumed -to start at the beginning of a line of text i.e. ^) +to start at the beginning of a line of text i.e. ^)

For help see one of the following (and markup samples):
- +

* interactive help - type ’sisu --help headers’
- +

* marked up text samples
- +

* the SiSU_Markup.txt file provided with the program
- +

* an outline of headers is provided below -->
- +

Outline of header options

% SiSU 0.38 [declared file-type identifier with -markup version] +markup version]

@title: My Title - This is now the Title of the Document -

and used as such -

@subtitle: The Subtitle if any +

and used as such +

@subtitle: The Subtitle if any

@creator: [or ~author] -

Ralph Amissah -

@subject: (whatever your subject) -

@description: +

Ralph Amissah +

@subject: (whatever your subject) +

@description:

@publisher: -

@contributor: -

@translator: [or ~translated_by] +

@contributor: +

@translator: [or ~translated_by]

@illustrator: [or ~illustrated_by] -

@prepared_by: [or ~digitized_by] +

@prepared_by: [or ~digitized_by]

@date: 2000-08-27 [ also @date.created: -@date.issued: @date.available: @date.valid: @date.modified: ] +@date.issued: @date.available: @date.valid: @date.modified: ]

@type: article -

@format: -

@identifier: -

@source: +

@format: +

@identifier: +

@source:

@language: [or @language.document:] language in which current version of document is published. Some country settings result in processing adjustments, e.g. in LaTeX hyphenation, some country @@ -735,48 +741,48 @@ es - Spanish, pt - Portuguese, sv - Swedish, da - Danish, fi - Finnish, no - Norwegian, is - Icelandic, nl - Dutch, ee - Estonian, hu - Hungarian, pl - Polish, ro - Romanian, ru - Russian, gl - Greek, uk - Ukranian, tr - Turkish, si - Slovene, sk - Slovak, hr - Croatian, cs - Czech, bg - Bulgarian ) [however, encodings -are not available for all of the languages listed.] +are not available for all of the languages listed.]

@language.original: -

original language in which the work was published +

original language in which the work was published

@papersize: (A4|US_letter|book_B5|book_A5|US_legal) -

@relation: -

@coverage: +

@relation: +

@coverage:

@rights: copyright, all rights reserved, public -domain, copyleft, creative commons variant, etc. -

@owner: +domain, copyleft, creative commons variant, etc. +

@owner:

@keywords: text document generation processing management LaTeX pdf structured XML citation [your keywords here, used for example by rss feeds, and in sql sear ches] -

@abstract: [paper abstract, placed after table of contents] +

@abstract: [paper abstract, placed after table of contents]

@comment: -[...] +[...]

@catalogue: loc=[Library of Congress classification]; dewey=[Dewey -classification]; isbn=[ISBN]; pg=[Project Gutenberg text number] +classification]; isbn=[ISBN]; pg=[Project Gutenberg text number]

@classify_loc: -

Library of Congress classification +

Library of Congress classification

@classify_dewey: Dewey classification -

@classify_isbn: ISBN -

@classify_pg: Project Gutenberg text number +

@classify_isbn: ISBN +

@classify_pg: Project Gutenberg text number

@prefix_a: -[prefix is placed just before table of contents - not implemented] +[prefix is placed just before table of contents - not implemented]

@prefix_b: -or @prefix: [prefix is placed just after table of contents] +or @prefix: [prefix is placed just after table of contents]

@rcs: $Id$ [or @cvs: used by rcs or cvs to embed version (revision control) information into document, rcs or cvs can usefully provide a history of updates to -a document ] +a document ]

@structure: PART; CHAPTER; SECTION; ARTICLE; none; none; optional, where document structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^) default markers :A~ to :C~ and 1~ to 6~ can be used within text instead, without this header ta g, and may be used to supplement the instructions provided in this header tag if provided (@structure: is -a synonym for @toc:) +a synonym for @toc:)

@markup: information on the markup used, e.g. new=1,2,3; break=4; num_top=4 [or newpage=1,2,3; breakpage=4; num_top=4] newpage and breakpage, heading level, used by LaTeX to breakpages. breakpage: starts @@ -790,18 +796,18 @@ where a clear numbering structure is provided within document, without the repetition of a number in a header.] [In 0.38 notation, you would map to the equivalent levels, the examples provided would map to the following new=A,B,C; break=1; num_top=1 [or newpage=A,B,C; breakpage=1; num_top=1] -see headings] +see headings]

@bold: [regular expression of words/phrases to be made bold] -

@italics: [regular expression of words/phrases to italicise] +

@italics: [regular expression of words/phrases to italicise]

@vocabulary: -

name of taxonomy/vocabulary/wordlist to use against document +

name of taxonomy/vocabulary/wordlist to use against document

@skin: skin_doc_[name_of_desired_document_skin]

@links: { SiSU }http://www.jus.uio.no/sisu/ { FSF }http://www.fsf.org - +

@promo: sisu, ruby, search_libre_docs, open_society [places content in right pane in html, makes use of list.yml and promo.yml, commented out sample in document @@ -810,33 +816,33 @@ sample: free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_willia

:A~ Top level heading [this usually has similar content to the title @title: ] NOTE: the heading levels described here are in 0.38 notation, see heading -

:B~ Second level heading [this is a heading level divider] +

:B~ Second level heading [this is a heading level divider]

:C~ Third -level heading [this is a heading level divider] +level heading [this is a heading level divider]

1~ Top level heading preceding substantive text of document or sub-heading 2, the heading level that would normally be marked 1. or 2. or 3. etc. in a document, and the level on which sisu by default would break html output into named segments, names are provided automatically if none are given (a number), otherwise takes the -

form 1~my_filename_for_this_segment +

form 1~my_filename_for_this_segment

2~ Second level heading preceding substantive text of document or sub-heading 3 , the heading level that would -normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc. in a document. +normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc. in a document.

3~ Third level heading preceding substantive text of document, that would normally be -marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document +marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document

NOTE: headers and heading levels used in the description provided refer to 0.38 markup (a conversion script provided in sisu-examples, modify.rb makes conversion between 0.37 -and 0.38 markup simple) -

For some help on document structure try +and 0.38 markup simple) +

For some help on document structure try

sisu --help -

headings -

and view sample markup documents provided -

-

+

headings +

and view sample markup documents provided +

+

Configuration Files

@@ -855,20 +861,20 @@ Configuration determines the output and processing directories and the database access details.

A sample sisurc.yml may be found in /etc/sisu/sisurc.yml -

+

More HELP on Markup and headers

type: sisu ~
sisu --help
- +

markup help is available on:
document wide instructions: headers (document structure)
general text markup: headings; endnotes; tables
- +

A markup table and sample marked-up files (also in html with syntax highlighting) -are available at: +are available at:

<http://www.jus.uio.no/sisu/sample -> -

+> +

DIRECTORY STRUCTURE & Document Output

@@ -893,7 +899,7 @@ is not writable to /tmp/sisu_processing

Output is written to sub-directories within /var/www/ if it exists and is writable, and otherwise to ~/sisu_output - +

Markup Document Directories and File Mapping

@@ -935,7 +941,7 @@ text

doc.html full length scrollable document

toc.html index for segmented text

-html segments, as many as there may be... +html segments, as many as there may be...

portrait.pdf
@@ -1021,7 +1027,7 @@ the directory ~/ebook

would be placed in tables within the database

SiSU_ebook
- +

SKINS - document, directory and site skins

Skins @@ -1054,7 +1060,7 @@ may be found in /etc/sisu/skin/doc and /usr/share/doc/sisu/sisu_markup_samples/d (or equivalent directory)

Samples of list.yml and promo.yml may be found in /usr/share/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml (or equivalent -directory) +directory)

Document Naming Convention

SiSU documents are named with the @@ -1075,14 +1081,14 @@ created when a composite file is constructed, and when a url is provided, it is saved locally for processing, as a secondary processing file. Secondary files may be clobbered by SiSU at will, and are not a way of storing information. -

.sxs.xml simple xml sax, sisu markup representation +

.sxs.xml simple xml sax, sisu markup representation

.sxd.xml simple xml dom, -

sisu markup representation +

sisu markup representation

.sxn.xml simple xml node, sisu markup representation

.sxs.xml.sst or .sxd.xml.sst or .sxn.xml.sst auto-converted from a simple xml markup -representation (sxs, sxd, sxn) +representation (sxs, sxd, sxn)

Remote Operations

These may be of three @@ -1111,7 +1117,7 @@ an identical filename to another, e.g. local file, that is to be processed in the same directory. So far this has not been found to happen in practice... Alternative solutions are under consideration, but it is desired that filenames be human assigned, and meaningful, so hash keys of contents for filenames -are not amongst the options considered. +are not amongst the options considered.

Note

For basic use only a fraction @@ -1123,8 +1129,8 @@ to in the text <http://www.jus.u > The flags to generate html and pdf for use locally would be sisu -mHp [name of file to be processed] This does assume an ok install and setup of SiSU and the associated software -it uses. -

+it uses. +

Processing Examples

To initialise a new directory sisu -C

@@ -1172,7 +1178,7 @@ it may be necessary to first run sisu -Dv createdb

import all marked up files first time into a database: sisu -Dv import *

--c toggles color +-c toggles color

Interactive Help Options

SiSU @@ -1211,69 +1217,69 @@ tables of contents) external_programs, dublincore, termsheet, search, features, external_programs, license, exit -

+

SiSU VERSION CONVERSION

sisu --to-current [filename/wildcard] converts from -0.37 markup to current markup (0.38) +0.37 markup to current markup (0.38)

sisu --to-38 [filename/wildcard] converts -

from 0.37 markup to 0.38 +

from 0.37 markup to 0.38

sisu --to-37 [filename/wildcard] converts from 0.38 -

markup to 0.37 +

markup to 0.37

sisu --convert-36to37 [filename/wildcard] re-names file from -

pre-0.36 convention to 0.37 +

pre-0.36 convention to 0.37

sisu --convert-footnotes [filename/wildcard] converts -

footnotes to preferred embedded footnote markup style +

footnotes to preferred embedded footnote markup style

sisu --convert-footnotes-force [filename/wildcard] converts footnotes to preferred embedded footnote markup style, even if there is a mismatch of footnote numbers. WARNING: there is a problem with the source document and it is necessary to manually check -where each footnotes actually should be. +where each footnotes actually should be.

convert from sst to simple xml -representations (sax, dom and node): +representations (sax, dom and node):

sisu --to-sax [filename/wildcard] or -sisu --to-sxs [filename/wildcard] +sisu --to-sxs [filename/wildcard]

sisu --to-dom [filename/wildcard] or sisu ---to-sxd [filename/wildcard] +--to-sxd [filename/wildcard]

sisu --to-node [filename/wildcard] or sisu --to-sxn -[filename/wildcard] +[filename/wildcard]

convert to sst from simple xml representations (sax, -dom and node): +dom and node):

sisu --from-xml2sst [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]] -

or the same: +

or the same:

sisu --from-sxml [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]]

sisu --from-kdi [kdissert filename] attempts to convert a kdissert file (.kdi) -

to sisu markup +

to sisu markup

sisu --identify [filename/wildcard] attempts to identify -

the markup version of the file +

the markup version of the file

sisu --query=[version number] and sisu --query=history -

provides a brief summary of changes to SiSU markup -

+

provides a brief summary of changes to SiSU markup +

Sample Markup Documents

Sample markup documents are provided in sisu-examples and are available -online. -

+online. +

Home Page

<http://www.jus.uio.no/sisu -> -

+> +

Author

Ralph Amissah <ralph@amissah.com> -or <ralph.amissah@gmail.com> -

+or <ralph.amissah@gmail.com> +

See Also

sisu(8) , sisu_webrick(1) diff --git a/data/doc/sisu/on_markup.txt b/data/doc/sisu/on_markup.txt index 72aee93b..c86df967 100644 --- a/data/doc/sisu/on_markup.txt +++ b/data/doc/sisu/on_markup.txt @@ -1,11 +1,11 @@ SiSU Markup Standard * Copyright Ralph Amissah -* version 0.16.0 +* version 0.38.0 * homepage: http://www.jus.uio.no/sisu * manpages 'man sisu' * markup examples - * data/sisu-markup-samples/document_samples_sisu_markup - * /usr/share/sisu-markup-samples/document_samples_sisu_markup + * data/sisu-examples/sample/document_samples_sisu_markup + * /usr/share/sisu-examples/sample/document_samples_sisu_markup * http://www.jus.uio.no/sisu/sample/markup * http://www.jus.uio.no/sisu/sample/syntax * book samples @@ -16,7 +16,7 @@ The man pages 'man sisu' are likely to be more up to date than this document, please consult them. Examples of marked up documents are also provided, under the directory branch -data/sisu-markup-samples +sisu-examples/sample/document_samples_sisu_markup or online at SiSU Markup syntax @@ -24,9 +24,9 @@ SiSU Markup syntax sisu Data text markup (alternative to available html subset) - 1~ heading/title [levels 1 to 6 available] +:A~ heading/title [levels :A~ to :C~ available] - 4~filename heading [segmentation level] +1~filename heading [segmentation level, levels 1~ to 3~ available ] !{emphasis}! @@ -49,22 +49,24 @@ sisu ------------------------------------------ Indentation and bullets - _1 indent paragraph one level +_1 indent paragraph one level - _2 indent paragraph two steps +_2 indent paragraph two steps - _2 indent paragraph two steps + ... - _* bullet text +_9 indent paragraph nine steps - _1* bullet text, first indent +_* bullet text + +_1* bullet text, first indent ------------------------------------------ Numbered List (not to be confused with headings/titles, (document structure)) - # numbered list numbered list 1., 2., 3, etc. +# numbered list numbered list 1., 2., 3, etc. - _# numbered list numbered list indented a., b., c., d., etc. +_# numbered list numbered list indented a., b., c., d., etc. ------------------------------------------ Endnotes @@ -75,7 +77,7 @@ sisu alternative endnote pair notation ~^ endnote marker - ^~ endnote text following the paragraph in which the marker occurs +^~ endnote text following the paragraph in which the marker occurs ------------------------------------------ Links @@ -95,12 +97,12 @@ sisu { SiSU Geek Writer }http://www.jus.uio.no/sisu/ url example { tux.png 64x80 "a better way" }http://www.jus.uio.no/sisu/ image example with all options - + shortcut - hyper-linked text with endnote providing the url information {~^ [text to link] }http://url.org maps to { [text to link] }http://url.org ~{ http://url.org }~ which produces hyper-linked text within a document/paragraph, with an endnote providing the url for the text location used in the hyperlink - + manual location marker/tagging at present only in html to produce (use sparingly) *~[name] @@ -118,7 +120,7 @@ sisu ------------------------------------------ - There are some things to be aware of
may be used, but urls occuring before or after a break must have a space. The vim syntax highlighter catches most of the rules... + There are some things to be aware of
may be used, but urls occuring before or after a break must have a space. The vim syntax highlighter catches most of the rules... ------------------------------------------ @@ -181,82 +183,74 @@ code{ HEADERS Header tags appear at the beginning of a document and provide meta information on the document (such as the Dublin Core), or information as to how the document as a whole is to be processed. -All header instructions take either the form 0~ . All Dublin Core meta tags are available -0~indentifier information +All header instructions take the form @tagname: All Dublin Core meta tags are available +@indentifier: information where the "identifier" is a tag recognised by the program, and the "information" or "instructions" belong to the tag/indentifier specified The { form was introduced to take advantage of vim folds, and its use is reserved primarily for document structural instructions: namely header and heading tags (also a footnote/endnote option). This is a sample header (Dublin Core in fuschia, other information headers in cyan, markup instructions in red): -0~title My Title - This is now the Title of the Document and used as such - -0~subtitle The Subtitle if any - -0~creator [or ~author] Ralph Amissah +@title: My Title - This is now the Title of the Document and used as such -0~subject Document production and management (or whatever your subject) +@subtitle: The Subtitle if any -0~description +@creator: [or ~author] Ralph Amissah -0~publisher +@subject: Document production and management (or whatever your subject) -0~contributor +@description: -0~date 2000-08-27 - [ also 0~date.created 0~date.issued 0~date.available 0~date.valid 0~date.modified ] +@publisher: -0~type article +@contributor: -0~format +@date: 2000-08-27 + [ also @date:.created @date:.issued @date:.available @date:.valid @date:.modified ] -0~identifier +@type: article -0~source +@format: -0~language (en|us|fr|de|es|se|dk|fi|no) +@identifier: -0~relation +@source: -0~coverage +@language: (en|us|fr|de|es|se|dk|fi|no) -0~rights copyright, all rights reserved, public domain, copyleft, creative commons variant, etc. +@relation: -0~owner +@coverage: -0~keywords text document generation processing management latex pdf structured xml citation [your keywords here, used for example by rss feeds, and in sql searches] +@rights: copyright, all rights reserved, public domain, copyleft, creative commons variant, etc. -0~abstract [paper abstract, placed after table of contents] +@owner: -0~comment [...] +@keywords: text document generation processing management latex pdf structured xml citation [your keywords here, used for example by rss feeds, and in sql searches] -0~classify_loc [Library of Congress classification] +@abstract: [paper abstract, placed after table of contents] -0~classify_dewey [Dewey classification system] +@comment: [...] -0~classify_isbn [ISBN] +@prefix_a: [prefix is placed just before table of contents - not implemented] -0~classify_pg [Project Gutenberg text number] +@prefix_b: or @prefix: [prefix is placed just after table of contents] -0~prefix_a [prefix is placed just before table of contents - not implemented] +@cvs: $Id$ [used by cvs to embed versioning (revision control) information into document, cvs can usefully provide a history of updates to a document (though I no longer use it for programming, preferring darcs and arch/tla cvs performs this function for documents quite well) ] -0~prefix_b or 0~prefix [prefix is placed just after table of contents] - -0~rcs $Id$ [or 0~cvs used by rcs or cvs to embed version (revision control) information into document, rcs or cvs can usefully provide a history of updates to a document ] - -0~toc PART; CHAPTER; SECTION; ARTICLE; none; none; +@toc: PART; CHAPTER; SECTION; ARTICLE; none; none; optional, where document structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text) default markers 1~ to 6~ can be used within text instead, without this header tag, and may be used to suppliment the instructions provided in this header tag if provided -0~level newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage] +@level: newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage] -0~markup num_top=4 [various markup instructions, eg: num_top=4 headings tobe numbered, starting at heading level 4... the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level] +@markup: num_top=4 [various markup instructions, eg: num_top=4 headings tobe numbered, starting at heading level 4... the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level] -0~vocabulary name of taxonomy/vocabulary/wordlist to use against document +@vocabulary: name of taxonomy/vocabulary/wordlist to use against document -0~skin skin_doc_[name_of_desired_document_skin] +@skin: skin_doc_[name_of_desired_document_skin] -0~links http://google.com; Google; +@links: http://google.com; Google; -1~ Top level heading [this is usually the same as the title 0~title ] +1~ Top level heading [this is usually the same as the title @title: ] 2~ Second level heading [this is a heading level divider] @@ -270,25 +264,25 @@ default markers 1~ to 6~ can be used within text instead, without this header ta SAMPLE DOCUMENT -For sample marked up documents see the directory +For sample marked up documents see the directory markup_samples -0~title Working Sample Document +@title: Working Sample Document -0~subtitle Demonstrating markup +@subtitle: Demonstrating markup -0~creator Ralph Amissah +@creator: Ralph Amissah -0~date +@date: -0~markup num_top=4 +@markup: num_top=4 -0~links +@links: 1~ A Sample Document - -2~ just for fun - + +2~ just for fun + 4~ This is Chapter One or Article One Ordinary Text follows here. The Title would be a Chapter or Article depending on the type of document you were working to produce. @@ -297,13 +291,13 @@ Ordinary Text follows here. The Title would be a Chapter or Article depending on And so on. -Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .s3 if saved as example.s3, by typing sisu -mhwxp example.s3 while in the directory in which the file is saved. +Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .s3 if saved as example.s3, by typing sisu -mhwxp example.s3 while in the directory in which the file is saved. _1 -m initial processing, -h html (css based), -w wordmap for html, -x xml, -p pdf output, generated via latex, there are of course additional options _1 for a listing type: sisu ~ commands -_1 for an outline of sisu markup type: sisu ~ markup +_1 for an outline of sisu markup type: sisu ~ markup The example ends here. @@ -313,7 +307,7 @@ Composite Documents It is possible to build a document by requiring other documents. The documents required may complete documents that could be gener ated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other doc uments), by convention it should be named with the suffix .r1 , .r2 , or .r3 .s1 , .s2 , or .s3 , and if markup snippets .si. A tempo rary file of the composite document is built prior to processing with the same prefix and the suffix .t1 , .t2 , or .t3 -basic markup for importing a document into another, +basic markup for importing a document into another, [note placement is at start of the line, no spaces despite presentation below] r{ filename } diff --git a/data/sisu/image/bullet_08.png b/data/sisu/image/bullet_08.png new file mode 100644 index 00000000..9e81da10 Binary files /dev/null and b/data/sisu/image/bullet_08.png differ diff --git a/data/sisu/image/bullet_09.png b/data/sisu/image/bullet_09.png new file mode 100644 index 00000000..08c76edc Binary files /dev/null and b/data/sisu/image/bullet_09.png differ diff --git a/data/sisu/image/bullet_10.png b/data/sisu/image/bullet_10.png new file mode 100644 index 00000000..87ed61fd Binary files /dev/null and b/data/sisu/image/bullet_10.png differ diff --git a/data/sisu/image/bullet_11.png b/data/sisu/image/bullet_11.png new file mode 100644 index 00000000..8ef22aee Binary files /dev/null and b/data/sisu/image/bullet_11.png differ diff --git a/data/sisu/image/bullet_12.png b/data/sisu/image/bullet_12.png new file mode 100644 index 00000000..ebb62725 Binary files /dev/null and b/data/sisu/image/bullet_12.png differ diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb index d1e6832a..f5aabf7f 100644 --- a/lib/sisu/v0/css.rb +++ b/lib/sisu/v0/css.rb @@ -433,7 +433,7 @@ WOK list-style: none; } li { - background: url(../image/bullet_red.png) no-repeat 0px 6px; + background: url(../image/bullet_09.png) no-repeat 0px 6px; /* list-style-type: disc; */ padding-left: 20px; display: block; diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb index 2e5075d4..c2c92485 100644 --- a/lib/sisu/v0/dal.rb +++ b/lib/sisu/v0/dal.rb @@ -241,13 +241,15 @@ module SiSU_DAL para.gsub!(/\\trademark\b|\\tm\b/,'®') #non_utf8(para) para=para + "\n" - case para - when /\^~/ # endnotes - #% Note must do this first (earlier loop) and then enter gathered data into ~^\d+ - sub_para=para.dup - @@endnote_array << sub_para.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/, %{~\{#{endnote_no} \\1 \}~}).strip - endnote_no+=1 - para=nil if para =~/\^~ .+/ #removes 'binary' endnote now in endnote array for later insertion + unless para =~/^<:code>/ + case para + when /\^~/ # endnotes + #% Note must do this first (earlier loop) and then enter gathered data into ~^\d+ + sub_para=para.dup + @@endnote_array << sub_para.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/, %{~\{#{endnote_no} \\1 \}~}).strip + endnote_no+=1 + para=nil if para =~/\^~ .+/ #removes 'binary' endnote now in endnote array for later insertion + end end @tuned_file << para unless para.nil? end @@ -770,20 +772,22 @@ module SiSU_DAL if @md.mod.inspect =~/--no-dagger|--no-annotate/ para.gsub!(/~\[[+]\s.+?\]~/,'') end - case para - # auto-numbered endnotes --> - when /~\{\s+.+?\}~|~\[[*+]\s+.+?\]~/ - para.gsub!(/\s*(\}~|\]~)/,' \1') # required 2003w31 - word_mode=para.scan(/\S+/) - word_mode=endnote_call_number(word_mode) - para=word_mode.join(' ') - endnote_ref+=1 - when /~\^(?:\s|$)|<:e>/ - #%Note inserts endnotes previously gathered from /^(|[-~]\{{3})/ (in earlier loop) - word_mode=para.scan(/\S+/) - word_mode=endnote_call_number(word_mode) - para=word_mode.join(' ') - endnote_ref+=1 + unless para =~/^<:code>/ + case para + # auto-numbered endnotes --> + when /~\{\s+.+?\}~|~\[[*+]\s+.+?\]~/ + para.gsub!(/\s*(\}~|\]~)/,' \1') # required 2003w31 + word_mode=para.scan(/\S+/) + word_mode=endnote_call_number(word_mode) + para=word_mode.join(' ') + endnote_ref+=1 + when /~\^(?:\s|$)|<:e>/ + #%Note inserts endnotes previously gathered from /^(|[-~]\{{3})/ (in earlier loop) + word_mode=para.scan(/\S+/) + word_mode=endnote_call_number(word_mode) + para=word_mode.join(' ') + endnote_ref+=1 + end end @tuned_file << para end @@ -791,23 +795,25 @@ module SiSU_DAL end def endnote_call_number(data) data.each do |word| - case word - when /~\{/ - unless word =~/~\{[*+]+/ - word.gsub!(/~\{/,"~\{#{@@endnote_counter} ") + unless data =~/^<:code>/ + case word + when /~\{/ + unless word =~/~\{[*+]+/ + word.gsub!(/~\{/,"~\{#{@@endnote_counter} ") + @@endnote_counter+=1 + end + when /~\[/ + if word =~/~\[[+]/ + word.gsub!(/~\[[+]/,"~\[\+#{@@endnote_counter_dag} ") + @@endnote_counter_dag+=1 + else + word.gsub!(/~\[[*]?/,"~\[\*#{@@endnote_counter_asterisk} ") + @@endnote_counter_asterisk+=1 + end + when /~\^|<:e>/ + word.gsub!(/~\^|<:e>/,"#{@@endnote_array[@@endnote_counter-1]}") @@endnote_counter+=1 end - when /~\[/ - if word =~/~\[[+]/ - word.gsub!(/~\[[+]/,"~\[\+#{@@endnote_counter_dag} ") - @@endnote_counter_dag+=1 - else - word.gsub!(/~\[[*]?/,"~\[\*#{@@endnote_counter_asterisk} ") - @@endnote_counter_asterisk+=1 - end - when /~\^|<:e>/ - word.gsub!(/~\^|<:e>/,"#{@@endnote_array[@@endnote_counter-1]}") - @@endnote_counter+=1 end end end @@ -973,19 +979,22 @@ module SiSU_DAL digest_all=hash_class.hexdigest(para) # print "#{hash_class.name}: "; puts digest_all #length==32 or 64 stripped=strip_clean_of_markup(para) digest_strip=hash_class.hexdigest(stripped) - case para - when /~\{[\d*+]+\s+.+?\}~|~\[[*+]\d+\s+.+?\]~/ - en_and_para,en_and_para_digest=[],[] - para.gsub!(/\s*(\}~|\]~)/,' \1') #watch - para_plus_en=para.scan(/.*?~\{.+?\}~|.*?~\[.+?\]~/) - para_tail=if para =~/(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+([\s\S]+)/ - /(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+(.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+>)/.match(para)[1] - else '' + unless para =~/<:code>/ + case para + when /~\{[\d*+]+\s+.+?\}~|~\[[*+]\d+\s+.+?\]~/ + en_and_para,en_and_para_digest=[],[] + para.gsub!(/\s*(\}~|\]~)/,' \1') #watch + para_plus_en=para.scan(/.*?~\{.+?\}~|.*?~\[.+?\]~/) + para_tail=if para =~/(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+([\s\S]+)/ + /(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+(.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+>)/.match(para)[1] + else '' + end + para_plus_en << para_tail + en_and_para_digest << endnote_digest(para_plus_en) + para_new=en_and_para_digest.join(' ') + @tuned << para_new + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? + else @tuned << para + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? end - para_plus_en << para_tail - en_and_para_digest << endnote_digest(para_plus_en) - para_new=en_and_para_digest.join(' ') - @tuned << para_new + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? else @tuned << para + '<' + digest_strip + ':' + digest_all + '>' unless para.nil? end @tuned.join diff --git a/lib/sisu/v0/dal_doc_str_code.rb b/lib/sisu/v0/dal_doc_str_code.rb index 18ac03d8..52aa4a40 100644 --- a/lib/sisu/v0/dal_doc_str_code.rb +++ b/lib/sisu/v0/dal_doc_str_code.rb @@ -77,15 +77,15 @@ module SiSU_document_structure_code @verse_count=0 data.each do |para| para.gsub!(/(<:(?:code|verse|alt|group)>)\s/,'\1') #double check - para.gsub!(/(?:\n\s*\n)+/m,"\n") + para.gsub!(/(?:\n\s*\n)+/m,"\n") unless @@flag['code'] if para =~/^code\{/ @@flag['code']=true @@counter=1 para.gsub!(/^code\{.*/,'<:code>') - elsif para =~/^(?:poem)\{/ + elsif para =~/^(?:poem)\{/ and not @@flag['code'] @@flag['poem']=true para.gsub!(/^(poem)\{.*/,'<:verse>') - elsif para =~/^(?:alt|group)\{/ #group not tested, stub 2005 + elsif para =~/^(?:alt|group)\{/ and not @@flag['code'] #group not tested, stub 2005 @@flag['group']=true para.gsub!(/^(alt|group)\{.*/,'<:\1>') end @@ -94,22 +94,27 @@ module SiSU_document_structure_code para.gsub!(/^\}code.*/,'<:code-end>') @@flag['code']=false end - if @@flag['code'] #or para =~/<:code-end>/ #and para =~/\S/ - sub_array=para.dup + if @@flag['code'] or para =~/<:code-end>/ #and para =~/\S/ + sub_array=if para !~/<:code(?:-end)?>/; para.dup + '<:br>' + else para.dup + end @line_mode=sub_array.scan(/.+/) + #@line_mode=[] + #sub_array.scan(/.+/) {|w| @line_mode << w + '<:br>' if w =~/[\Ss]+/} SiSU_document_structure_code::Code.new(@md,@line_mode).code_lines('code') para=@line_mode.join end - elsif @@flag['poem'] or @@flag['group'] + elsif ( @@flag['poem'] or @@flag['group'] ) and not @@flag['code'] if @@flag['poem'] and para =~/^\}(?:poem)/ para.gsub!(/^\}(poem).*/,"\n<:verse-end>") @@flag['poem']=false - elsif @@flag['group'] and para =~/^\}(?:alt|group)/ + elsif ( @@flag['group'] and para =~/^\}(?:alt|group)/ ) and not @@flag['code'] para.gsub!(/^\}(alt|group).*/,'<:\1-end>') @@flag['group']=false end if @@flag['poem'] or @@flag['group'] and para =~/\S/ \ - and para !~/<:(verse|code|alt|group)(-end)?>/ + and para !~/<:(verse|code|alt|group)(-end)?>/ \ + and not @@flag['code'] sub_array=para.dup @line_mode=sub_array.scan(/.+/) type=if @@flag['poem']; 'poem' @@ -130,10 +135,11 @@ module SiSU_document_structure_code elsif para =~/<:(?:code|alt|group|verse)-end>/ @verse_count=0 @tuned_group << para - if para =~/<:group-end>/ - tuned_file << @tuned_group.join("\n") - else - tuned_file << @tuned_group.join + tuned_file <<= if para =~/<:group-end>/ + @tuned_group.join("\n") + else @tuned_group=@tuned_group.join + @tuned_group.gsub!(/<:br><:br>(<:code-end>)/,'\1') + @tuned_group end @tuned_group=[] else tuned_file << para @@ -144,17 +150,18 @@ module SiSU_document_structure_code def code_lines(type='') data=@data data.each do |line| - if line =~/\S/ and line !~/^(?:alt|code|group|poem)\{|^\}(?:alt|code|group|poem)|<:(?:code|verse|alt|group).+/ + if line =~/\S/ and line !~/^code\{|^\}code|<:code.+/ line.gsub!(/\s\s/,'  ') line.gsub!(/^/,'<:codeline>') if type=='code' # try sort for texpdf special case if line =~/https?:\/\/\S+$/ line.gsub!(/$/,' <:br>') - else - line.gsub!(/$/,'<:br>') #unless type=='code' + else line.gsub!(/$/,'<:br>') #unless type=='code' end if @@flag['code']; @@counter+=1 else end + elsif line =~/^\s*$/ + line.gsub!(/$/,' <:br>') end end end diff --git a/lib/sisu/v0/dal_doc_str_tables.rb b/lib/sisu/v0/dal_doc_str_tables.rb index 2c128570..e0d019bb 100644 --- a/lib/sisu/v0/dal_doc_str_tables.rb +++ b/lib/sisu/v0/dal_doc_str_tables.rb @@ -131,13 +131,13 @@ module SiSU_document_structure_tables if para =~/^\{(?:t|table)(?:~h)?(?:\sc\d+;)?[\d; ]*\}/ @tuned_file << table_visual(para) @tuned_file=@tuned_file.flatten - elsif @@flag['table_to'] or para[/table\{(?:~h)?/] + elsif @@flag['table_to'] or para[/^table\{(?:~h)?/] if para[/table\{(?:~h)?\s+c(\d+;.+)/] instructions=$1 @@column=instructions.split(/;\s*/) @@columns=@@column[0] - para.gsub!(/table\{~h\s+(c\d+?;.+?)$/,'') - para.gsub!(/table\{\s+(c\d+?;.+?)$/,'') + para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,'') + para.gsub!(/^table\{\s+(c\d+?;.+?)$/,'') @@flag['table_to']=true end if @@flag['table_to'] and para =~/\}table/ diff --git a/lib/sisu/v0/dal_syntax.rb b/lib/sisu/v0/dal_syntax.rb index 703d9f1b..292f7343 100644 --- a/lib/sisu/v0/dal_syntax.rb +++ b/lib/sisu/v0/dal_syntax.rb @@ -191,7 +191,7 @@ module Syntax # # #numbered (list) level 1 # _# #numbered (list) level 2 line=line.dup - if line !~/^0~|<:codeline>|<:code-end>/ + unless line =~/^0~|<:codeline>|<:code-end>/ #special characters: ~ { } < > - _ / also used : ^ ! # line_array=[] line.gsub!(/^%{1,4} .+/mi,'') #remove comments @@ -288,7 +288,7 @@ module Syntax else #code blocks line.gsub!(/(^|\s)(https?:\/\/\S+)/,'\1_\2') #line.gsub!(/(^|\s)(http:\/\/\S+)/,"\\1\\\\\\2") #escape urls line.gsub!(/(^|\s)<(https?:\/\/\S+)>([\s,.]|$)/,'\1\2\3') #clean/unescape urls with decoration, re-apply decoration later - line.gsub!(/<:codeline>/,"\n") + line.gsub!(/<:codeline>/,"\n  ") #temporary fix, prefer: #line.gsub!(/<:codeline>/,"\n") end line end diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb index 0798e604..2894fa27 100644 --- a/lib/sisu/v0/html.rb +++ b/lib/sisu/v0/html.rb @@ -271,20 +271,22 @@ module SiSU_HTML @scr_endnotes << format_head_scroll.title_endnote @data.each do |para| pg=para.dup - if pg =~/~[{\[][\d*+]+
/ + if pg =~/~[{\[][\d*+]+ / + endnote_array=[] + if pg=~/~\{[\d*+].+?\}\~/m + endnote_array << pg.scan(/~\{[\d*+]+(.+?)\}\~/m) + end + if pg=~/~\[[\d*]+\s.+?\]\~/m + endnote_array << pg.scan(/~\[[\d*]+(.+?)\]\~/m) + end + if pg=~/~\[[\d+]+\s.+?\]\~/m + endnote_array << pg.scan(/~\[[\d+]+(.+?)\]\~/m) + end + endnote_array.flatten.each do |note| + format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,note) + @scr_endnotes << format_scroll.endnote_body + end end end end diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb index b2cfb497..629cfc0c 100644 --- a/lib/sisu/v0/html_scroll.rb +++ b/lib/sisu/v0/html_scroll.rb @@ -88,7 +88,8 @@ module SiSU_HTML_scroll end @rcdc=true if @rcdc==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/) if para !~/(^0~||)/ - para.gsub!(/~[{\[].+?[}\]]~\s+/m,' ') + unless para =~/^<:code>/; para.gsub!(/~[{\[].+?[}\]]~\s+/m,' ') + end if para =~/.+?<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ paranum=para[/.+?<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,1] @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 44ab9033..a7e81624 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -425,7 +425,7 @@ module SiSU_HTML_seg @@seg_subtoc_array << para end if @md.flag_auto_endnotes - if para =~/~[{\[][\d*+]+ / # endnote- endnote_array=[] if para=~/~\{.+?\}\~/m endnote_array << para.scan(/~\{.+?\}\~/m) diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb index 7f91641e..7c829831 100644 --- a/lib/sisu/v0/html_tune.rb +++ b/lib/sisu/v0/html_tune.rb @@ -289,49 +289,51 @@ module SiSU_Tune para.gsub!(/<:p[bn]>/,'') para.gsub!(/<(p|br)>/,'<\1 />') para.gsub!(/<:br>/,'
') - if para =~/<::\s+/ #watch - para.gsub!(/<::\s+(\S+?)\s+!>/, - %{\\1}) - end - if para =~/<:image\s+/ - para.gsub!(/<:image\s+(http\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+>/, - %{
}) - para.gsub!(/<:image\s+(http\S+)\s+(\S+)\s+>/, - %{}) - para.gsub!(/<:image\s+(\S+)\s+(\S+)\s+(\S+)\s+>/, - %{}) - para.gsub!(/<:image\s+(\S+)\s+>/, - %{}) - end - if para =~/\{.+?\}((?:http|ftp)\S+|image)/ - @word_mode=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/) - word_mode=urls(@word_mode) - words=word_mode.join(' ') - para.gsub!(/.+/,words) - end - if (para !~/^0~/) - para.gsub!(/\\copyright/i,%{©}) - if (para !~/\<:ad\s+\.\.\//) - para.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*!\>/, - %{\n
\\3
\n}) - else - para.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/, - %{\n
\\3
\n}) + unless para =~/^<:code>/ + if para =~/<::\s+/ #watch + para.gsub!(/<::\s+(\S+?)\s+!>/, + %{\\1}) + end + if para =~/<:image\s+/ + para.gsub!(/<:image\s+(http\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+>/, + %{}) + para.gsub!(/<:image\s+(http\S+)\s+(\S+)\s+>/, + %{}) + para.gsub!(/<:image\s+(\S+)\s+(\S+)\s+(\S+)\s+>/, + %{}) + para.gsub!(/<:image\s+(\S+)\s+>/, + %{}) end - para.gsub!(/!pick/, %{stellar}) - para.gsub!(/!new/, %{ new}) - para.gsub!(/<:h(.{1,7}?)>/,'\1') - para.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') - if (para =~/\b\S+\@\S+?\.\S+/ and para !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/) - para.gsub!(/\b(\S+\@\S+?\.\S+)(\s)/,'<\1>\2') + if para =~/\{.+?\}((?:http|ftp)\S+|image)/ + @word_mode=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/) + word_mode=urls(@word_mode) + words=word_mode.join(' ') + para.gsub!(/.+/,words) end - para.gsub!(/\b[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2') #http ftp matches escaped, no decoration - para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2\3') #special case \{ e.g. \}http://url - para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,%{\\1#{@url_brace.xml_open}\\2#{@url_brace.xml_close}\\3}) #http ftp matches with decoration - if (para =~/..\/\S+/ and para !~/(\"..\/\S+?\"|>\s*..\/\S+<)/) - para.gsub!(/(\.\.\/\S+)/,'\1') + if (para !~/^0~|^<:code>/) + para.gsub!(/\\copyright/i,%{©}) + if (para !~/\<:ad\s+\.\.\//) + para.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*!\>/, + %{\n
\\3
\n}) + else + para.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/, + %{\n
\\3
\n}) + end + para.gsub!(/!pick/, %{stellar}) + para.gsub!(/!new/, %{ new}) + para.gsub!(/<:h(.{1,7}?)>/,'\1') + para.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') + if (para =~/\b\S+\@\S+?\.\S+/ and para !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/) + para.gsub!(/\b(\S+\@\S+?\.\S+)(\s)/,'<\1>\2') + end + para.gsub!(/\b[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2') #http ftp matches escaped, no decoration + para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2\3') #special case \{ e.g. \}http://url + para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,%{\\1#{@url_brace.xml_open}\\2#{@url_brace.xml_close}\\3}) #http ftp matches with decoration + if (para =~/..\/\S+/ and para !~/(\"..\/\S+?\"|>\s*..\/\S+<)/) + para.gsub!(/(\.\.\/\S+)/,'\1') + end + para.gsub!(/([}]~)/, - '  \2  ' + #note- endnote- - '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) - para.gsub!(/(~\[)([*+]\d+) (.+?) <#@dp>(\]~)/, - '  \2  ' + #note- endnote- - '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) - para.gsub!(/(~\{)([*+]+) (.+?) <#@dp>(\}~)/, - '  \2  ' + #note- endnote- - '\1\2  \2 \3 \4') #endnote- note- (careful may have switched) - @tuned_file << para + unless para =~/^<:code>/ + para.gsub!(/(~[{])(\d+) (.+?) <#@dp>([}]~)/, + '  \2  ' + #note- endnote- + '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) + para.gsub!(/(~\[)([*+]\d+) (.+?) <#@dp>(\]~)/, + '  \2  ' + #note- endnote- + '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) + para.gsub!(/(~\{)([*+]+) (.+?) <#@dp>(\}~)/, + '  \2  ' + #note- endnote- + '\1\2  \2 \3 \4') #endnote- note- (careful may have switched) end + @tuned_file << para + end end def output data=@data diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index 11d14bf2..16cea2f4 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -378,6 +378,7 @@ module SiSU_ODF parray=[] para.split(/<:?br(?: \/)?>/).each do |parablock| parablock=group_clean(parablock) + parablock.gsub!(/^\s*$/,'
') parablock.gsub!(/\b[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/, %{\\1\\2}) #http ftp matches escaped, no decoration parray << %{#{parablock}} if parablock =~/\S+/ @@ -398,8 +399,11 @@ module SiSU_ODF lv=nil if lv == 0 #extract_endnotes(para) #para=fontface(para) - para=if para =~/\{\s*\S+?\.(?:png|jpg|gif)\s.+?\}(?:(?:https?|ftp):\S+|image)/; image(para) - elsif para =~/\{.+?\}(?:(?:https?|ftp):\S+|image)/; text_link(para) + para=unless para=~/^<:code>/ + para=if para =~/\{\s*\S+?\.(?:png|jpg|gif)\s.+?\}(?:(?:https?|ftp):\S+|image)/; image(para) + elsif para =~/\{.+?\}(?:(?:https?|ftp):\S+|image)/; text_link(para) + else para + end else para end para=footnote(para) @@ -446,8 +450,8 @@ module SiSU_ODF (4..6).each { |x| @odf_contents_close[x]='' } odf_tail #($1,$2) fix=[] - bullet=image_src('bullet_red.png') - cp("#{bullet}/bullet_red.png","#{@env.path.odf}/Pictures/.") #if image_src('bullet_red.png') + bullet=image_src('bullet_09.png') + cp("#{bullet}/bullet_09.png","#{@env.path.odf}/Pictures/.") #if image_src('bullet_09.png') data.each do |para| #p para if para =~safe_characters and @md.cmd =~/V/ #KEEP #para.gsub!(/<(~\d+;(?:\w|[0-6]:)\d+;\w\d+)><(#@dp:#@dp)>/,'<\1><\2>') @@ -465,7 +469,7 @@ module SiSU_ODF para=para_array.join(' ') para=para.strip end - para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1 ') # bullet_red.png + para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1 ') # bullet_09.png #para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1 ') #bullet #para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1● ') # bullet utf8, make smaller if used #para.gsub!(/^_\*\s+/,' ') #bullet diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index 9462d8d2..690163d4 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -178,7 +178,6 @@ module SiSU_Param @sfx=nil @flag_pdf=true #watch @flag_auto_heading_num=false -#watch if @fns =~ /[_-]?sst$/ #watch @env_out_root=@env.path.output @dir_out="#{@env.path.output}/#@fnb" @@ -235,13 +234,19 @@ module SiSU_Param tell=SiSU_Screen::Ansi.new(@cmd,'SiSU filetype indicator not provided') tell.warn unless @cmd =~/q/ end + @code_flag=false fns_array.each do |par| #% Scan document para=par.gsub(/\n/,' ') if para !~/^\%+\s/ and para =~// + if para =~/\{.+?\}((?:http|ftp)\S+|image)/ + wm=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/) + word_mode=urls(wm) + words=word_mode.join(' ') + para.gsub!(/.+/,words) + end + para.gsub!(/\b[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2') #http ftp matches escaped, no decoration + para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2\3') #special case \{ e.g. \}http://url + para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,%{\\1#{@url_brace.xml_open}\\2#{@url_brace.xml_close}\\3}) #http ftp matches with decoration end - para.gsub!(/\b[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2') #http ftp matches escaped, no decoration - para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2\3') #special case \{ e.g. \}http://url - para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,%{\\1#{@url_brace.xml_open}\\2#{@url_brace.xml_close}\\3}) #http ftp matches with decoration para end def paragraph diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb index c54ab42d..4e77e995 100644 --- a/lib/sisu/v0/shared_xml.rb +++ b/lib/sisu/v0/shared_xml.rb @@ -352,8 +352,8 @@ module SiSU_XML_munge para.gsub!(/<+[-~]#>+/,'') para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'') #embeds a red-bullet image --> - #para.gsub!(/^(<:i[1-9]>\s*_\*)\s+/,'\1 * ') - #para.gsub!(/^_\*\s+/,'* ') + #para.gsub!(/^(<:i[1-9]>\s*_\*)\s+/,'\1 * ') + #para.gsub!(/^_\*\s+/,'* ') para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))\s+(\d+)x(\d+)(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1[\\2] \\5}) para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1\\2}) para.gsub!(/(^|\s)\{([^}]+)\}(https?:\/\/[^"><]+?)([,.:;"><]?(?=\s|$))/, diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb index 22c2681d..8bd5b6f2 100644 --- a/lib/sisu/v0/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -432,7 +432,10 @@ WOK if para =~/<:(code|alt|verse|group)>/ @lineone=case para when /<:(alt|verse|group)>/; para - when /<:code>/; "#{@tex.paraskip_small} \\begin{footnotesize} \\begin{ttfamily} " + para + when /<:code>/; "#{@tex.paraskip_small} \\begin{tiny} " + para + #when /<:code>/; "#{@tex.paraskip_small} \\begin{footnotesize} " + para + ##when /<:code>/; "#{@tex.paraskip_small} \\begin{texttt} " + para + #when /<:code>/; "#{@tex.paraskip_small} \\begin{small} \\begin{ttfamily} " + para else 'error' #should never occur end end @@ -462,7 +465,10 @@ WOK #@lineone.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>||)/,' ') insert=[] if para =~/<:code-end>/ - insert << y + @lineone << @group_collect << ' \end{ttfamily} \end{footnotesize}' << " #{@tex.paraskip_normal}" + insert << y + @lineone << @group_collect << ' \end{tiny}' << " #{@tex.paraskip_normal}" + #insert << y + @lineone << @group_collect << ' \end{footnotesize}' << " #{@tex.paraskip_normal}" + #insert << y + @lineone << @group_collect << ' \end{texttt}' << " #{@tex.paraskip_normal}" + #insert << y + @lineone << @group_collect << ' \end{ttfamily} \end{small}' << " #{@tex.paraskip_normal}" else insert << y + @lineone << @group_collect end @@flag_group,@@flag_code=false,false diff --git a/man/man1/sisu.1 b/man/man1/sisu.1 index 9166f37f..129d3af8 100644 --- a/man/man1/sisu.1 +++ b/man/man1/sisu.1 @@ -9,7 +9,7 @@ .\" /[^\\][-'] .\" :%s/\([^\\]\)\([-']\)/\1\\\2/c .\" |sisu.1|@|^| -.TH "sisu" "1" "July 31, 2007" "version 0.55" "USER COMMANDS and basic Markup" +.TH "sisu" "1" "September 3, 2007" "version 0.58" "USER COMMANDS and basic Markup" .SH "NAME" .B SiSU \- Structured information, Serialized Units \- a document publishing system @@ -518,13 +518,16 @@ and selecting or .I sisu \-\-help markup .TP -Sample markup files can be used as examples: -.I +Online markup examples together with the respective outputs produced are available from: +.I +.TP +or from the document: +.I .TP -actual marked up plaintext files ready for use: -.I +The following document gives a cursory overview of sisu markup and the respective output produced: +.I .TP -as html with syntax highlighting for viewing: +Some example marked up files are available as html with syntax highlighting for viewing: .I .TP an alternative presentation of markup syntax: -- cgit v1.2.3