aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG_v229
-rw-r--r--conf/sisu/v2/sisurc.yml4
-rw-r--r--conf/sisu/v2/version.yml6
-rw-r--r--data/doc/sisu/v2/CHANGELOG29
-rw-r--r--data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi22
-rw-r--r--data/sisu/v2/conf/editor-syntax-etc/vim/syntax/sisu.vim4
-rw-r--r--lib/sisu/v2/constants.rb2
-rw-r--r--lib/sisu/v2/css.rb1
-rw-r--r--lib/sisu/v2/dal_syntax.rb83
-rw-r--r--lib/sisu/v2/odf_format.rb1
-rw-r--r--lib/sisu/v2/param.rb33
-rw-r--r--lib/sisu/v2/sysenv.rb14
-rw-r--r--lib/sisu/v2/texpdf_format.rb19
-rw-r--r--lib/sisu/v2/xhtml_table.rb2
-rw-r--r--lib/sisu/v2/xml_tables.rb8
15 files changed, 170 insertions, 87 deletions
diff --git a/CHANGELOG_v2 b/CHANGELOG_v2
index ec38ba0f..c7962297 100644
--- a/CHANGELOG_v2
+++ b/CHANGELOG_v2
@@ -12,11 +12,34 @@ Reverse Chronological:
%% Development branch UNSTABLE
+%% 2.5.0.orig.tar.gz (2010-06-11:23/5)
+http://www.jus.uio.no/sisu/pkg/src/sisu_2.5.0.orig.tar.gz
+ sisu_2.5.0.orig.tar.gz
+ sisu_2.5.0-1.dsc
+ sisu_2.5.0-1.diff.gz
+
+ * texpdf, font selection permitted in sisurc.yml (default: texpdf_font:) or
+ document header (@make: :texpdf_font:)
+
+ NOTE: this is a small addition, but texpdf requires that Liberation fonts be
+ installed as 'Liberation Sans' is now the default, and thus can cause
+ breakage unless this is installed, hence the version bump. This is taken care
+ of in the debian package by depending on ttf-liberation
+
+ * vim syntax (sisu.vim) updated to match @make: :texpdf_font:
+
+ * param, fix breakage on malformed sisu identifier (top header line)
+
+ * tables: blank lines (use tilde to indicate); allow line breaks
+
+ * css for html, make right pane when used darker to distinguish from selected
+ content
+
%% 2.4.3.orig.tar.gz (2010-06-05:22/6)
http://www.jus.uio.no/sisu/pkg/src/sisu_2.4.3.orig.tar.gz
- sisu_2.4.3.orig.tar.gz
- sisu_2.4.3-1.dsc
- sisu_2.4.3-1.diff.gz
+ bf0e596113b60b873efc738ec2a9ab9a7b2d0687cd7011d27700331faab4e2c5 2767084 sisu_2.4.3.orig.tar.gz
+ 01784bc068f91858534f157a024d4ca723e4afb0161c50cf3a42ab0cbaeef889 1145 sisu_2.4.3-1.dsc
+ 00f039ec6fd246b2320565003ecd4ab255c28d4a9f43deb62170e10e6a3630e6 276235 sisu_2.4.3-1.diff.gz
* vim/ftplugin/sisu.vim make less intrusive (both for sisu v2 & v1), includes
the following:
diff --git a/conf/sisu/v2/sisurc.yml b/conf/sisu/v2/sisurc.yml
index d4b1503d..8b1c71e6 100644
--- a/conf/sisu/v2/sisurc.yml
+++ b/conf/sisu/v2/sisurc.yml
@@ -55,6 +55,7 @@ flag:
#% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal
default:
papersize: 'A4,letter'
+ #texpdf_font: 'Liberation Serif' # 'Liberation Sans' 'Liberation Serif'
#text_wrap: 78
#emphasis: 'bold' #make *{emphasis}* 'bold', 'italics' or 'underscore', default if not configured is 'bold'
#digest: 'sha' #sha is sha256, default is md5
@@ -107,7 +108,8 @@ program_set:
# editor: 'gvim -c :R -c :S'
# pdf_viewer: 'evince'
# web_browser: 'firefox' #'iceweasel' #'epiphany' #'galeon' #'konqueror' #'kazehakase'
-# console_www_browser: 'links2' #'elinks'
+# console_www_browser: 'links2' #'elinks' #'w3m' #'lynx' #'links'
+# epub_viewer: 'ebook-viewer' #'calibre' #'okular' #'fbreader'
# odf_viewer: 'oowriter' #'abiword'
# xml_viewer: 'xml-viewer'
# man: 'nroff -man' #'groff -man -Tascii' # 'nroff -man'
diff --git a/conf/sisu/v2/version.yml b/conf/sisu/v2/version.yml
index 8446c9e5..0b5ed396 100644
--- a/conf/sisu/v2/version.yml
+++ b/conf/sisu/v2/version.yml
@@ -1,5 +1,5 @@
---
-:version: 2.4.3
-:date_stamp: 2010w22/6
-:date: "2010-06-05"
+:version: 2.5.0
+:date_stamp: 2010w23/5
+:date: "2010-06-11"
:project: SiSU
diff --git a/data/doc/sisu/v2/CHANGELOG b/data/doc/sisu/v2/CHANGELOG
index 8e272e77..489572c4 100644
--- a/data/doc/sisu/v2/CHANGELOG
+++ b/data/doc/sisu/v2/CHANGELOG
@@ -12,11 +12,34 @@ Reverse Chronological:
%% Development branch UNSTABLE
+%% 2.5.0.orig.tar.gz (2010-06-11:23/5)
+http://www.jus.uio.no/sisu/pkg/src/sisu_2.5.0.orig.tar.gz
+ sisu_2.5.0.orig.tar.gz
+ sisu_2.5.0-1.dsc
+ sisu_2.5.0-1.diff.gz
+
+ * texpdf, font selection permitted in sisurc.yml (default: texpdf_font:) or
+ document header (@make: :texpdf_font:)
+
+ NOTE: this is a small addition, but texpdf requires that Liberation fonts be
+ installed as 'Liberation Sans' is now the default, and thus can cause
+ breakage unless this is installed, hence the version bump. This is taken care
+ of in the debian package by depending on ttf-liberation
+
+ * vim syntax (sisu.vim) updated to match @make: :texpdf_font:
+
+ * param, fix breakage on malformed sisu identifier (top header line)
+
+ * tables: blank lines (use tilde to indicate); allow line breaks
+
+ * css for html, make right pane when used darker to distinguish from selected
+ content
+
%% 2.4.3.orig.tar.gz (2010-06-05:22/6)
http://www.jus.uio.no/sisu/pkg/src/sisu_2.4.3.orig.tar.gz
- sisu_2.4.3.orig.tar.gz
- sisu_2.4.3-1.dsc
- sisu_2.4.3-1.diff.gz
+ bf0e596113b60b873efc738ec2a9ab9a7b2d0687cd7011d27700331faab4e2c5 2767084 sisu_2.4.3.orig.tar.gz
+ 01784bc068f91858534f157a024d4ca723e4afb0161c50cf3a42ab0cbaeef889 1145 sisu_2.4.3-1.dsc
+ 00f039ec6fd246b2320565003ecd4ab255c28d4a9f43deb62170e10e6a3630e6 276235 sisu_2.4.3-1.diff.gz
* vim/ftplugin/sisu.vim make less intrusive (both for sisu v2 & v1), includes
the following:
diff --git a/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi b/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi
index bb0558d2..c2186adc 100644
--- a/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi
+++ b/data/doc/sisu/v2/sisu_markup_samples/sisu_manual/sisu_download.ssi
@@ -16,7 +16,7 @@
:issued: 2002-11-12
:available: 2002-11-12
:published: 2009-01-18
- :modified: 2010-06-01
+ :modified: 2010-06-11
@make:
:num_top: 1
@@ -55,7 +55,7 @@
3~source- Source (tarball tar.gz)
-_* {~^ sisu_2.4.3.orig.tar.gz (2010-06-05:22/3) }http://www.jus.uio.no/sisu/pkg/src/sisu_2.4.3.orig.tar.gz
+_* {~^ sisu_2.5.0.orig.tar.gz (2010-06-11:23/5) }http://www.jus.uio.no/sisu/pkg/src/sisu_2.5.0.orig.tar.gz
_* {~^ sisu-markup-samples_2.0.3.orig.tar.gz (of 2010-05-01:17/6 ) }http://www.jus.uio.no/sisu/pkg/src/sisu-markup-samples_2.0.3.orig.tar.gz *~sisu-markup-samples
@@ -102,11 +102,11 @@ group{
*{Source}*
-{~^ sisu_2.4.3.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.4.3.orig.tar.gz
+{~^ sisu_2.5.0.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.5.0.orig.tar.gz
-{~^ sisu_2.4.3-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.4.3-1.diff.gz
+{~^ sisu_2.5.0-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_2.5.0-1.diff.gz
-{~^ sisu_2.4.3-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_2.4.3-1.dsc
+{~^ sisu_2.5.0-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_2.5.0-1.dsc
}group
@@ -114,15 +114,15 @@ group{
*{Debs}*
-{~^ sisu_2.4.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_2.4.3-1_all.deb ~{ <br>sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies <br>Depends: ruby (>=1.8.2), libwebrick-ruby<br>Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~
+{~^ sisu_2.5.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_2.5.0-1_all.deb ~{ <br>sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies <br>Depends: ruby (>=1.8.2), libwebrick-ruby<br>Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~
-{~^ sisu-complete_2.4.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_2.4.3-1_all.deb ~{ <br>a package that pulls in other packages to build the whole of sisu (excluding sisu-examples) <br>Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu<br>Recommends: sisu-examples }~
+{~^ sisu-complete_2.5.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_2.5.0-1_all.deb ~{ <br>a package that pulls in other packages to build the whole of sisu (excluding sisu-examples) <br>Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu<br>Recommends: sisu-examples }~
-{~^ sisu-pdf_2.4.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_2.4.3-1_all.deb ~{ <br>dependencies used by sisu to produce pdf from LaTeX generated <br>Depends: sisu, tetex-bin, tetex-extra, latex-ucs<br>Suggests: evince, xpdf }~
+{~^ sisu-pdf_2.5.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_2.5.0-1_all.deb ~{ <br>dependencies used by sisu to produce pdf from LaTeX generated <br>Depends: sisu, tetex-bin, tetex-extra, latex-ucs<br>Suggests: evince, xpdf }~
-{~^ sisu-postgresql_2.4.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_2.4.3-1_all.deb ~{ <br>dependencies used by sisu to populate postgresql database (further configuration is necessary) <br>Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby<br>Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~
+{~^ sisu-postgresql_2.5.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_2.5.0-1_all.deb ~{ <br>dependencies used by sisu to populate postgresql database (further configuration is necessary) <br>Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby<br>Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~
-{~^ sisu-sqlite_2.4.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_2.4.3-1_all.deb ~{ <br>dependencies used by sisu to populate sqlite database <br>Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby<br>Suggests: libdbd-sqlite }~
+{~^ sisu-sqlite_2.5.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_2.5.0-1_all.deb ~{ <br>dependencies used by sisu to populate sqlite database <br>Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby<br>Suggests: libdbd-sqlite }~
}group
@@ -152,7 +152,7 @@ The RPM is generated from the source file using Alien.~{ http://www.kitenet.net/
sudo rpm -i [package name]
-_* {~^ sisu-2.4.3-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-2.4.3-2.noarch.rpm ~{ <br>created using alien }~
+_* {~^ sisu-2.5.0-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-2.5.0-2.noarch.rpm ~{ <br>created using alien }~
_* {~^ sisu-markup-samples_2.0.3.orig-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-markup-samples_2.0.3.orig-2.noarch.rpm ~{ <br> http://www.jus.uio.no/sisu/archive/pool/non-free/s/sisu-markup-samples/sisu-markup-samples_2.0.3-1_all.deb <br> created using: alien -r sisu_0.70.5-1_all.deb }~
diff --git a/data/sisu/v2/conf/editor-syntax-etc/vim/syntax/sisu.vim b/data/sisu/v2/conf/editor-syntax-etc/vim/syntax/sisu.vim
index c0d30b89..cba13164 100644
--- a/data/sisu/v2/conf/editor-syntax-etc/vim/syntax/sisu.vim
+++ b/data/sisu/v2/conf/editor-syntax-etc/vim/syntax/sisu.vim
@@ -1,6 +1,6 @@
"SiSU Vim syntax file
"SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
-"SiSU Markup: SiSU (sisu-2.3.6, 2010-05-24)
+"SiSU Markup: SiSU (sisu-2.5.0, 2010-06-11)
"(originally looked at Ruby Vim by Mirko Nasato)
if version < 600
@@ -34,7 +34,7 @@ if !exists("sisu_no_identifiers")
syn match sisu_sub_header_classify "^\s\+:\(topic_register\|coverage\|format\|identifier\|keywords\|relation\|subject\|type\|dewey\|loc\|oclc\|pg\|isbn\):\s"
syn match sisu_sub_header_dates "^\s\+:\(added_to_site\|available\|created\|issued\|modified\|published\|valid\|translated\|original_publication\):\s"
syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|language_char\|institution\|nationality\|source\):\s"
- syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|italics\|bold\|emphasis\|plaintext_wrap\|skin\|stamp\|promo\|ad\|manpage\):\s"
+ syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|italics\|bold\|emphasis\|plaintext_wrap\|texpdf_font\|skin\|stamp\|promo\|ad\|manpage\):\s"
syn match sisu_sub_header_notes "^\s\+:\(abstract\comment\|description\|history\|prefix\|prefix_[ab]\|suffix\):\s"
syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]"
syn match sisu_sem_marker_block "\([a-z][a-z._]*\|\):{\|}:[a-z._]*[a-z]"
diff --git a/lib/sisu/v2/constants.rb b/lib/sisu/v2/constants.rb
index 7fc3b056..9eec8370 100644
--- a/lib/sisu/v2/constants.rb
+++ b/lib/sisu/v2/constants.rb
@@ -110,7 +110,7 @@ Rx[:lv],Rx[:lv_1],Rx[:lv_2],Rx[:lv_3],Rx[:lv_4],Rx[:lv_5],Rx[:lv_6],Rx[:lv_7],Rx
Rx[:meta]=/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}/
Dx[:url_o]='‹'; Dx[:url_c]='›'
Dx[:url_o_xml]='&lt;'; Dx[:url_c_xml]='&gt;'
-Dx[:rel_o]='‹'; Dx[:rel_c]='›'
+Dx[:rel_o]='‹'; Dx[:rel_c]='›' # Dx[:rel_o]='「'; Dx[:rel_c]='」'
Tex[:backslash]="\\\\"
Tex[:backslash]="\\\\"
Tex[:tilde]='\\\\\\~'
diff --git a/lib/sisu/v2/css.rb b/lib/sisu/v2/css.rb
index e187d24a..f088c44e 100644
--- a/lib/sisu/v2/css.rb
+++ b/lib/sisu/v2/css.rb
@@ -329,6 +329,7 @@ WOK
right: 0px;
margin-left: 75%;
width: 20%;
+ background-color: #aaaaaa;
}
.norm, .bold, .verse, .group, .alt {
diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb
index 0b7c6541..5e04730f 100644
--- a/lib/sisu/v2/dal_syntax.rb
+++ b/lib/sisu/v2/dal_syntax.rb
@@ -234,9 +234,51 @@ module SiSU_Syntax
end
dob
end
+ def fontface(dob)
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)\*\{(.+?)\}\*/,
+ "\\1#{@emph[:o]}\\2#{@emph[:c]}") #emphasis
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)!\{(.+?)\}!/,
+ "\\1#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]}") #bold
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\(|\>)\/\{(.+?)\}\//,
+ "\\1#{Mx[:fa_italics_o]}\\2#{Mx[:fa_italics_c]}") #italics
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)_\{(.+?)\}_/,
+ "\\1#{Mx[:fa_underscore_o]}\\2#{Mx[:fa_underscore_c]}") #underscore
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\"\{(.+?)\}\"/,
+ "\\1#{Mx[:fa_cite_o]}\\2#{Mx[:fa_c_o]}cite#{Mx[:fa_c]}") #cite /blockquote?
+ dob.obj.gsub!(/(^|[^\\])\^\{(.+?)\}\^/,
+ "\\1#{Mx[:fa_superscript_o]}\\2#{Mx[:fa_superscript_c]}") #superscript
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|\(|\>|\S)9\{(.+?)\}9/,
+ "\\1#{Mx[:fa_superscript_o]}\\2#{Mx[:fa_superscript_c]}") #superscript
+ dob.obj.gsub!(/(^|[^\\]),\{(.+?)\},/,
+ "\\1#{Mx[:fa_subscript_o]}\\2#{Mx[:fa_subscript_c]}") #subscript
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)6\{(.+?)\}6/,
+ "\\1#{Mx[:fa_subscript_o]}\\2#{Mx[:fa_subscript_c]}") #subscript
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\+\{(.+?)\}\+/,
+ "\\1#{Mx[:fa_insert_o]}\\2#{Mx[:fa_insert_c]}") #inserted text
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)v\{(.+?)\}v/,
+ "\\1#{Mx[:fa_insert_o]}\\2#{Mx[:fa_insert_c]}") #inserted text
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)-\{(.+?)\}-/,
+ "\\1#{Mx[:fa_strike_o]}\\2#{Mx[:fa_strike_c]}") #strikethrough - deleted text
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)x\{(.+?)\}x/,
+ "\\1#{Mx[:fa_strike_o]}\\2#{Mx[:fa_strike_c]}") #deleted text
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\*(\S+?)\*/,
+ "\\1#{@emph[:o]}\\2#{@emph[:c]}") #emphasise single word, watch
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\!(\S+?)\!/,
+ "\\1#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]}") #bold single word, watch
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\/([\(\)a-zA-Z0-9']+?)\/([^a-zA-Z0-9]|[ ,.;:'"~$]|$)/,
+ "\\1#{Mx[:fa_italics_o]}\\2#{Mx[:fa_italics_c]}\\3") #italics single word, watch
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)_(\S+?)_([.,!'")]?(?:\s|$))/,
+ "\\1#{Mx[:fa_underscore_o]}\\2#{Mx[:fa_underscore_c]}\\3") #underscore single word, watch (made more complicated by url decoration escape tag (_url))
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+)-([^{]\S+?)-( |$)/,
+ "\\1#{Mx[:fa_strike_o]}\\2#{Mx[:fa_strike_c]}\\3") #underscore single word, watch
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>|\d+)\^(\S+?)\^/,
+ "\\1#{Mx[:fa_superscript_o]}\\2#{Mx[:fa_superscript_c]}") #superscript single word, watch digit added
+ dob
+ end
def bodymarkup(dob)
# << http://www.jus.uio.no/sisu/sisu_markup_table/markup >>
# See: data/sisu/sample/document_samples_sisu_markup/
+ ## fontface
# *{emphasis}* e{emphasis}e <strong>emphasis</strong>
# !{bold text}! b{bold}b <b>bold text</b>
# _{underline}_ u{underline}u <u>underline</u>
@@ -246,6 +288,7 @@ module SiSU_Syntax
# ,{subscript}, <sub>subscript</sub>
# +{inserted text}+ <ins>inserted text</ins>
# -{deleted text}- <del>deleted text</del>
+ #
# {url address}:url
# {image.png}imageurl
# {image.png}png
@@ -350,44 +393,7 @@ module SiSU_Syntax
%{\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3})
end
dob.obj.gsub!(/<:?p([nb])>/,"#{Mx[:fa_o]}p\\1#{Mx[:fa_c]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ')
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)\*\{(.+?)\}\*/,
- "\\1#{@emph[:o]}\\2#{@emph[:c]}") #emphasis
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)!\{(.+?)\}!/,
- "\\1#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]}") #bold
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\(|\>)\/\{(.+?)\}\//,
- "\\1#{Mx[:fa_italics_o]}\\2#{Mx[:fa_italics_c]}") #italics
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)_\{(.+?)\}_/,
- "\\1#{Mx[:fa_underscore_o]}\\2#{Mx[:fa_underscore_c]}") #underscore
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\"\{(.+?)\}\"/,
- "\\1#{Mx[:fa_cite_o]}\\2#{Mx[:fa_c_o]}cite#{Mx[:fa_c]}") #cite /blockquote?
- dob.obj.gsub!(/(^|[^\\])\^\{(.+?)\}\^/,
- "\\1#{Mx[:fa_superscript_o]}\\2#{Mx[:fa_superscript_c]}") #superscript
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|\(|\>|\S)9\{(.+?)\}9/,
- "\\1#{Mx[:fa_superscript_o]}\\2#{Mx[:fa_superscript_c]}") #superscript
- dob.obj.gsub!(/(^|[^\\]),\{(.+?)\},/,
- "\\1#{Mx[:fa_subscript_o]}\\2#{Mx[:fa_subscript_c]}") #subscript
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)6\{(.+?)\}6/,
- "\\1#{Mx[:fa_subscript_o]}\\2#{Mx[:fa_subscript_c]}") #subscript
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\+\{(.+?)\}\+/,
- "\\1#{Mx[:fa_insert_o]}\\2#{Mx[:fa_insert_c]}") #inserted text
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)v\{(.+?)\}v/,
- "\\1#{Mx[:fa_insert_o]}\\2#{Mx[:fa_insert_c]}") #inserted text
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)-\{(.+?)\}-/,
- "\\1#{Mx[:fa_strike_o]}\\2#{Mx[:fa_strike_c]}") #strikethrough - deleted text
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)x\{(.+?)\}x/,
- "\\1#{Mx[:fa_strike_o]}\\2#{Mx[:fa_strike_c]}") #deleted text
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\*(\S+?)\*/,
- "\\1#{@emph[:o]}\\2#{@emph[:c]}") #emphasise single word, watch
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\!(\S+?)\!/,
- "\\1#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]}") #bold single word, watch
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\/([\(\)a-zA-Z0-9']+?)\/([^a-zA-Z0-9]|[ ,.;:'"~$]|$)/,
- "\\1#{Mx[:fa_italics_o]}\\2#{Mx[:fa_italics_c]}\\3") #italics single word, watch
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)_(\S+?)_([.,!'")]?(?:\s|$))/,
- "\\1#{Mx[:fa_underscore_o]}\\2#{Mx[:fa_underscore_c]}\\3") #underscore single word, watch (made more complicated by url decoration escape tag (_url))
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+)-([^{]\S+?)-( |$)/,
- "\\1#{Mx[:fa_strike_o]}\\2#{Mx[:fa_strike_c]}\\3") #underscore single word, watch
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>|\d+)\^(\S+?)\^/,
- "\\1#{Mx[:fa_superscript_o]}\\2#{Mx[:fa_superscript_c]}") #superscript single word, watch digit added
+ dob=fontface(dob)
dob.obj.gsub!(/<[:e]\s+(.+?)!?>/,
"#{Mx[:en_a_o]}\\1#{Mx[:en_a_c]}") #not tested
dob.obj.gsub!(/^\s*_\*\s*/,
@@ -417,6 +423,7 @@ module SiSU_Syntax
dob.obj.gsub!(/\{\s*(.+?)\s*\}(image)/,
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #linked image
elsif dob.is=='table'
+ dob=fontface(dob)
elsif dob.is =='code' # /^<:code>/ #should be enough # underscore used as escape for angle brackets
dob.obj.gsub!(/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*/,'@\1: ')
dob.obj.gsub!(/([<>])/,'_\1')
diff --git a/lib/sisu/v2/odf_format.rb b/lib/sisu/v2/odf_format.rb
index f0163f81..384b46b7 100644
--- a/lib/sisu/v2/odf_format.rb
+++ b/lib/sisu/v2/odf_format.rb
@@ -147,6 +147,7 @@ module SiSU_ODF_format
'Table_20_Heading'
else 'P7'
end
+ str.gsub!(/^~$/,'') # tilde / empty cell
%{<table:table-cell office:value-type="string">#{@br}} +
%{<text:p text:style-name="#{txt_name_cell}">#{@br}} +
%{#{str}} +
diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb
index fbc4ccde..98478626 100644
--- a/lib/sisu/v2/param.rb
+++ b/lib/sisu/v2/param.rb
@@ -148,8 +148,8 @@ module SiSU_Param
end
end
class Md
- def initialize(str,opt)
- @s,@opt=str,opt
+ def initialize(str,opt,env)
+ @s,@opt,@env=str,opt,env
end
def validate_length(s,l,n)
#s=(s.length <= l) ? s : nil
@@ -668,6 +668,11 @@ module SiSU_Param
else nil
end
end
+ def texpdf_font
+ @h['texpdf_font'] && (@h['texpdf_font']=~/\S{3,}/) \
+ ? @h['texpdf_font'] \
+ : @env.font.texpdf
+ end
def skin
@h['skin']
end
@@ -868,8 +873,8 @@ module SiSU_Param
fns_array=@data.dup
skip unless fns_array # consider
@markup_version=SiSU_Markup_type::Markup_identify.new(fns_array,@opt).markup_version? #% determine markup version
- if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?[\d.]*|sisu-[\d.]+)$/ #check markup and markup version
- if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)[\d.]+$/ #check markup and markup version
+ if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?[\d.]*|sisu-[\d.]+)$/ #check markup and markup version
+ if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)(?:[0-9]+)?(?:\.[0-9]+)?(?:\.[0-9]+)?$/ #check markup and markup version
@markup_version_declared=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([\d.]+)$/)[1]
sm_a,sm_b,sm_c=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3]
sm_c ||=0
@@ -922,23 +927,23 @@ module SiSU_Param
case para
when /^@ocn:\s+(.+?)$/m; @ocn=$1 #% processing
when /^@title:(.+)/m #% metainfo DC
- @title=Md.new($1.strip,@opt).title
+ @title=Md.new($1.strip,@opt,@env).title
when /^@creator:(.+)/m #% metainfo DC
- @creator=Md.new($1.strip,@opt).creator
+ @creator=Md.new($1.strip,@opt,@env).creator
@authorship=@author=@creator.author
@authors=@creator.author_detail
when /^@classify:(.+)/m; classify=$1
- @classify=Md.new($1.strip,@opt).classify
+ @classify=Md.new($1.strip,@opt,@env).classify
when /^@publisher:\s+(.+)/m
- @publisher=Md.new($1.strip,@opt).current_publisher
+ @publisher=Md.new($1.strip,@opt,@env).current_publisher
when /^@original:(.+)/m
- @original=Md.new($1.strip,@opt).original
+ @original=Md.new($1.strip,@opt,@env).original
@source=@original.source
when /^@writing_focus[:.]nationality:\s+(.+?)$/; @writing_focus=$1 # e.g. Finland (where and article on Finnish law)
when /^@date:(.+)/m #% metainfo DC
- @date=Md.new($1.strip,@opt).date
+ @date=Md.new($1.strip,@opt,@env).date
when /^@rights:(.+)/m; #@rights=$1.gsub(/<(?:\/\s*)?br(?:\s*\/)?>/,Mx[:br_line]) #% metainfo DC copyright, public domain, copyleft, creative commons, etc.
- @rights=Md.new($1.strip,@opt).rights
+ @rights=Md.new($1.strip,@opt,@env).rights
when /^@papersize:\s+(.+?)$/m #% metainfo DC
l=$1
if @mod.inspect !~/--papersize[=-]\S+/
@@ -946,7 +951,7 @@ module SiSU_Param
@papersize=l
end
when /^@make:(.+)/m #% metainfo DC
- @make=Md.new($1.strip,@opt).make
+ @make=Md.new($1.strip,@opt,@env).make
if defined? @make.breaks \
and @make.breaks[:page_new] #clearpage
@pagenew=@make.breaks[:page_new]
@@ -978,7 +983,7 @@ module SiSU_Param
@man_section=(defined? @make.manpage.section) ? @make.manpage.section : 1
end
when /^@links:\s+(.+?)\Z/m #% processing
- doc_links=Md.new($1.strip,@opt).links
+ doc_links=Md.new($1.strip,@opt,@env).links
count=1
@lnk=[]
doc_links.each do |doc_link|
@@ -989,7 +994,7 @@ module SiSU_Param
end
end
when /^@notes?:\s(.+)/ #% metainfo
- Md.new($1.strip,@opt).notes
+ Md.new($1.strip,@opt,@env).notes
when /^@base_program:\s+(.+?)$/; @base_program=$1 #% processing
end
@lv1 ||=/^1~/
diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb
index 4daccbcd..8a9e38be 100644
--- a/lib/sisu/v2/sysenv.rb
+++ b/lib/sisu/v2/sysenv.rb
@@ -1265,6 +1265,14 @@ WOK
end
end
end
+ def font
+ def texpdf
+ (defined? @rc['default']['texpdf_font']) \
+ ? @rc['default']['texpdf_font'] \
+ : 'Liberation Sans' #'Liberation Sans' #'Liberation Serif'
+ end
+ self
+ end
def path #dir
def home
@sys.home
@@ -1329,9 +1337,9 @@ WOK
@yamlrc_dir
end
def man #check use
- if defined? @rc['webserv']['man']; "#{webserv}/#{@rc['webserv']['man']}"
- else defaults[:webserv_man]
- end
+ (defined? @rc['webserv']['man']) \
+ ? "#{webserv}/#{@rc['webserv']['man']}" \
+ : defaults[:webserv_man]
end
def webserv_path #testing, check need, remove
webserv
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index b53864ec..e756aa03 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -107,6 +107,19 @@ module SiSU_TeX_Pdf
def ocn_display(dob)
"\\begin{tiny}\\hspace{0mm}\\end{tiny}{\\marginpar{\\begin{tiny}\\hspace{0mm}\\hypertarget{#{dob.ocn}}{#{dob.ocn}}\\end{tiny}}}" #ocn object citation numbering
end
+ def table_special_characters(r)
+ r.gsub!(/#{Mx[:tc_p]}|$/u,'&')
+ r.gsub!(/%/,'\%')
+ r.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'\begin{bfseries}\1 \end{bfseries}')
+ r.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'\emph{\1}')
+ r.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'\uline{\1}') # ulem
+ r.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,"``\\1''") # quote #CHECK
+ r.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'\uline{\1}') # ulem
+ r.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'\sout{\1}') # ulem
+ r.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,"\$^{\\textrm{\\1}}\$")
+ r.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,"\$_{\\textrm{\\1}}\$")
+ r
+ end
def longtable_landscape
end_table='\end{longtable}'
row_break='\\\\\\'
@@ -137,7 +150,7 @@ module SiSU_TeX_Pdf
rows[0].gsub!(/&\s*$/," #{row_break} \\hline\\endhead #{row_break}")
end
rows.each do |r|
- r.gsub!(/#{Mx[:tc_p]}|$/,'&')
+ r=table_special_characters(r)
r.gsub!(/$/," #{row_break}\n") unless r =~/#{row_break*2}$/
if r=~/\<!f(.+?)!\>/ # not tested table footer if any
tablefoot=$1
@@ -180,7 +193,7 @@ module SiSU_TeX_Pdf
rows[0].gsub!(/&\s*$/," #{row_break} \\hline\\endhead #{row_break}")
end
rows.each do |r|
- r.gsub!(/#{Mx[:tc_p]}|$/u,'&')
+ r=table_special_characters(r)
r.gsub!(/$/," #{row_break}\n") unless r =~/#{row_break*2}$/
if r=~/\<!f(.+?)!\>/ # not tested table footer if any
tablefoot=$1
@@ -635,6 +648,7 @@ module SiSU_TeX_Pdf
\\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode}
\\setmainlanguage{#{tex_head_lang}}
\\setotherlanguage{english}
+\\setmainfont{#{@md.make.texpdf_font}}
WOK
when /pdf/
if @md.file_encoding =~ /iso-?8859/i #% iso8859
@@ -941,6 +955,7 @@ WOK
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!(/[\\]?~/,'<=tilde>')
w.gsub!(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline ') #watch
w.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>') #126 usual
diff --git a/lib/sisu/v2/xhtml_table.rb b/lib/sisu/v2/xhtml_table.rb
index 2b0cb5e7..25db60c8 100644
--- a/lib/sisu/v2/xhtml_table.rb
+++ b/lib/sisu/v2/xhtml_table.rb
@@ -78,6 +78,8 @@ module SiSU_XHTML_table
table_row_with_columns=table_row.split(Mx[:tc_p])
trc,nc=[],0
table_row_with_columns.each do |c|
+ c.gsub!(/^~$/,'') # tilde / empty cell
+ c.gsub!(/<:br>/,'<br />')
trc <<= if table_obj.head_ and nr==0; %{<th width="#{table_obj.widths[nc]}%">#{c}</th>}
else %{<td width="#{table_obj.widths[nc]}%">#{c}</td>}
end
diff --git a/lib/sisu/v2/xml_tables.rb b/lib/sisu/v2/xml_tables.rb
index f5b2845c..71bcb37e 100644
--- a/lib/sisu/v2/xml_tables.rb
+++ b/lib/sisu/v2/xml_tables.rb
@@ -142,9 +142,7 @@ module SiSU_Tables
#{tablefoot}}
end
def table_row(inf,h=false)
- bold=if h; '<b>'
- else ''
- end
+ bold=h ? '<b>' : ''
%{
<tr>
<td width="#{inf}%" valign="top">#{bold}}
@@ -155,9 +153,7 @@ module SiSU_Tables
end
end
def table_row_close(h=false)
- bold_close=if h; '</b>'
- else ''
- end
+ bold_close=h ? '<b>' : ''
"#{bold_close}</td></tr>"
end
def table