diff options
-rw-r--r-- | data/doc/sisu/CHANGELOG_v3 | 32 | ||||
-rw-r--r-- | data/doc/sisu/html/sisu.1.html | 213 | ||||
-rw-r--r-- | data/doc/sisu/markup-samples/sisu_manual/sisu_commands.sst | 7 | ||||
-rw-r--r-- | data/doc/sisu/markup-samples/sisu_manual/sisu_content_directories.ssi | 138 | ||||
-rw-r--r-- | data/doc/sisu/markup-samples/sisu_manual/sisu_markup.sst | 8 | ||||
-rw-r--r-- | data/sisu/v3/v/version.yml | 6 | ||||
-rw-r--r-- | lib/sisu/v3/dal_doc_str.rb | 3 | ||||
-rw-r--r-- | lib/sisu/v3/dal_syntax.rb | 5 | ||||
-rw-r--r-- | lib/sisu/v3/epub_format.rb | 1 | ||||
-rw-r--r-- | lib/sisu/v3/sysenv.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v3/texpdf.rb | 196 | ||||
-rw-r--r-- | lib/sisu/v3/texpdf_format.rb | 125 | ||||
-rw-r--r-- | man/man1/sisu.1 | 112 |
13 files changed, 611 insertions, 239 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 6153ae16..8f9c2cea 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -13,20 +13,44 @@ Reverse Chronological: %% Development branch UNSTABLE v3 branch once stable will supersede & replace current stable v2 branch +%% 3.1.7.orig.tar.xz (2011-12-08:49/4) +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.7 +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.7-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.7.orig.tar.xz + sisu_3.1.7.orig.tar.xz + sisu_3.1.7-1.dsc + sisu_3.1.7-1.debian.tar.gz + + * dal, codeblocks + * internal document identifier tags removed, consider + * markup of greater than & less than, fix (but watch) + + * epub, css, codeblock, grey box + + * texpdf, use package listings for box around codeblocks (retain boites + option) + + * sysenv, external images directory copied only if it exists + + * documentation, add --configure & use ascii characters for dir tree + correction of a few typos + * manpage + * html + %% 3.1.6.orig.tar.xz (2011-12-02:48/5) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.6 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.6-1 http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.6.orig.tar.xz - sisu_3.1.6.orig.tar.xz - sisu_3.1.6-1.dsc - sisu_3.1.6-1.debian.tar.gz + c50fd6eda712ae090e9b16242d468aab8b8ecd6c1ee9b2798b317f9eb40b529c 1647512 sisu_3.1.6.orig.tar.xz + d5a165144d55d553e62c7fcee3b881d6525f238cc5184f284955307a955efb56 1382 sisu_3.1.6-1.dsc + 8e088fc702158a233d870e1b55928063d8e52b5931a51b5143b674052335793e 290179 sisu_3.1.6-1.debian.tar.gz * dal, codeblocks, start flush left (no buffer spaces at start of line) to allow cut & paste [requested by chals irc.oftc] (fixed issue, numbering of (flush left) codeblocks; preliminary tests suggest this should be ok), need distinguishing marks for plaintext (& fix grey background in xetex/pdfs) - * texpdf, use boites for box round codeblocks, use and adapt 'boitecoloriee' + * texpdf, use boites for box around codeblocks, use and adapt 'boitecoloriee' (found in boites_examples.sty) * in boitebox as setup normal tex hardspaces at start of line are removed, hack required to fix diff --git a/data/doc/sisu/html/sisu.1.html b/data/doc/sisu/html/sisu.1.html index e973641b..106502ee 100644 --- a/data/doc/sisu/html/sisu.1.html +++ b/data/doc/sisu/html/sisu.1.html @@ -200,6 +200,16 @@ colour default is set to ’false’ or is undefined screen output will colour). Alias -c <p> </dd> +<dt><b>--configure</b> </dt> +<dd>configure/initialise shared output directory +files initialize shared output directory (config files such as css and +dtd files are not updated if they already exist unless modifier is used). +The equivalent of: -C --init-site configure/initialise site, more extensive +than -C on its own, shared output directory files/force update, existing +shared output config files such as css and dtd files are updated if -CC +is used. +<p> </dd> + <dt><b>--concordance [filename/wildcard]</b> </dt> <dd>produces concordance (wordmap) a rudimentary index of all the words in a document. (Concordance files are @@ -207,10 +217,10 @@ not generated for documents of over 260,000 words unless this limit is increased in the file sisurc.yml). Alias -w <p> </dd> -<dt><b>-C [--init-site]</b> </dt> -<dd>configure/initialise -shared output directory files initialize shared output directory (config -files such as css and dtd files are not updated if they already exist unless +<dt><b>-C</b> </dt> +<dd>configure/initialise shared +output directory files initialize shared output directory (config files +such as css and dtd files are not updated if they already exist unless modifier is used). -C --init-site configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files are updated if this modifier @@ -218,82 +228,75 @@ is used. <p> </dd> <dt><b>-CC</b> </dt> -<dd>configure/initialise shared output directory files initialize -shared output directory (config files such as css and dtd files are not -updated if they already exist unless modifier is used). The equivalent of: --C --init-site configure/initialise site, more extensive than -C on its own, -shared output directory files/force update, existing shared output config -files such as css and dtd files are updated if -CC is used. +<dd>see --configure +<p> </dd> + +<dt><b>-c [filename/wildcard]</b> </dt> +<dd>see --color-toggle <p> </dd> -<dt><b>-c [filename/wildcard]</b> +<dt><b>--dal [filename/wildcard/url]</b> </dt> -<dd> -<p>see --color-toggle +<dd>assumed for most other flags, creates new intermediate files for processing +(document abstraction) that is used in all subsequent processing of other +output. This step is assumed for most processing flags. To skip it see -n. + +<p>Alias -m <p> </dd> -<dt><b>--dal [filename/wildcard/url]</b> </dt> -<dd>assumed for most other flags, -creates new intermediate files for processing (document abstraction) that -is used in all subsequent processing of other output. This step is assumed -for most processing flags. To skip it see -n. Alias -m +<dt><b>--delete [filename/wildcard]</b> </dt> +<dd>see --zap <p> </dd> -<dt><b>--delete [filename/wildcard]</b> +<dt><b>-D [instruction] [filename]</b> </dt> <dd> -<p>see --zap +<p>see --pg <p> </dd> -<dt><b>-D [instruction] [filename]</b> </dt> -<dd>see --pg -<p> </dd> - -<dt><b>-d [--db-[database type (sqlite|pg)]] ---[instruction] [filename]</b> </dt> +<dt><b>-d [--db-[database type (sqlite|pg)]] --[instruction] [filename]</b> </dt> <dd>see --sqlite + <p> </dd> <dt><b>--epub [filename/wildcard]</b> </dt> -<dd>produces -an epub document, [sisu version >=2 ] (filename.epub). Alias -e +<dd>produces an epub document, [sisu version >=2 ] +(filename.epub). Alias -e <p> </dd> -<dt><b>-e [filename/wildcard]</b> -</dt> -<dd> -<p>see --epub +<dt><b>-e [filename/wildcard]</b> </dt> +<dd>see --epub <p> </dd> -<dt><b>--find [optional string part of filename]</b> </dt> -<dd>without match string, -glob all .sst .ssm files in directory (including language subdirectories). -With match string, find files that match given string in directory (including -language subdirectories). Alias -f, --glob, -G +<dt><b>--find [optional + string part of filename]</b> </dt> +<dd>without match string, glob all .sst .ssm files in +directory (including language subdirectories). With match string, find files +that match given string in directory (including language subdirectories). +Alias -f, --glob, -G <p> </dd> <dt><b>-F [--webserv=webrick]</b> </dt> <dd>see --sample-search-form - <p> </dd> -<dt><b>-f [optional string part of filename]</b> </dt> +<dt><b>-f [optional + string part of filename]</b> </dt> <dd>see --find <p> </dd> -<dt><b>--git [filename/wildcard]</b> -</dt> -<dd>produces or updates markup source file structure in a git repo (experimental -and subject to change). Alias -g +<dt><b>--git [filename/wildcard]</b> </dt> +<dd>produces or +updates markup source file structure in a git repo (experimental and subject +to change). Alias -g <p> </dd> -<dt><b>--glob [optional string part of filename]</b> -</dt> -<dd> -<p>see --find +<dt><b>--glob [optional string part of filename]</b> </dt> +<dd>see --find <p> </dd> -<dt><b>-G [optional string part of filename]</b> </dt> +<dt><b>-G +[optional string part of filename]</b> </dt> <dd>see --find <p> </dd> @@ -304,19 +307,19 @@ and subject to change). Alias -g <p> </dd> <dt><b>--harvest *.ss[tm]</b> </dt> -<dd>makes two lists of sisu output based on the sisu -markup documents in a directory: list of author and authors works (year -and titles), and; list by topic with titles and author. Makes use of header -metadata fields (author, title, date, topic_register). Can be used with -maintenance (-M) and remote placement (-R) flags. +<dd>makes two lists of sisu output based on the sisu markup +documents in a directory: list of author and authors works (year and titles), +and; list by topic with titles and author. Makes use of header metadata +fields (author, title, date, topic_register). Can be used with maintenance +(-M) and remote placement (-R) flags. <p> </dd> <dt><b>--help [topic]</b> </dt> -<dd>provides help -on the selected topic, where topics (keywords) include: list, (com)mands, -short(cuts), (mod)ifiers, (env)ironment, markup, syntax, headers, headings, -endnotes, tables, example, customise, skin, (dir)ectories, path, (lang)uage, -db, install, setup, (conf)igure, convert, termsheet, search, sql, features, +<dd>provides help on the selected +topic, where topics (keywords) include: list, (com)mands, short(cuts), +(mod)ifiers, (env)ironment, markup, syntax, headers, headings, endnotes, +tables, example, customise, skin, (dir)ectories, path, (lang)uage, db, +install, setup, (conf)igure, convert, termsheet, search, sql, features, <p>license <p> </dd> @@ -676,7 +679,8 @@ deep document structure, in the nature of dom. Alias -X <p> </dd> <dt><b>-Y [filename/wildcard]</b> </dt> -<dd>produces a short sitemap entry for the document, based on html output and the sisu_manifest. +<dd>produces +a short sitemap entry for the document, based on html output and the sisu_manifest. --sitemaps generates/updates the sitemap index of existing sitemaps. (Experimental, [g,y,m announcement this week]) <p> </dd> @@ -1486,7 +1490,7 @@ normal text <<a href='http://www.sisudoc.org/'>http://www.sisudoc.org/</a> <b>markup example:</b> <p> <br> <pre> normal text _http://www.sisudoc.org/ continues - deb http://www.jus.uio.no/sisu/archive unstable main non-free + deb _http://www.jus.uio.no/sisu/archive unstable main non-free </pre> <p> <br> <b>resulting output:</b> @@ -1555,6 +1559,13 @@ Debian and Ruby" }http://www.sisudoc.org/ {~^ ruby_logo.png "Ruby" }http://www.ruby-lang.org/en/ +markup example: + { tux.png 64x80 }image + % various url linked images + {tux.png 64x80 "a better way" }http://www.sisudoc.org/ + {GnuDebianLinuxRubyBetterWay.png 100x101 "Way Better - with Gnu/Linux, +Debian and Ruby" }http://www.sisudoc.org/ + {~^ ruby_logo.png "Ruby" }http://www.ruby-lang.org/en/ </pre> <p> <br> <b>resulting output:</b> @@ -1634,8 +1645,8 @@ Tables</a></h2> 320,000| 630,000 No. of articles, all languages | 25| 19,000| 138,000| 490,000| 862,000|1,600,000 - \* Contributed at least ten times; \** at least 5 times in last month; -\*\** more than 100 times in last month. + * Contributed at least ten times; ** at least 5 times in last month; +*** more than 100 times in last month. </pre> <p> <br> <b>resulting output:</b> @@ -2148,7 +2159,7 @@ If multiple sub-terms appear under one paragraph, they are separated under the main term heading from each other by a pipe symbol. <p> <br> <pre> Paragraph containing main term, second term and sub-term. - ={Main term:sub-term+1|second sub-term + ={Main term:sub-term+1|second sub-term} A paragraph that continues discussion of the first sub-term </pre> <p> <br> @@ -2773,6 +2784,7 @@ CSS file that is looked for in a skin.[^18] structures of which there are 3 alternatives. <p> <h2><a name='sect66' href='#toc66'>17.1 Document Source Directory</a></h2> + <p> <br> The document source directory is the directory in which sisu processing @@ -2860,6 +2872,34 @@ by filetype. <p> <br> output_dir_structure_by: language <p> <br> +<pre> |-- en + |-- epub + |-- hashes + |-- html + | |-- viral_spiral.david_bollier + | |-- manifest + | |-- qrcode + | |-- odt + | |-- pdf + | |-- sitemaps + | |-- txt + | |-- xhtml + | ‘-- xml + |-- po4a + | ‘-- live-manual + | |-- po + | |-- fr + | ‘-- pot + ‘-- _sisu + |-- css + |-- image + |-- image_sys -> ../../_sisu/image_sys + ‘-- xml + |-- rnc + |-- rng + ‘-- xsd +</pre> +<p> <br> #by: language subject_dir/en/manifest/filename.html <p> <h2><a name='sect72' href='#toc72'>17.2.4 by Filetype</a></h2> @@ -2874,6 +2914,33 @@ given a language extension. <p> <br> output_dir_structure_by: filetype <p> <br> +<pre> |-- epub + |-- hashes + |-- html + |-- viral_spiral.david_bollier + |-- manifest + |-- qrcode + |-- odt + |-- pdf + |-- po4a + |-- live-manual + | |-- po + | |-- fr + | ‘-- pot + |-- _sisu + | |-- css + | |-- image + | |-- image_sys -> ../../_sisu/image_sys + | ‘-- xml + | |-- rnc + | |-- rng + | ‘-- xsd + |-- sitemaps + |-- txt + |-- xhtml + ‘-- xml +</pre> +<p> <br> #by: filetype subject_dir/html/filename/manifest.en.html <p> <h2><a name='sect73' href='#toc73'>17.2.5 by Filename</a></h2> @@ -2888,6 +2955,26 @@ file (the different filetypes) in a common directory. <p> <br> output_dir_structure_by: filename <p> <br> +<pre> |-- epub + |-- po4a + |-- live-manual + | |-- po + | |-- fr + | ‘-- pot + |-- _sisu + | |-- css + | |-- image + | |-- image_sys -> ../../_sisu/image_sys + | ‘-- xml + | |-- rnc + | |-- rng + | ‘-- xsd + |-- sitemaps + |-- src + |-- pod + ‘-- viral_spiral.david_bollier +</pre> +<p> <br> #by: filename subject_dir/filename/manifest.en.html <p> <h2><a name='sect74' href='#toc74'>17.2.6 Remote Directories</a></h2> diff --git a/data/doc/sisu/markup-samples/sisu_manual/sisu_commands.sst b/data/doc/sisu/markup-samples/sisu_manual/sisu_commands.sst index b24abde7..201b927e 100644 --- a/data/doc/sisu/markup-samples/sisu_manual/sisu_commands.sst +++ b/data/doc/sisu/markup-samples/sisu_manual/sisu_commands.sst @@ -66,14 +66,17 @@ see --xhtml !_ --color-toggle [filename/wildcard] \\ screen toggle ansi screen colour on or off depending on default set (unless -c flag is used: if sisurc colour default is set to 'true', output to screen will be with colour, if sisurc colour default is set to 'false' or is undefined screen output will be without colour). Alias -c +!_ --configure \\ +configure/initialise shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used). The equivalent of: -C --init-site configure/initialise site, more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files are updated if -CC is used. + !_ --concordance [filename/wildcard] \\ produces concordance (wordmap) a rudimentary index of all the words in a document. (Concordance files are not generated for documents of over 260,000 words unless this limit is increased in the file sisurc.yml). Alias -w -!_ -C [--init-site] \\ +!_ -C \\ configure/initialise shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used). -C --init-site configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files are updated if this modifier is used. !_ -CC \\ -configure/initialise shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used). The equivalent of: -C --init-site configure/initialise site, more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files are updated if -CC is used. +see --configure !_ -c [filename/wildcard] \\ see --color-toggle diff --git a/data/doc/sisu/markup-samples/sisu_manual/sisu_content_directories.ssi b/data/doc/sisu/markup-samples/sisu_manual/sisu_content_directories.ssi index b7e09434..5784c03d 100644 --- a/data/doc/sisu/markup-samples/sisu_manual/sisu_content_directories.ssi +++ b/data/doc/sisu/markup-samples/sisu_manual/sisu_content_directories.ssi @@ -95,32 +95,32 @@ output_dir_structure_by: language code{ - ├── en - │ ├── epub - │ ├── hashes - │ ├── html - │ │ └── viral_spiral.david_bollier - │ ├── manifest - │ │ └── qrcode - │ ├── odt - │ ├── pdf - │ ├── sitemaps - │ ├── txt - │ ├── xhtml - │ └── xml - ├── po4a - │ └── live-manual - │ ├── po - │ │ └── fr - │ └── pot - └── _sisu - ├── css - ├── image - ├── image_sys -> ../../_sisu/image_sys - └── xml - ├── rnc - ├── rng - └── xsd + |-- en + |-- epub + |-- hashes + |-- html + | |-- viral_spiral.david_bollier + | |-- manifest + | |-- qrcode + | |-- odt + | |-- pdf + | |-- sitemaps + | |-- txt + | |-- xhtml + | `-- xml + |-- po4a + | `-- live-manual + | |-- po + | |-- fr + | `-- pot + `-- _sisu + |-- css + |-- image + |-- image_sys -> ../../_sisu/image_sys + `-- xml + |-- rnc + |-- rng + `-- xsd }code @@ -139,31 +139,31 @@ output_dir_structure_by: filetype code{ - ├── epub - ├── hashes - ├── html - │ └── viral_spiral.david_bollier - ├── manifest - │ └── qrcode - ├── odt - ├── pdf - ├── po4a - │ └── live-manual - │ ├── po - │ │ └── fr - │ └── pot - ├── _sisu - │ ├── css - │ ├── image - │ ├── image_sys -> ../../_sisu/image_sys - │ └── xml - │ ├── rnc - │ ├── rng - │ └── xsd - ├── sitemaps - ├── txt - ├── xhtml - └── xml + |-- epub + |-- hashes + |-- html + |-- viral_spiral.david_bollier + |-- manifest + |-- qrcode + |-- odt + |-- pdf + |-- po4a + |-- live-manual + | |-- po + | |-- fr + | `-- pot + |-- _sisu + | |-- css + | |-- image + | |-- image_sys -> ../../_sisu/image_sys + | `-- xml + | |-- rnc + | |-- rng + | `-- xsd + |-- sitemaps + |-- txt + |-- xhtml + `-- xml }code @@ -182,24 +182,24 @@ output_dir_structure_by: filename code{ - ├── epub - ├── po4a - │ └── live-manual - │ ├── po - │ │ └── fr - │ └── pot - ├── _sisu - │ ├── css - │ ├── image - │ ├── image_sys -> ../../_sisu/image_sys - │ └── xml - │ ├── rnc - │ ├── rng - │ └── xsd - ├── sitemaps - ├── src - │ └── pod - └── viral_spiral.david_bollier + |-- epub + |-- po4a + |-- live-manual + | |-- po + | |-- fr + | `-- pot + |-- _sisu + | |-- css + | |-- image + | |-- image_sys -> ../../_sisu/image_sys + | `-- xml + | |-- rnc + | |-- rng + | `-- xsd + |-- sitemaps + |-- src + |-- pod + `-- viral_spiral.david_bollier }code diff --git a/data/doc/sisu/markup-samples/sisu_manual/sisu_markup.sst b/data/doc/sisu/markup-samples/sisu_manual/sisu_markup.sst index 62cf013e..000d3e4c 100644 --- a/data/doc/sisu/markup-samples/sisu_manual/sisu_markup.sst +++ b/data/doc/sisu/markup-samples/sisu_manual/sisu_markup.sst @@ -567,7 +567,7 @@ code{ normal text _http://www.sisudoc.org/ continues -deb http://www.jus.uio.no/sisu/archive unstable main non-free +deb _http://www.jus.uio.no/sisu/archive unstable main non-free }code @@ -765,7 +765,7 @@ Very active contributors*** | 0| 31| 190| 692| 1,6 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 -\* Contributed at least ten times; \** at least 5 times in last month; \*\** more than 100 times in last month. +* Contributed at least ten times; ** at least 5 times in last month; *** more than 100 times in last month. }code @@ -782,7 +782,7 @@ Very active contributors*** | 0| 31| 190| 692| 1,6 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 -\* Contributed at least ten times; \** at least 5 times in last month; \*\** more than 100 times in last month. +* Contributed at least ten times; ** at least 5 times in last month; *** more than 100 times in last month. % code{ @@ -1239,7 +1239,7 @@ If multiple sub-terms appear under one paragraph, they are separated under the m code{ Paragraph containing main term, second term and sub-term. - ={Main term:sub-term+1|second sub-term + ={Main term:sub-term+1|second sub-term} A paragraph that continues discussion of the first sub-term diff --git a/data/sisu/v3/v/version.yml b/data/sisu/v3/v/version.yml index b4b0fb8c..c6f6a029 100644 --- a/data/sisu/v3/v/version.yml +++ b/data/sisu/v3/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 3.1.6 -:date_stamp: 2011w48/5 -:date: "2011-12-02" +:version: 3.1.7 +:date_stamp: 2011w49/4 +:date: "2011-12-08" :project: SiSU diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb index 2bf0305e..91110b44 100644 --- a/lib/sisu/v3/dal_doc_str.rb +++ b/lib/sisu/v3/dal_doc_str.rb @@ -376,7 +376,8 @@ module SiSU_document_structure_extract if @@flag['code'] if t_o =~/^\}code/ @@flag['code']=false - obj,tags=extract_tags(@tuned_code.join("\n")) + obj=@tuned_code.join("\n") + tags=[] h={ obj: obj, tags: tags, number_: @codeblock_numbered } t_o=SiSU_document_structure::Object_block_txt.new.code(h) @tuned_code=[] diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb index 6d56e4aa..b887904e 100644 --- a/lib/sisu/v3/dal_syntax.rb +++ b/lib/sisu/v3/dal_syntax.rb @@ -332,7 +332,7 @@ module SiSU_Syntax and defined? @md.creator \ and @md.creator if dob.is =='heading' - dob.obj.gsub!(/^\s*@title\s*$/,@md.title.full) if dob.lv =~/1/ # + dob.obj.gsub!(/^\s*@title\s*$/,@md.title.full) if dob.lv =~/1/ if dob.lv =~/[23]/ \ and defined? @md.creator.author \ and @md.creator.author @@ -432,9 +432,6 @@ module SiSU_Syntax dob=fontface(dob) elsif dob.is =='code' dob.obj.gsub!(/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*/,'@\1: ') - dob.obj.gsub!(/([<>])/,'_\1') - dob.obj.gsub!(/_<:(\S+?)_>/,'<:\1>') #convert <:\S+> back, clumsy - dob.obj.gsub!(/_<(br(?: \/)?)_>/,'<\1>') #convert <br> <br /> back, clumsy dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s)<(br(?: \/)?)>([\s,.]|$)/,'\1<\2>\3') #convert <br> <br /> back, clumsy if dob.number_ codeline=[] diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 42570dd0..9d55d1d9 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -674,6 +674,7 @@ module SiSU_EPUB_Format font-family: inconsolata, andale mono, courier new, courier, monospace; font-size: 90%; text-align: left; + background-color: #eeeeee; } p.caption { diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 0584d85f..953c8eec 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -5207,7 +5207,9 @@ WOK def cp_external_images src="#{@env.processing_path.processing}/external_document/image" dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external" - cp_images(src,dest) + if FileTest.directory?(src) + cp_images(src,dest) + end end def cp_webserver_images src=@env.path.image_source diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index d36344cd..2b9e1087 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -294,6 +294,7 @@ module SiSU_TeX true else false end + @codeblock_box='listings' #alternative 'boites' end def songsheet begin @@ -352,7 +353,11 @@ module SiSU_TeX dob.tmp=SiSU_TeX_Pdf::Format_text_object.new(@md,dob.tmp).url_str_internal(dob.tmp) end elsif dob.is =='code' - dob.tmp=SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp).special_characters_code + dob.tmp=if @codeblock_box=='listings' + dob.tmp + else + SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp).special_characters_code + end elsif dob.is =='break' if dob.obj==Mx[:br_page]; dob.tmp='\newpage' elsif dob.obj==Mx[:br_page_new]; dob.tmp='\clearpage' @@ -408,6 +413,53 @@ module SiSU_TeX def enclose(dob) dob end + def box_boites(dob,ocn) + sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp,dob.is) + dob.tmp=sp_char.special_characters_safe + dob.tmp.gsub!(/(#{Mx[:nbsp]})/m,'{\color{mywhite}\1}') + #dob.tmp.gsub!(/#{Mx[:nbsp]}/m,'{~}') # dob.tmp.gsub!(/#{Mx[:nbsp]}\s*/m,'{~}') + dob.tmp.gsub!(/#{Mx[:vline]}/m,'\vline') + dob.tmp.gsub!(/ \\( |#{Mx[:br_nl]})/,' {\textbackslash}\1') + dob.tmp.gsub!(/#{Mx[:br_nl]}\s*\Z/m,'') + dob.tmp.gsub!(/#{Mx[:br_nl]}{2}/,'\newline \\\\\\ ') + dob.tmp.gsub!(/#{Mx[:br_nl]}/,' \\\\\\ ') + dob.tmp.gsub!(/\n\n\n/m," \\newline\n\n") + ocn=SiSU_TeX_Pdf::Format_text_object.new(@md).ocn_display(dob) + dob.tmp = ocn \ + + @tex_ml.paraskip_small \ + + '\begin{Codeblock}' \ + + '\begin{codeblockboitebox} \hardspace \newline ' \ + + dob.tmp \ + + '\end{codeblockboitebox}' \ + + '\end{Codeblock}' \ + + "\n" \ + + @tex_ml.paraskip_normal + dob + end + def box_listings(dob,ocn) + sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp,dob.is) + dob.tmp=sp_char.characters_code_listings + dob.tmp.gsub!(/^\s+/m,'') #bug, fix earlier, should be made unecessary + dob.tmp.gsub!(/#{Mx[:nbsp]}/m,' ') + dob.tmp.gsub!(/#{Mx[:vline]}/m,'|') + dob.tmp.gsub!(/#{Mx[:br_nl]}(?:\s?\n)?/m,"\n") + dob.tmp.gsub!(/\n\n\n/m," \n\n") + ocn=SiSU_TeX_Pdf::Format_text_object.new(@md).ocn_display(dob) + dob.tmp = ocn \ + + @tex_ml.paraskip_small \ + + '\begin{Codeblock}' \ + + "\n" \ + + '\begin{lstlisting} ' \ + + "\n" \ + + dob.tmp \ + + "\n" \ + + '\end{lstlisting} ' \ + + "\n" \ + + '\end{Codeblock}' \ + + "\n" \ + + @tex_ml.paraskip_normal + dob + end def markup_common(dob) tex_f=nil txt_obj={ dal: dob } @@ -430,7 +482,7 @@ module SiSU_TeX + '\\end{footnotesize}' \ + "\n" \ + @tex_ml.paraskip_normal - elsif dob.is=~/verse/ + elsif dob.is=~/verse/ ocn \ + @tex_ml.paraskip_tiny \ + "\n" \ @@ -444,26 +496,13 @@ module SiSU_TeX end dob when /code/ - sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp,dob.is) - dob.tmp=sp_char.special_characters_safe - dob.tmp.gsub!(/(#{Mx[:nbsp]})/m,'{\color{mywhite}\1}') - #dob.tmp.gsub!(/#{Mx[:nbsp]}/m,'{~}') # dob.tmp.gsub!(/#{Mx[:nbsp]}\s*/m,'{~}') - dob.tmp.gsub!(/#{Mx[:vline]}/m,'\vline') - dob.tmp.gsub!(/ \\( |#{Mx[:br_nl]})/,' {\textbackslash}\1') - dob.tmp.gsub!(/#{Mx[:br_nl]}\s*\Z/m,'') - dob.tmp.gsub!(/#{Mx[:br_nl]}{2}/,'\newline \\\\\\ ') - dob.tmp.gsub!(/#{Mx[:br_nl]}/,' \\\\\\ ') - dob.tmp.gsub!(/\n\n\n/m," \\newline\n\n") - ocn=SiSU_TeX_Pdf::Format_text_object.new(@md).ocn_display(dob) - dob.tmp = ocn \ - + @tex_ml.paraskip_small \ - + '\begin{Codeblock}' \ - + '\begin{codeblockboitebox} \hardspace \newline ' \ - + dob.tmp \ - + '\end{codeblockboitebox}' \ - + '\end{Codeblock}' \ - + "\n" \ - + @tex_ml.paraskip_normal + dob=if @codeblock_box == 'listings' + box_listings(dob,ocn) + elsif @codeblock_box == 'boites' + box_boites(dob,ocn) + else + box_boites(dob,ocn) + end dob else 'error' #should never occur end @@ -533,7 +572,7 @@ module SiSU_TeX dob=enclose(dob) unless dob.tmp =~/^$/ end else - dob.tmp.strip! + dob.tmp.strip! unless dob.is=='code' dob=enclose(dob) unless dob.tmp =~/^$/ end if dob.class==String @@ -543,22 +582,83 @@ module SiSU_TeX dob end if dob.tmp =~/(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image\b)/m \ - and dob.is !='code' + && dob.is !='code' dob=SiSU_TeX_Pdf::Bare_urls.new(@md,dob).bare_urls tst=SiSU_TeX_Pdf::Format_text_object.new(@md,dob) dob=tst.urls_txt_and_images dob elsif dob.tmp =~/https?:\/\/\S+\b/m \ - and dob.is =='code' + && dob.is =='code' \ + && @codeblock_box !='listings' dob=SiSU_TeX_Pdf::Bare_urls.new(@md,dob).bare_urls_in_code dob end - if dob.class !=Hash and dob.tmp =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}image\b/ \ - and dob.is !='code' + if dob.class !=Hash \ + && dob.tmp =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}image\b/ \ + && dob.is !='code' tst=SiSU_TeX_Pdf::Format_text_object.new(@md,dob) end dob end + def tex_box_listings + <<WOK +\\definecolor{listinggray}{gray}{0.9} +\\definecolor{lbcolor}{rgb}{0.9,0.9,0.9} +\\lstset{ + backgroundcolor=\\color{lbcolor}, + tabsize=4, + rulecolor=, + language=, + basicstyle=\\scriptsize, + upquote=true, + aboveskip={1.5\\baselineskip}, + columns=fixed, + showstringspaces=false, + extendedchars=true, + breaklines=true, + prebreak = \\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookleftarrow}}, + frame=single, + showtabs=false, + showspaces=false, + showstringspaces=false, + identifierstyle=\\ttfamily, + keywordstyle=\\color[rgb]{0,0,1}, + commentstyle=\\color[rgb]{0.133,0.545,0.133}, + stringstyle=\\color[rgb]{0.627,0.126,0.941}, +} +WOK + end + def tex_box_boites + <<WOK +\\def\\codeblockboitebox{% + \\def\\bkvz@before@breakbox{\\ifhmode\\par\\fi\\vskip\\breakboxskip\\relax}% + \\def\\bkvz@set@linewidth{\\advance\\linewidth -2\\fboxrule + \\advance\\linewidth -2\\fboxsep} % + \\def\\bk@line{\\hbox to \\linewidth{% + \\ifbkcount\\smash{\\llap{\\the\\bk@lcnt\\ }}\\fi + \\psframebox*[framesep=0pt,linewidth=0pt]{% + \\vrule\\@width\\fboxrule \\hskip\\fboxsep + \\box\\bk@bxa + \\hskip\\fboxsep \\vrule\\@width\\fboxrule + }% + }}% + %\\def\\bkvz@top{\\hrule\\@height\\fboxrule} + \\def\\bkvz@top{\\hrule height .6pt}% + \\def\\bkvz@bottom{\\hrule\\@height\\fboxrule}% + \\breakbox} +\\def\\endcodeblockboitebox{\\endbreakbox} +WOK + end + def tex_codeblock + codeblock_box=if @codeblock_box=='listings' + tex_box_listings + elsif @codeblock_box=='boites' + tex_box_boites + else + tex_box_boites + end + codeblock_box + end def markup(data) @tex_file=[] md={} @@ -569,8 +669,8 @@ module SiSU_TeX orient_portrait=SiSU_TeX_Pdf::Format_head.new(@md,txt_obj) txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: 'landscape' } orient_landscape=SiSU_TeX_Pdf::Format_head.new(@md,txt_obj) - @@tex_head[ps][:p]=orient_portrait.document_head_with_orientation - @@tex_head[ps][:l]=orient_landscape.document_head_with_orientation + @@tex_head[ps][:p]=orient_portrait.document_head_with_orientation(@codeblock_box) + @@tex_head[ps][:l]=orient_landscape.document_head_with_orientation(@codeblock_box) end @tex_file <<<<WOK #{@tex_ml.header}#{@tex_ml.footer} @@ -598,24 +698,7 @@ module SiSU_TeX \\newcommand{\\slash}{{/}} \\newcommand{\\underscore}{\\_} \\newcommand{\\exclaim}{\\Verbatim{!}} -\\def\\codeblockboitebox{% - \\def\\bkvz@before@breakbox{\\ifhmode\\par\\fi\\vskip\\breakboxskip\\relax}% - \\def\\bkvz@set@linewidth{\\advance\\linewidth -2\\fboxrule - \\advance\\linewidth -2\\fboxsep} % - \\def\\bk@line{\\hbox to \\linewidth{% - \\ifbkcount\\smash{\\llap{\\the\\bk@lcnt\\ }}\\fi - \\psframebox*[framesep=0pt,linewidth=0pt]{% - \\vrule\\@width\\fboxrule \\hskip\\fboxsep - \\box\\bk@bxa - \\hskip\\fboxsep \\vrule\\@width\\fboxrule - }% - }}% - %\\def\\bkvz@top{\\hrule\\@height\\fboxrule} - \\def\\bkvz@top{\\hrule height .6pt}% - \\def\\bkvz@bottom{\\hrule\\@height\\fboxrule}% - \\breakbox} -\\def\\endcodeblockboitebox{\\endbreakbox} - +#{tex_codeblock} % (tilde hash amp affected by http) % \\sloppy \\begin{document} @@ -789,8 +872,10 @@ WOK ps,h,fn=o[:ps],o[:h],o[:filename] if h[ps] \ and (h[ps][:p] and h[ps][:l]) - h[ps][:p].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[ps][:p] - h[ps][:l].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[ps][:l] + h[ps][:p].gsub!(/[ ]+$/m,'') if h[ps][:p] + h[ps][:l].gsub!(/[ ]+$/m,'') if h[ps][:l] + #h[ps][:p].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[ps][:p] + #h[ps][:l].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[ps][:l] h[ps][:p].gsub!(/\n\n\n+/m,"\n\n") if h[ps][:p] h[ps][:l].gsub!(/\n\n\n+/m,"\n\n") if h[ps][:l] if h[ps][:p] !~/\A\s*\Z/ @@ -800,8 +885,10 @@ WOK fn[:landscape].puts h[ps][:l],"\n" end elsif (h[:p] and h[:l]) - h[:p].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[:p] - h[:l].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[:l] + h[:p].gsub!(/[ ]+$/m,'') if h[:p] + h[:l].gsub!(/[ ]+$/m,'') if h[:l] + #h[:p].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[:p] + #h[:l].gsub!(/(?:^[ ]+|[ ]+$)/m,'') if h[:l] h[:p].gsub!(/\n\n\n+/m,"\n\n") if h[:p] h[:l].gsub!(/\n\n\n+/m,"\n\n") if h[:l] if h[:p] !~/\A\s*\Z/ @@ -827,7 +914,7 @@ WOK file[:landscape] << @@tex_head[ps][:l] array.each do |morph| if morph.class==String - morph.gsub!(/^\s+/,'') + #morph.gsub!(/^\s+/,'') if morph !~/\A\s*\Z/ file[:portrait].puts morph,"\n" file[:landscape].puts morph,"\n" @@ -835,9 +922,10 @@ WOK elsif morph.class.inspect =~ /SiSU_document_structure/ \ and morph.tmp \ and morph.tmp.class==String - unless morph.of=='block' + if morph.is !='code' \ + && morph.of !='block' morph.tmp.gsub!(/^\s+/,'') - else morph.tmp.gsub!(/^ +/,'') + else morph.tmp end if morph.tmp !~/\A\s*\Z/ \ or morph.is=='code' diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index e65f9729..2e69e3e3 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -179,7 +179,7 @@ module SiSU_TeX_Pdf textwidth=tw.to_i - 20 colW=[] colW << '{' - @dob.widths.each do |x| + @dob.widths.each do |x| x=(x.to_i * textwidth)/100 #x=(x.to_i/100.0 * 160) col_w=x.to_s # x.gsub(/.+/,'l\|') #unless x.nil? colW << "p{#{col_w}mm}" if col_w @@ -555,7 +555,7 @@ module SiSU_TeX_Pdf map_nametags[url][:ocn] else nil end - ocn_lnk=(url=~/^\d+$/ ? url : ocn_lnk) + ocn_lnk=(url=~/^\d+$/ ? url : ocn_lnk) if ocn_lnk and not ocn_lnk.empty? idx \ ? (str.sub!(rgx_url_internal,"\\hyperlink{#{ocn_lnk}}{#{link}}")) @@ -767,6 +767,21 @@ module SiSU_TeX_Pdf @tex2pdf=@@tex3pdf ||=SiSU_Env::System_call.new.tex2pdf_engine @ps=@txt if @txt=~/(?:a4|letter|legal|book|a5|b5)/i @lang ||=SiSU_i18n::Languages.new #.list[@md.opt.lng][:xlp] + @author=if defined? @md.creator.author \ + and @md.creator.author=~/\S+/ + SiSU_TeX_Pdf::Special_characters.new(@md,@md.creator.author).special_characters_safe + else '' + end + @subject=if defined? @md.classify.subject \ + and @md.classify.subject=~/\S+/ + SiSU_TeX_Pdf::Special_characters.new(@md,@md.classify.subject).special_characters_safe + else '' + end + @keywords=if defined? @md.classify.keywords \ + and @md.classify.keywords=~/\S+/ + SiSU_TeX_Pdf::Special_characters.new(@md,@md.classify.keywords).special_characters_safe + else '' + end end def tex_head_lang #babel 18n lang_char_arr=@md.i18n @@ -841,7 +856,7 @@ WOK end end def tex_head_info - generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version] + generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version] lastdone="Last Generated on: #{Time.now}" rubyv="Ruby version: #{@md.ruby_version}" <<WOK @@ -858,9 +873,9 @@ WOK <<WOK #{tex_head_info} \\documentclass[#{d[:fontsize]},#{d[:papertype]},titlepage]{scrartcl} %with titlepage -\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm} -\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}} -\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}} +\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm} +\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}} +\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}} \\setlength{\\headsep}{#{d[:headsep]}} \\setlength{\\marginparsep}{#{d[:marginparsep]}} \\setlength{\\marginparwidth}{#{d[:marginparwidth]}} @@ -871,9 +886,9 @@ WOK <<WOK #{tex_head_info} \\documentclass[#{d[:fontsize]},#{d[:papertype]},landscape,titlepage,twocolumn]{scrartcl} %with titlepage -\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm} -\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}} -\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}} +\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm} +\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}} +\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}} \\setlength{\\headsep}{#{d[:headsep]}} \\setlength{\\columnsep}{#{d[:columnsep]}} \\setlength{\\marginparsep}{#{d[:marginparsep]}} @@ -884,9 +899,9 @@ WOK <<WOK #{tex_head_info} \\documentclass[#{d[:fontsize]},#{d[:papertype]},titlepage]{scrartcl} %with titlepage -\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm} -\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}} -\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}} +\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm} +\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}} +\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}} \\setlength{\\headsep}{#{d[:headsep]}} \\setlength{\\marginparsep}{#{d[:marginparsep]}} \\setlength{\\marginparwidth}{#{d[:marginparwidth]}} @@ -985,10 +1000,9 @@ WOK \\usepackage[#{@tex2pdf}, #{color.strip} pdftitle={#{@txt}}, -% pdftitle={Untitled}, - pdfauthor={LM-sisu-scribe}, - pdfsubject={law}, - pdfkeywords={law}, + pdfauthor={#{@author}}, + pdfsubject={#{@subject}}, + pdfkeywords={#{@keywords}}, pageanchor=true, plainpages=true, pdfpagelabels=true, @@ -1043,12 +1057,25 @@ WOK WOK end end + def tex_head_codeblock(codeblock_box_type) + codeblock_box=if codeblock_box_type=='listings' + <<WOK +\\usepackage{listings} +\\usepackage{color} +\\usepackage{textcomp} +WOK + elsif codeblock_box_type=='boites' + "\\usepackage{boites}" + else + "\\usepackage{boites}" + end + codeblock_box + end def tex_head_misc <<WOK \\usepackage{textcomp} \\usepackage[parfill]{parskip} \\usepackage[normalem]{ulem} -\\usepackage{boites} \\usepackage{soul} \\usepackage{longtable} \\usepackage{graphicx} @@ -1059,7 +1086,7 @@ WOK % amssymb used for backslash WOK end - def document_head_with_orientation + def document_head_with_orientation(codeblock_box_type) endnotes=("\\usepackage{endnotes}" if @txt =~/endnotes?/)||'' #not implemented see also def endnotes @lang.list[@md.i18n[0]][:xlp] <<WOK @@ -1067,6 +1094,7 @@ WOK #{tex_head_encode} #{tex_head_pdftex_dvi} #{tex_head_misc} +#{tex_head_codeblock(codeblock_box_type)} \\setcounter{secnumdepth}{2} \\setcounter{tocdepth}{4} \\makeatletter @@ -1149,6 +1177,52 @@ WOK @brace_url=SiSU_Viz::Skin.new.url_decoration @tex2pdf=@@tex3pdf ||=SiSU_Env::System_call.new.tex2pdf_engine end + def xetex_code_listings(str,is='') # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list + word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ + para_array=[] + str=if word + word.each do |w| # _ - / # | : ! ^ ~ + w.gsub!(/#{Mx[:gl_o]}#lt#{Mx[:gl_c]}/,'<'); w.gsub!(/#{Mx[:gl_o]}#gt#{Mx[:gl_c]}/,'>') + w.gsub!(/[\\]?~/,'~') + w.gsub!(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,"\n") #watch + w.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~') #126 usual + w.gsub!(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX + para_array << w + end + str=para_array.join(' ') + str=str.strip unless is=='code' + str + else '' + end + str.gsub(/\s*#{Mx[:mk_o]}:name#\S+?#{Mx[:mk_c]}\s*/,' ') + str.gsub!(/.+?<-#>/,'') + str.gsub!(/#{Mx[:br_eof]}/,'') + str.gsub!(/#{Mx[:br_endnotes]}/,'') + #problem sequence -> + str.gsub!(/&(?:lt|#060);/,'<') # < SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'>') # > SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{') # { SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}') # } SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~') # ~ SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#') # # SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!') # ! SiSU not really special sisu character but done, also LaTeX + #str.gsub!(/(^|\s)\*\s/,'\1\asterisk ') # * should you wish to escape astrisk e.g. describing \*{bold}* + str.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*') # * should you wish to escape astrisk e.g. describing \*{bold}* + str.gsub!(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-') # - SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#043#{Mx[:gl_c]}/,'+') # + SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#044#{Mx[:gl_c]}/,',') # + SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'&') #unless @txt=~/<:code>/ # / SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/') # / SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\') # \ SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_') # _ SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') # | SiSU not really special sisu character but done, also LaTeX + str.gsub!(/#{Mx[:gl_o]}#058#{Mx[:gl_c]}/,':') # : SiSU not really special sisu character but done, also LaTeX + str.gsub!(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'^') # ^ SiSU not really special sisu character but done, also LaTeX + ##watch placement, problem sequence ^ + str.gsub!(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ') + str.gsub!(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript + str + end def xetex_special_characters_1(str,is='') # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list #str=Iconv.conv('ISO-8859-1', 'UTF-8', @txt) # `require': iconv will be deprecated in the future, use String#encode instead. word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ @@ -1326,6 +1400,11 @@ WOK str=xetex_special_characters_2(str,is) unless str.nil? # remove this to start with, causes issues @txt=str end + def characters_code_listings #special characters - some substitutions are sequence sensitive, rearrange with care. + str,is=@txt,@is + str=xetex_code_listings(str,is) unless str.nil? + @txt=str + end def special_characters_code str=@txt str.gsub!(/ \\\\([ #{Mx[:br_nl]}]+|$)/,' \textbackslash\textbackslash\hardspace\1') @@ -1369,7 +1448,7 @@ WOK end def header "\\lhead[ ]{ }\n" + - "\\chead[ \\fancyplain{} \\bfseries \\footnotesize \\leftmark ]{ \\fancyplain{} \\bfseries \\footnotesize \\rightmark }\n" + + "\\chead[ \\fancyplain{} \\bfseries \\footnotesize \\leftmark ]{ \\fancyplain{} \\bfseries \\footnotesize \\rightmark }\n" + "\\rhead[ ]{ }\n" end def footer @@ -1500,13 +1579,13 @@ WOK \"Support Open Standards and Software Libré for the Information Technology Infrastructure\" RA\\subsubsection*{Information on this document copy #{site}} \\addcontentsline{toc}{subsection}{Information on this document copy} {\\begin{footnotesize} -\\\\ Generated by \\href{http://www.jus.uio.no/sisu/}{SiSU} found at \\href{http://www.jus.uio.no/sisu/}{www.jus.uio.no/sisu} \\begin{tiny}[ #{v[:project]} #{v[:version]} #{v[:date_stamp]} ]\\end{tiny} \\href{http://www.sisudoc.org}{www.sisudoc.org}. SiSU is software for document structuring, publishing and search (using SiSU: object citation numbering, markup, meta-markup, and system) Copyright #{@copymark} 1997, current #{@date.year_static} Ralph Amissah, All Rights Reserved. +\\\\ Generated by \\href{http://www.jus.uio.no/sisu/}{SiSU} found at \\href{http://www.jus.uio.no/sisu/}{www.jus.uio.no/sisu} \\begin{tiny}[ #{v[:project]} #{v[:version]} #{v[:date_stamp]} ]\\end{tiny} \\href{http://www.sisudoc.org}{www.sisudoc.org}. SiSU is software for document structuring, publishing and search (using SiSU: object citation numbering, markup, meta-markup, and system) Copyright #{@copymark} 1997, current #{@date.year_static} Ralph Amissah, All Rights Reserved. \\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 3 } or later (\\href{http://www.fsf.org/licenses/gpl.html}{www.fsf.org/licenses/gpl.html}). {\\end{footnotesize} {\\begin{small} -\\\\ W3 since October 3 1993 \\href{http://www.jus.uio.no/sisu/}{#{sisu_ico}}SiSU 1997, current #{@date.year_static}. \\\\ #{sitename} presentations at \\begin{scriptsize}#{site}\\end{scriptsize} \\\\ \\\\ #{@md.title.full} \\textbf{pdf} versions can be found at: \\\\ +\\\\ W3 since October 3 1993 \\href{http://www.jus.uio.no/sisu/}{#{sisu_ico}}SiSU 1997, current #{@date.year_static}. \\\\ #{sitename} presentations at \\begin{scriptsize}#{site}\\end{scriptsize} \\\\ \\\\ #{@md.title.full} \\textbf{pdf} versions can be found at: \\\\ {\\end{small} -\\\\ #{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_p]}}\\end{scriptsize}#{@brace_url.tex_close} \\\\ -#{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_l]}}\\end{scriptsize}#{@brace_url.tex_close} \\\\ +\\\\ #{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_p]}}\\end{scriptsize}#{@brace_url.tex_close} \\\\ +#{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_l]}}\\end{scriptsize}#{@brace_url.tex_close} \\\\ \\\\\n#{@md.title.full} \\textbf{html} versions may be found at: \\\\ #{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:toc]}}\\end{scriptsize}#{@brace_url.tex_close} or \\\\ #{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:doc]}}\\end{scriptsize}#{@brace_url.tex_close} diff --git a/man/man1/sisu.1 b/man/man1/sisu.1 index 9a3e5535..1d4d280b 100644 --- a/man/man1/sisu.1 +++ b/man/man1/sisu.1 @@ -1,4 +1,4 @@ -.TH "sisu" "1" "2011-10-03" "3.1.0" "SiSU" +.TH "sisu" "1" "2011-12-08" "3.1.7" "SiSU" .br .SH NAME .br @@ -221,13 +221,22 @@ be with colour, if sisurc colour default is set to 'false' or is undefined screen output will be without colour). Alias \-c .TP +.B \-\-configure +configure/initialise shared output directory files initialize shared output +directory (config files such as css and dtd files are not updated if they +already exist unless modifier is used). The equivalent of: \-C \-\-init\-site +configure/initialise site, more extensive than \-C on its own, shared output +directory files/force update, existing shared output config files such as css +and dtd files are updated if \-CC is used. + +.TP .B \-\-concordance [filename/wildcard] produces concordance (wordmap) a rudimentary index of all the words in a document. (Concordance files are not generated for documents of over 260,000 words unless this limit is increased in the file sisurc.yml). Alias \-w .TP -.B \-C [\-\-init\-site] +.B \-C configure/initialise shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used). \-C \-\-init\-site configure/initialise @@ -237,12 +246,7 @@ updated if this modifier is used. .TP .B \-CC -configure/initialise shared output directory files initialize shared output -directory (config files such as css and dtd files are not updated if they -already exist unless modifier is used). The equivalent of: \-C \-\-init\-site -configure/initialise site, more extensive than \-C on its own, shared output -directory files/force update, existing shared output config files such as css -and dtd files are updated if \-CC is used. +see \-\-configure .TP .B \-c [filename/wildcard] @@ -1520,7 +1524,7 @@ An escaped url without decoration .nf normal text _http://www.sisudoc.org/ continues - deb http://www.jus.uio.no/sisu/archive unstable main non\-free + deb _http://www.jus.uio.no/sisu/archive unstable main non\-free .fi .br @@ -1597,6 +1601,14 @@ about SiSU <http://www.sisudoc.org/> [^14] markup {~^ ruby_logo.png "Ruby" }http://www.ruby\-lang.org/en/ .br .br +.B markup example: + +.nf + { tux.png 64x80 }image + % various url linked images + {tux.png 64x80 "a better way" }http://www.sisudoc.org/ + {GnuDebianLinuxRubyBetterWay.png 100x101 "Way Better \- with Gnu/Linux, Debian and Ruby" }http://www.sisudoc.org/ + {~^ ruby_logo.png "Ruby" }http://www.ruby\-lang.org/en/ .fi .br @@ -1677,7 +1689,7 @@ information in each column 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 - \e* Contributed at least ten times; \e** at least 5 times in last month; \e*\e** more than 100 times in last month. + * Contributed at least ten times; ** at least 5 times in last month; *** more than 100 times in last month. .fi .br @@ -2223,7 +2235,7 @@ main term heading from each other by a pipe symbol. .nf Paragraph containing main term, second term and sub\-term. - ={Main term:sub\-term+1|second sub\-term + ={Main term:sub\-term+1|second sub\-term} A paragraph that continues discussion of the first sub\-term .fi @@ -3076,6 +3088,35 @@ Its selection is configured in sisurc.yml .br output_dir_structure_by: language +.nf + |\-\- en + |\-\- epub + |\-\- hashes + |\-\- html + | |\-\- viral_spiral.david_bollier + | |\-\- manifest + | |\-\- qrcode + | |\-\- odt + | |\-\- pdf + | |\-\- sitemaps + | |\-\- txt + | |\-\- xhtml + | `\-\- xml + |\-\- po4a + | `\-\- live\-manual + | |\-\- po + | |\-\- fr + | `\-\- pot + `\-\- _sisu + |\-\- css + |\-\- image + |\-\- image_sys \-> \../../_sisu/image_sys + `\-\- xml + |\-\- rnc + |\-\- rng + `\-\- xsd +.fi + .br #by: language subject_dir/en/manifest/filename.html @@ -3092,6 +3133,34 @@ Its selection is configured in sisurc.yml .br output_dir_structure_by: filetype +.nf + |\-\- epub + |\-\- hashes + |\-\- html + |\-\- viral_spiral.david_bollier + |\-\- manifest + |\-\- qrcode + |\-\- odt + |\-\- pdf + |\-\- po4a + |\-\- live\-manual + | |\-\- po + | |\-\- fr + | `\-\- pot + |\-\- _sisu + | |\-\- css + | |\-\- image + | |\-\- image_sys \-> \../../_sisu/image_sys + | `\-\- xml + | |\-\- rnc + | |\-\- rng + | `\-\- xsd + |\-\- sitemaps + |\-\- txt + |\-\- xhtml + `\-\- xml +.fi + .br #by: filetype subject_dir/html/filename/manifest.en.html @@ -3107,6 +3176,27 @@ Its selection is configured in sisurc.yml .br output_dir_structure_by: filename +.nf + |\-\- epub + |\-\- po4a + |\-\- live\-manual + | |\-\- po + | |\-\- fr + | `\-\- pot + |\-\- _sisu + | |\-\- css + | |\-\- image + | |\-\- image_sys \-> \../../_sisu/image_sys + | `\-\- xml + | |\-\- rnc + | |\-\- rng + | `\-\- xsd + |\-\- sitemaps + |\-\- src + |\-\- pod + `\-\- viral_spiral.david_bollier +.fi + .br #by: filename subject_dir/filename/manifest.en.html |