aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v2')
-rw-r--r--lib/sisu/v2/constants.rb19
-rw-r--r--lib/sisu/v2/dal_doc_str.rb2
-rw-r--r--lib/sisu/v2/defaults.rb70
-rw-r--r--lib/sisu/v2/epub.rb34
-rw-r--r--lib/sisu/v2/epub_format.rb17
-rw-r--r--lib/sisu/v2/epub_segments.rb7
-rw-r--r--lib/sisu/v2/help.rb13
-rw-r--r--lib/sisu/v2/html.rb15
-rw-r--r--lib/sisu/v2/html_promo.rb6
-rw-r--r--lib/sisu/v2/html_scroll.rb8
-rw-r--r--lib/sisu/v2/html_segments.rb2
-rw-r--r--lib/sisu/v2/param.rb2
-rw-r--r--lib/sisu/v2/plaintext.rb44
-rw-r--r--lib/sisu/v2/sysenv.rb18
-rw-r--r--lib/sisu/v2/texpdf_format.rb3
15 files changed, 182 insertions, 78 deletions
diff --git a/lib/sisu/v2/constants.rb b/lib/sisu/v2/constants.rb
index 384c8c19..9abe9c0b 100644
--- a/lib/sisu/v2/constants.rb
+++ b/lib/sisu/v2/constants.rb
@@ -58,7 +58,7 @@
=end
Sfx={:txt=>'.txt',:html=>'.html',:xhtml=>'.xhtml',:xml=>'.xml',:epub=>'.epub',:epub_xhtml=>'.xhtml',:odt=>'.odt',:pdf=>'.pdf'}
-Ax,Xx,Mx,Rx,Hx,Dx,Db,Tex={},{},{},{},{},{},{},{}
+Ax,Xx,Mx,Rx,Hx,Dx,Px,Db,Tex={},{},{},{},{},{},{},{},{}
Ax[:tab]="\t"
Xx[:protect]='☞'
Xx[:segment]='Ф'
@@ -115,6 +115,23 @@ Db[:name_prefix]="SiSU#{SiSU_version_dir}_"
Tex[:backslash]="\\\\"
Tex[:backslash]="\\\\"
Tex[:tilde]='\\\\\\~'
+Px[:bold_o]= '*'; Px[:bold_c]= '*'
+Px[:italics_o]= '/'; Px[:italics_c]= '/'
+Px[:underscore_o]= '_'; Px[:underscore_c]= '_'
+Px[:cite_o]= '"'; Px[:cite_c]= '"'
+Px[:insert_o]= '+'; Px[:insert_c]= '+'
+Px[:strike_o]= '-'; Px[:strike_c]= '-'
+Px[:superscript_o]='^'; Px[:superscript_c]='^'
+Px[:subscript_o]= '['; Px[:subscript_c]= ']'
+Px[:hilite_o]= '*'; Px[:hilite_c]= '*'
+Px[:lv1]= '*'
+Px[:lv2]= '='
+Px[:lv3]= '='
+#Px[:lv2_3]= '='
+Px[:lv4]= '-'
+Px[:lv5]= '.'
+Px[:lv6]= '.'
+#Px[:lv5_6]= '.'
__END__
consider:
〔comment〕
diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb
index 88ddaec9..dc9a55b7 100644
--- a/lib/sisu/v2/dal_doc_str.rb
+++ b/lib/sisu/v2/dal_doc_str.rb
@@ -234,7 +234,7 @@ module SiSU_document_structure_extract
@h={:head_=>heading,:cols=>cols,:widths=>col,:idx=>idx}
elsif t_o=~/^\{table(?:~h)?(?:\s+\d+;?)?\}\n.+\Z/m
m1,m2,hd=nil,nil,nil
- tbl= /^\{table(?:~h)?(?:\s+\d+;?)?\}\n(.+)\Z/m.match(t_o)[1] #two table representations should be consolidated as one
+ tbl=/^\{table(?:~h)?(?:\s+\d+;?)?\}\n(.+)\Z/m.match(t_o)[1] #two table representations should be consolidated as one
hd=((t_o =~/^\{table~h/) ? true : false)
tbl,tags=extract_tags(tbl)
rws=tbl.split(/\n/)
diff --git a/lib/sisu/v2/defaults.rb b/lib/sisu/v2/defaults.rb
index 52c2cd45..a654aed7 100644
--- a/lib/sisu/v2/defaults.rb
+++ b/lib/sisu/v2/defaults.rb
@@ -1715,13 +1715,14 @@ WOK
<title>SiSU information Structuring Universe - Structured
information, Serialized Units - software for electronic texts,
documents, books, digital libraries in plaintext, html, XHTML, XML,
-ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite), and
+ODF (OpenDocument), EPUB, LaTeX, PDF, SQL (PostgreSQL and SQLite), and
for search</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<meta name="dc.title" content="SiSU information Structuring Universe, Structured information Serialised Units, #{@date.year_static}" />
-<meta name="dc.author" content="Ralph Amissah" />
+<meta name="dc.title"
+ content="SiSU information Structuring Universe, Structured information Serialised Units, #{@date.year_static}" />
+<meta name="dc.creator" content="Ralph Amissah" />
<meta name="dc.subject" content=
-"document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" />
+"document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, EPUB, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" />
<meta name="dc.publisher" content=
"SiSU http://www.jus.uio.no/sisu" />
<meta name="dc.language" content="en" />
@@ -1751,20 +1752,10 @@ software for electronic texts, document collections, books, digital libraries, a
with "atomic search" and text positioning system (shared text citation numbering: "<i>ocn</i>")
</h2>
<h2 class="top_band_tiny">
-outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite)
+outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), EPUB, LaTeX, PDF, SQL (PostgreSQL and SQLite)
</h2>
</div>
<div id="top_band_search">
-<!-- SiSU Search -->
-<a name="search"></a><form method="get" action="http://search.sisudoc.org" target="_top">
-<input type="text" name="s1" size="24" maxlength="255" />
-<br />
-<input type="submit" name="ignore" value="search" />
-<input type="hidden" name="db" value="SiSU_sisu" />
-<input type="radio" name="view" value="index" checked="checked" /> idx
-<input type="radio" name="view" value="text" /> txt
-</form>
-<!-- SiSU Search -->
</div>
<div id="column_left">
<p class="bold">
@@ -1776,7 +1767,7 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQ
---
</p>
<p class="small">
- <a href="http://www.jus.uio.no/sisu/sisu_manual/" target="_top" >
+ <a href="http://www.sisudoc.org/sisu/sisu_manual/" target="_top" >
SiSU Manual
</a>
</p>
@@ -1784,7 +1775,7 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQ
---
</p>
<p class="small">
- <a href="http://www.jus.uio.no/sisu/SiSU/1.html#summary" target="_top" >
+ <a href="http://www.jus.uio.no/sisu/SiSU/examples.html#summary" target="_top" >
What does SiSU do? Summary
</a>
</p>
@@ -1796,6 +1787,16 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQ
Book Samples and Markup Examples
</a>
</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_site_metadata/harvest_authors.html" target="_top" >
+ sorted by Author (sisu metadata)
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_site_metadata/harvest_topics.html" target="_top" >
+ sorted by Topic (sisu metadata)
+ </a>
+</p>
<p class="tiny">
---
</p>
@@ -1849,6 +1850,21 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQ
=============
</p>
<p class="small">
+<a href="http://www.jus.uio.no/sisu/sisu_markup/" target="_top" >
+ sisu markup
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_commands/" target="_top" >
+ sisu commands
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_manual/" target="_top" >
+ sisu manual
+ </a>
+</p>
+<p class="small">
<a href="http://www.jus.uio.no/sisu/man" target="_top" >
sisu man pages
</a>
@@ -1964,13 +1980,13 @@ markup defines document structure (this may be done once in a header pattern-mat
</p>
<p><b>(iii)</b>
<b>(a)</b>
-multiple outputs primarily industry established and institutionally accepted open standard formats, include amongst others: plaintext (UTF-8); html; (structured) XML; ODF (Open Document text)l; LaTeX; PDF (via LaTeX); SQL type databases (currently PostgreSQL and SQLite). Also produces: concordance files; document content certificates (md5 or sha256 digests of headings, paragraphs, images etc.) and html manifests (and sitemaps of content).
+multiple outputs primarily industry established and institutionally accepted open standard formats, include amongst others: plaintext (UTF-8); html; (structured) XML; ODF (Open Document text); EPUB; LaTeX; PDF (via LaTeX); SQL type databases (currently PostgreSQL and SQLite). Also produces: concordance files; document content certificates (md5 or sha256 digests of headings, paragraphs, images etc.) and html manifests (and sitemaps of content).
<b>(b)
</b>
takes advantage of the strengths implicit in these very different output types, (e.g. PDFs produced using typesetting of LaTeX, databases populated with documents at an individual object/paragraph level, making possible granular search (and related possibilities))</p>
<p><b>(iv)</b>
-outputs share a common numbering system (dubbed "object citation numbering" (ocn)) that is meaningful (to man and machine) across various digital outputs whether paper, screen, or database oriented, (PDF, html, XML, sqlite, postgresql), this numbering system can be used to reference content.</p>
+outputs share a common numbering system (dubbed "object citation numbering" (ocn)) that is meaningful (to man and machine) across various digital outputs whether paper, screen, or database oriented, (PDF, html, XML, EPUB, sqlite, postgresql), this numbering system can be used to reference content.</p>
<p>
<b>(v)</b>
SQL databases are populated at an object level (roughly headings, paragraphs, verse, tables) and become searchable with that degree of granularity, the output information provides the object/paragraph numbers which are relevant across all generated outputs; it is also possible to look at just the matching paragraphs of the documents in the database; [output indexing also work well with search indexing tools like hyperesteier].</p>
@@ -2040,7 +2056,7 @@ document source may be bundled together (automatically) with associated document
</p>
<p>
<b>(xxii)</b>
-for basic document generation, the only software dependency is Ruby, and a few standard Unix tools (this covers plaintext, html, XML, ODF, LaTeX). To use a database you of course need that, and to convert the LaTeX generated to PDF, a LaTeX processor like tetex or texlive.
+for basic document generation, the only software dependency is Ruby, and a few standard Unix tools (this covers plaintext, html, XML, ODF, EPUB, LaTeX). To use a database you of course need that, and to convert the LaTeX generated to PDF, a LaTeX processor like tetex or texlive.
</p>
<p>
as a developers tool it is flexible and extensible
@@ -2051,6 +2067,20 @@ More information on <a href="http://www.jus.uio.no/sisu/SiSU/"><b>SiSU</b></a> p
</div>
<div id="column_right">
<p class="tiny">
+<!-- Search SiSU -->
+<a name="search"></a><form method="get" action="http://search.sisudoc.org" target="_top">
+<input type="text" name="s1" size="24" maxlength="255" />
+<br />
+<input type="submit" name="ignore" value="search" />
+<input type="hidden" name="db" value="SiSUv2_sisu" />
+<input type="hidden" name="a" value="1" />
+<input type="radio" name="view" value="index" checked="checked" /> idx
+<input type="radio" name="view" value="text" /> txt
+<a href="http://search.sisudoc.org" target="_top" >search.sisudoc.org</a>
+</form>
+<!-- Search SiSU -->
+</p>
+<p class="tiny">
SiSU ("SiSU information Structuring Universe" or "Structured information, Serialized Units"),<sup>1</sup> is a Unix command line oriented framework for document structuring, publishing and search. Featuring minimalistic markup, multiple standard outputs, a common citation system, and granular search.
</p>
<p class="tiny">
diff --git a/lib/sisu/v2/epub.rb b/lib/sisu/v2/epub.rb
index 6df06025..e6ab1e12 100644
--- a/lib/sisu/v2/epub.rb
+++ b/lib/sisu/v2/epub.rb
@@ -499,7 +499,8 @@ module SiSU_EPUB
segtoc << format_head_toc.head #<< ads.div.major
toc_shared << format_head_toc.toc_head_escript if SiSU_EPUB_Format::Head_toc.method_defined? :toc_head_escript
segtoc << format_head_toc.toc_head_escript if SiSU_EPUB_Format::Head_toc.method_defined? :toc_head_escript
- if @md.rights.all
+ if defined? @md.rights.all \
+ and @md.rights.all
rights=format_head_toc.rights.all
rights=SiSU_EPUB_Tune::Clean_xhtml.new(rights).clean
end
@@ -517,7 +518,8 @@ module SiSU_EPUB
format_txt_obj=SiSU_EPUB_Format::Format_text_object.new(@md,txt_obj)
toc_shared << format_txt_obj.center_bold
segtoc << format_txt_obj.center_bold
- if @md.creator.author
+ if defined? @md.creator.author \
+ and @md.creator.author
creator_endnote=@md.creator.author.gsub(/(\*+)/,%{&nbsp;<sup><a href="#notes">\\1</a></sup>})
tmp_head=creator_endnote + "\n"
txt_obj={:txt =>tmp_head}
@@ -529,21 +531,34 @@ module SiSU_EPUB
segtoc << format_head_toc.copyat
segtoc << seg_toc_band
tmp_head=nil
- if @md.prefix_a
+ if defined? @md.prefix_a \
+ and @md.prefix_a
tmp_head ||= %{#{@md.prefix_a}\n}
toc_shared << tmp_head.dup
segtoc << tmp_head.dup
end
tmp_head=nil
toc_shared << @links_guide_toc
- toc_shared << rights if @md.rights.all
- toc_shared << prefix_b if @md.prefix_b
+ if defined? @md.rights.all \
+ and @md.rights.all
+ toc_shared << rights
+ end
+ if defined? @md.prefix_b \
+ and @md.prefix_b
+ toc_shared << prefix_b
+ end
#Table of Contents added/appended here
toc_shared << @toc[:scr]
segtoc << @links_guide_toc
segtoc << @toc[:seg]
- segtoc << rights if @md.rights.all
- segtoc << prefix_b if @md.prefix_b
+ if defined? @md.rights.all \
+ and @md.rights.all
+ segtoc << rights
+ end
+ if defined? @md.prefix_b \
+ and @md.prefix_b
+ segtoc << prefix_b
+ end
#Segtoc tail added here
segtoc << seg_toc_band_bottom
segtoc << format_head_toc.xhtml_close
@@ -618,7 +633,10 @@ module SiSU_EPUB
def images
img_pth=@md.env.path.image_source_local_tex
@md.ec[:image].each do |x|
- cp("#{img_pth}/#{x}","#{@md.env.path.epub}/OPS/image") if FileTest.directory?("#{@md.env.path.epub}/OPS/image")
+ if FileTest.directory?("#{@md.env.path.epub}/OPS/image") \
+ and FileTest.file?("#{img_pth}/#{x}")
+ cp("#{img_pth}/#{x}","#{@md.env.path.epub}/OPS/image")
+ end
end
end
def concordance
diff --git a/lib/sisu/v2/epub_format.rb b/lib/sisu/v2/epub_format.rb
index 5599a435..498912a3 100644
--- a/lib/sisu/v2/epub_format.rb
+++ b/lib/sisu/v2/epub_format.rb
@@ -1024,17 +1024,28 @@ WOK
WOK
end
def metadata #metadata dc
- illustrator=if defined? @md.creator.illustrator and @md.creator.illustrator =~/\S+/
+ author=if defined? @md.creator.author \
+ and @md.creator.author =~/\S+/
+ %{\n <dc:creator opf:file-as="#{@md.creator.author}" opf:role="aut">#{@md.creator.author}</dc:creator>}
+ else ''
+ end
+ illustrator=if defined? @md.creator.illustrator \
+ and @md.creator.illustrator =~/\S+/
%{\n <dc:creator opf:file-as="#{@md.creator.illustrator}" opf:role="ill">#{@md.creator.illustrator}</dc:creator>}
else ''
end
+ rights=if defined? @md.rights.all \
+ and @md.rights.all =~/\S+/
+ %{\n <dc:rights>#{@md.rights.all}</dc:rights>}
+ else ''
+ end
<<WOK
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>#{@md.title.full}</dc:title>
- <dc:creator opf:file-as="#{@md.creator.author}" opf:role="aut">#{@md.creator.author}</dc:creator>#{illustrator}
+ #{author}#{illustrator}
<dc:language>en-US</dc:language>
<dc:identifier id="bookid">...</dc:identifier>
- <dc:rights>#{@md.rights.all}</dc:rights>
+ #{rights}
<dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier>
</metadata>
WOK
diff --git a/lib/sisu/v2/epub_segments.rb b/lib/sisu/v2/epub_segments.rb
index 3f402c92..5f0b74d3 100644
--- a/lib/sisu/v2/epub_segments.rb
+++ b/lib/sisu/v2/epub_segments.rb
@@ -300,7 +300,10 @@ WOK
end
@p_num ||= ''
if @@is1==1
- @author=%{<b>#{@md.creator.author}</b>\n} if @md.creator.author.to_s =~/\S/
+ if defined? @md.creator.author \
+ and @md.creator.author
+ @author=%{<b>#{@md.creator.author}</b>\n}
+ end
@@seg[:nav] << format_head_seg.navigation_band(@@segtocband)
ocn=if @@heading1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix
else ''
@@ -376,7 +379,7 @@ WOK
end
elsif dob.is =~/^(?:group|alt)$/
sto.para #fix this should be group type specific #FIX
- elsif dob.is =~/^verse$/
+ elsif dob.is=='verse'
sto.verse
elsif dob.is=='code'
sto.code
diff --git a/lib/sisu/v2/help.rb b/lib/sisu/v2/help.rb
index 894f1654..38f0a782 100644
--- a/lib/sisu/v2/help.rb
+++ b/lib/sisu/v2/help.rb
@@ -75,7 +75,7 @@ module SiSU_Help
def help_request
begin
gotten=nil
- regx=/^(list|com(?:mands)?|mod(?:ifiers)|markup|syntax|example(?:37|38)?|head(?:ers?)?|(?:heading|title|level|structure)s?|endnotes|footnotes|tables?|customise|skin|dir(?:ectories)?|paths?|lang(?:uage)?|modules|setup|conf(?:ig(?:ure)?)?|standards?|li[cs]en[sc]e|scratch|install|termsheet|dublin(?:core)?|dc|customise|styles?|appearance|theme|env(ironment)?|dir(?:ector(?:y|ies))?|metaverse|abstract|features|summary|(?:short)?cuts?|sisu|about|ext(?:ernal)?(?:_?prog(?:rams)?)?)|utf-?8|plaintext|html|xml|xhtml|odf|odt|opendocument|css|pdf|latex|tex|(?:tex)?info|search|(?:hyper)?est(?:raier)?|searchform|cgi|sql|db|postgresql|pg?sql|sqlite|convert|php|webrick|sitemaps?|ya?ml|ansi|colors|-[AabcDdEeFHhIMmNnopqrRSstUuVvwXxyZz0-9]|-[Ddcv]|-[CcFLSVvW]/
+ regx=/^(list|com(?:mands)?|mod(?:ifiers)|markup|syntax|example(?:37|38)?|head(?:ers?)?|(?:heading|title|level|structure)s?|endnotes|footnotes|tables?|customise|skin|dir(?:ectories)?|paths?|lang(?:uage)?|modules|setup|conf(?:ig(?:ure)?)?|standards?|li[cs]en[sc]e|scratch|install|termsheet|dublin(?:core)?|dc|customise|styles?|appearance|theme|env(ironment)?|dir(?:ector(?:y|ies))?|metaverse|abstract|features|summary|(?:short)?cuts?|sisu|about|ext(?:ernal)?(?:_?prog(?:rams)?)?)|utf-?8|plaintext|html|xml|xhtml|epub|odf|odt|opendocument|css|pdf|latex|tex|(?:tex)?info|search|(?:hyper)?est(?:raier)?|searchform|cgi|sql|db|postgresql|pg?sql|sqlite|convert|php|webrick|sitemaps?|ya?ml|ansi|colors|-[AabcDdEeFHhIMmNnopqrRSstUuVvwXxyZz0-9]|-[Ddcv]|-[CcFLSVvW]/
help_info=%{#{@cX.blue_hi}SiSU help#{@cX.off} #{@cX.ruby}~#{@cX.off} #{@request}}
help_list=%{#{@cX.blue}sisu --help#{@cX.off} #{@cX.cyan}type keyword else "enter" to exit help:\n\tkeywords include:#{@cX.off} #{@cX.brown}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, external_programs, dublincore, termsheet, search, sql, hyper(est)raier, features, external_programs, license#{@cX.off} \n}
help_prompt=%{#{@cX.fuschia}exit, [or carriage return to exit help] #{@cX.off}\n#{@cX.blue_hi}SiSU help#{@cX.off} #{@cX.ruby}~#{@cX.off} }
@@ -125,6 +125,7 @@ module SiSU_Help
when /xhtml|-b/; @help.xhtml
when /xml|-[xX]/; @help.xml
when /odf|odt|opendocument|-o/; @help.odf
+ when /epub|-e/; @help.epub
when /php/; @help.php
when /pdf|-p/; @help.pdf
when /latex|tex/; @help.latex
@@ -995,6 +996,7 @@ WOK
pdf viewer: #{@cX.blue}#{@env.program.pdf_viewer}#{@cX.off}
xml viewer: #{@cX.blue}#{@env.program.xml_editor}#{@cX.off}
odf viewer: #{@cX.blue}#{@env.program.odf_viewer}#{@cX.off}
+ epub viewer: #{@cX.blue}#{@env.program.epub_viewer}#{@cX.off}
(default selections can be changed in sisurc.yml under program_select:)
#{@cX.green}programs used if available#{@cX.off}
word count: #{program_found?(@env.program.wc)}
@@ -1504,6 +1506,8 @@ WOK
sisu -X [filename/wildcard] xml document (dom type parsing)
sisu -o [filename/wildcard] odt document, (odf open document format)
+
+ sisu -e [filename/wildcard] odt document, (epub document)
WOK
help_commands
end
@@ -1514,6 +1518,13 @@ WOK
WOK
help_commands
end
+ def epub
+ print <<WOK
+
+ sisu -e [filename/wildcard] epub document, (open format for e-books)
+WOK
+ help_commands
+ end
def php
print <<WOK
diff --git a/lib/sisu/v2/html.rb b/lib/sisu/v2/html.rb
index 4959d683..834eefa1 100644
--- a/lib/sisu/v2/html.rb
+++ b/lib/sisu/v2/html.rb
@@ -533,7 +533,7 @@ WOK
format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj)
toc_shared << format_txt_obj.center_bold
@segtoc << format_txt_obj.center_bold
- if @md.creator.author
+ if defined? @md.creator.author
creator_endnote=@md.creator.author.gsub(/(\*+)/,%{&nbsp;<sup><a href="#notes">\\1</a></sup>})
tmp_head=creator_endnote + "\n"
txt_obj={:txt =>tmp_head}
@@ -553,13 +553,20 @@ WOK
end
tmp_head=nil
toc_shared << @links_guide_toc
- toc_shared << rights if @md.rights.all
- toc_shared << prefix_b if @md.prefix_b
+ if defined? @md.rights.all #and ? @md.rights.all
+ toc_shared << rights
+ end
+ if defined? @md.prefix_b
+ toc_shared << prefix_b
+ end
#Table of Contents added/appended here
toc_shared << @toc[:scr]
@segtoc << @links_guide_toc
@segtoc << @toc[:seg]
- @segtoc << rights if @md.rights.all
+ if defined? @md.rights.all \
+ and not @md.rights.all.empty?
+ @segtoc << rights
+ end
@segtoc << prefix_b if @md.prefix_b
#Segtoc tail added here
@segtoc << "</p>\n" #bugfix sort later DEBUGNOW
diff --git a/lib/sisu/v2/html_promo.rb b/lib/sisu/v2/html_promo.rb
index 962184f2..df13393e 100644
--- a/lib/sisu/v2/html_promo.rb
+++ b/lib/sisu/v2/html_promo.rb
@@ -146,10 +146,12 @@ module SiSU_HTML_promo
end
def search_form_sisu(table=true)
db=if @prod['db']=~/\S+/
- (@prod['db']=~/^SiSU_\S+/) ? @prod['db'] : "SiSU_#{@prod['db']}"
+ (@prod['db']=~/^#{Db[:name_prefix]}\S+/) ? @prod['db'] : "#{Db[:name_prefix]}#{@prod['db']}"
elsif defined? @rc['search']['sisu']['db'] \
and @rc['search']['sisu']['db'] =~/\S+/
- (@rc['search']['sisu']['db']=~/^SiSU_\S+/) ? @prod['search']['sisu']['db'] : "SiSU_#{@prod['db']}"
+ (@rc['search']['sisu']['db']=~/^#{Db[:name_prefix]}\S+/) \
+ ? @prod['search']['sisu']['db'] \
+ : "#{Db[:name_prefix]}#{@prod['db']}"
else nil
end
action=if @prod['action']=~/^http:\/\//
diff --git a/lib/sisu/v2/html_scroll.rb b/lib/sisu/v2/html_scroll.rb
index 59a3ee42..a5ff9b00 100644
--- a/lib/sisu/v2/html_scroll.rb
+++ b/lib/sisu/v2/html_scroll.rb
@@ -147,13 +147,11 @@ module SiSU_HTML_scroll
else sto.para
end
end
- elsif dob.is =~/^(?:group|alt)$/m
- sto.para #fix this should be group type specific #FIX
- elsif dob.is =='group'
+ elsif dob.is=='group'
sto.group
- elsif dob.is =='alt'
+ elsif dob.is=='alt'
sto.alt
- elsif dob.is =='verse'
+ elsif dob.is=='verse'
sto.verse
elsif dob.is=='code'
sto.code
diff --git a/lib/sisu/v2/html_segments.rb b/lib/sisu/v2/html_segments.rb
index 79aa699e..022a1d0c 100644
--- a/lib/sisu/v2/html_segments.rb
+++ b/lib/sisu/v2/html_segments.rb
@@ -373,7 +373,7 @@ module SiSU_HTML_seg
sto.group
elsif dob.is=='alt'
sto.alt
- elsif dob.is='verse'
+ elsif dob.is=='verse'
sto.verse
elsif dob.is=='code'
sto.code
diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb
index 947c018e..f5085d50 100644
--- a/lib/sisu/v2/param.rb
+++ b/lib/sisu/v2/param.rb
@@ -535,7 +535,7 @@ module SiSU_Param
manpage['name']='man page "name/whatis" information not provided, set in header @man: name=[whatis information]'
end
if manpage['synopsis']
- manpage['synopsis']=manpage['synopsis'].join("\n.BR\n")
+ manpage['synopsis']=manpage['synopsis'].join("\n\n.BR\n")
manpage['synopsis'].gsub!(/(-)/m,"\\\\\\1")
manpage['synopsis'].gsub!(/\A/,"\n.SH SYNOPSIS\n")
else
diff --git a/lib/sisu/v2/plaintext.rb b/lib/sisu/v2/plaintext.rb
index 4e7cb2f1..ddc82839 100644
--- a/lib/sisu/v2/plaintext.rb
+++ b/lib/sisu/v2/plaintext.rb
@@ -237,10 +237,14 @@ WOK
times=wrapped.length
times=78 if times > 78
@plaintext[:body] << case lv
- when 1; wrapped.upcase << @br << '*'*times << @br
- when 2..3; wrapped.upcase << @br << '='*times << @br
- when 4; wrapped.upcase << @br << '-'*times << @br
- when 5..6; wrapped.upcase << @br << '.'*times << @br
+ when 1; wrapped.upcase << @br << Px[:lv1]*times << @br
+ when 2; wrapped.upcase << @br << Px[:lv2]*times << @br
+ when 3; wrapped.upcase << @br << Px[:lv3]*times << @br
+ #when 2..3; wrapped.upcase << @br << Px[:lv2_3]*times << @br
+ when 4; wrapped.upcase << @br << Px[:lv4]*times << @br
+ when 5; wrapped.upcase << @br << Px[:lv5]*times << @br
+ when 6; wrapped.upcase << @br << Px[:lv6]*times << @br
+ #when 5..6; wrapped.upcase << @br << Px[:lv5_6]*times << @br
end
else
@plaintext[:body] << wrapped << @br # main text, contents, body KEEP
@@ -266,15 +270,23 @@ WOK
fix=[]
data.each do |dob|
dob.obj.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+/um,"#{@br}#{table_message}") #fix
- dob.obj.gsub!(/.+?#{Mx[:gl_o]}-##{Mx[:gl_c]}/,'') # remove dummy headings (used by html) #check
- dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'*\1*')
- dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'/\1/')
- dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'_\1_')
- dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'[\1]')
- dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'^\1^')
- dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'+\1+')
- dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'"\1"')
- dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'-\1-')
+ dob.obj.gsub!(/.+?#{Mx[:gl_o]}-##{Mx[:gl_c]}/,'') # remove dummy headings (used by html) #check also [~-]#
+ dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,
+ "#{Px[:bold_o]}\\1#{Px[:bold_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,
+ "#{Px[:italics_o]}\\1#{Px[:italics_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,
+ "#{Px[:underscore_o]}\\1#{Px[:underscore_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,
+ "#{Px[:subscript_o]}\\1#{Px[:subscript_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,
+ "#{Px[:superscript_o]}\\1#{Px[:superscript_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,
+ "#{Px[:insert_o]}\\1#{Px[:insert_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,
+ "#{Px[:cite_o]}\\1#{Px[:cite_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,
+ "#{Px[:strike_o]}\\1#{Px[:strike_c]}")
unless dob.is=='code'
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1')
dob.obj.gsub!(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1 [link: <\2>]')
@@ -305,11 +317,11 @@ WOK
dob.obj.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _> _<
dob.obj.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _<_<
end
- dob.obj.gsub!(/#{Mx[:br_page]}\s*|#{Mx[:br_page_new]}/,'') # remove page breaks
+ dob.obj.gsub!(/#{Mx[:br_page]}\s*|#{Mx[:br_page_new]}/,'') # remove page breaks
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1')
dob.obj.gsub!(/<a href=".+?">(.+?)<\/a>/m,'\1')
- dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'') # remove name links
- dob.obj.gsub!(/&nbsp;|#{Mx[:nbsp]}/,' ') # decide on
+ dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'') # remove name links
+ dob.obj.gsub!(/&nbsp;|#{Mx[:nbsp]}/,' ') # decide on
dob.obj.gsub!(/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+?\.(?:png|jpg|gif)) .+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/,' [ \1 ]') #"[ #{dir.url.images_local}\/\\1 ]")
dob.obj.gsub!(/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+?\.(?:png|jpg|gif)) .+?#{Mx[:lnk_c]}image/,' [ \1 ]') #"[ #{dir.url.images_local}\/\\1 ]")
dob.obj.gsub!(/(?:^|[^_\\])\{\s*\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"\s*\}\S+/,'[image: "\1"]')
diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb
index 9f69ccfe..ddb48bba 100644
--- a/lib/sisu/v2/sysenv.rb
+++ b/lib/sisu/v2/sysenv.rb
@@ -1004,9 +1004,9 @@ module SiSU_Env
elsif widget.search?
db=if rc['search']['sisu']['flag']==true \
and rc['search']['sisu']['db']=~/\S+/
- (rc['search']['sisu']['db']=~/^SiSU_\S+/) \
+ (rc['search']['sisu']['db']=~/^#{Db[:name_prefix]}\S+/) \
? rc['search']['sisu']['db'] \
- : "SiSU_#{rc['search']['sisu']['db']}"
+ : "#{Db[:name_prefix]}#{rc['search']['sisu']['db']}"
else nil
end
action=rc['search']['sisu']['action']
@@ -1074,9 +1074,9 @@ WOK
elsif widget.search_fixed?
db=if rc['search']['sisu']['flag']==true \
and rc['search']['sisu']['db']=~/\S+/
- (rc['search']['sisu']['db']=~/^SiSU_\S+/) \
+ (rc['search']['sisu']['db']=~/^#{Db[:name_prefix]}\S+/) \
? rc['search']['sisu']['db'] \
- : "SiSU_#{rc['search']['sisu']['db']}"
+ : "#{Db[:name_prefix]}#{rc['search']['sisu']['db']}"
else nil
end
action=rc['search']['sisu']['action']
@@ -1171,9 +1171,9 @@ WOK
elsif widget_static.search? \
and rc['search']['sisu']['flag']==true
db=if rc['search']['sisu']['db']=~/\S+/
- (rc['search']['sisu']['db']=~/^SiSU_\S+/) \
+ (rc['search']['sisu']['db']=~/^#{Db[:name_prefix]}\S+/) \
? rc['search']['sisu']['db'] \
- : "SiSU_#{rc['search']['sisu']['db']}"
+ : "#{Db[:name_prefix]}#{rc['search']['sisu']['db']}"
else nil
end
action=rc['search']['sisu']['action']
@@ -1948,12 +1948,6 @@ WOK
? @rc['program_select']['odf_viewer'] \
: 'oowriter' #'odf-viewer','oowriter'
end
- def epub_viewer
- ((defined? @rc['program_select']['epub_viewer']) \
- && @rc['program_select']['epub_viewer'] =~/\S\S+/) \
- ? @rc['program_select']['epub_viewer'] \
- : web_browser
- end
def manpage_generator
((defined? @rc['program_select']['man']) \
&& @rc['program_select']['man'] =~/\S\S+/) \
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index 9847d092..aca5378e 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -492,8 +492,9 @@ module SiSU_TeX_Pdf
hsp="\n{\\color{mywhite} .}&~\n" # ~ character for hardspace
caption=(c ? "{\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" : '')
elsif images_hash[ps] =~/#{Mx[:lnk_o]}\s*(\S+\.?\.(?:png|jpg|gif))/m
- tell=SiSU_Screen::Ansi.new(@md.cmd,%{document built without image: "#{$1}" as image dimensions not provided (& librmagick-ruby is not installed)?\n})
+ tell=SiSU_Screen::Ansi.new(@md.cmd,%{document built without image: "#{$1}" as image dimensions not provided (either image not found or neither imagemagick nor graphicsmagick is installed)?\n})
tell.print_grey #unless @opt.cmd =~/q/
+ images_hash[ps].gsub!(/#{Mx[:lnk_o]}\s*(\S+\.?\.(?:png|jpg|gif))/,'[image]')
end
if image #most images fc etc. #% clean up !
if @md.fns =~/\.(?:ssm\.)?sst$/ \