diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-03-12 18:45:04 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-03-12 18:45:07 -0400 |
commit | 756caa5d09492586824354864be6a5c9fe244005 (patch) | |
tree | 0eac01253f40ef786242092a5618adc724e013d4 /lib/sisu/v3dv/epub_format.rb | |
parent | v3dv: sysenv, param, options, output control hooks code modified (diff) |
v3dv: start using output control hooks
* for config file, document headers, & command line
* v3dv: sysenv, ProcessingSettings, start to use hooks to make it possible
to control (via: the command line; the document markup header, or; the
configuration file) the likes of: ocn, toc, segsubtoc, minitoc,
links-to-manifest, search-form, html-navigation, html-navigation-bar,
html-right-pane, html-top-band; these are switched on by default and may
be switched off in omit lists within configuration file, the document
markup header, or command line. The command line takes precedence & may
switch on or off overriding settings within the document markup header or
the sisu configuration file.
* --inc- on by default, but if switched off in doc header or
configuration, the command line --inc- has precedence; for each possible
exclude configuration the --inc- switch that overrides configuration
settings
* --exc- == --no-; exclude/switch off feature (but --inc- include has
precedence)
* document header @build: :omit: [list output features to be omitted]
* configuration (sisurc.yml) omit:
exclude output feature, overrides configuration settings (omit --dev
development branch modifier once merged back to main)
--exc-ocn, html (seg, scroll), epub, xml, pdf
sisu --dev --exc-ocn --html --epub --xml-sax --xml-dom --xhtml -v \
filename.sst
--exc-toc, html (scroll), epub, pdf
sisu --dev --exc-toc --html --epub --pdf -v filename.sst
--exc-segsubtoc html (seg), epub
sisu --dev --exc-segsubtoc --html --epub -v filename.sst
--exc-minitoc, html (seg), concordance, manifest
sisu --dev --exc-minitoc --html --concordance -v filename.sst
--exc-manifest-minitoc, manifest
sisu --dev --exc-manifest-minitoc --html -v filename.sst
--exc-links_to_manifest, --exc-manifest-links,
html (seg, scroll)
sisu --dev --exc-manifest-links --html -v filename.sst
--exc-search-form, html (seg, scroll), manifest
sisu --dev --exc-search-form --html -v filename.sst
--exc-html-minitoc, html (seg), concordance
sisu --dev --exc-html-minitoc --html --concordance -v filename.sst
--exc-html-navigation, html (seg, scroll)?
sisu --dev --exc-html-navigation --html -v filename.sst
--exc-html-navigation-bar, html (seg)
sisu --dev --exc-html-navigation-bar --html -v filename.sst
--exc-html-search-form, html (seg, scroll)
sisu --dev --exc-html-search-form --html -v filename.sst
--exc-html-right-pane, html (seg, scroll)
sisu --dev --exc-html-right-pane --html -v filename.sst
--exc-html-top-band, html (seg, scroll), concordance (minitoc is
forced on to provide seg navigation)
sisu --dev --exc-html-top-band --html --concordance -v filename.sst
Diffstat (limited to 'lib/sisu/v3dv/epub_format.rb')
-rw-r--r-- | lib/sisu/v3dv/epub_format.rb | 142 |
1 files changed, 12 insertions, 130 deletions
diff --git a/lib/sisu/v3dv/epub_format.rb b/lib/sisu/v3dv/epub_format.rb index f88b6745..e11f5d3d 100644 --- a/lib/sisu/v3dv/epub_format.rb +++ b/lib/sisu/v3dv/epub_format.rb @@ -63,26 +63,22 @@ module SiSU_EPUB_Format @md,@ocn=md,ocn.to_s @ocn ||='' vz=SiSU_Env::GetInit.instance.skin - @skin_no_ocn=if defined? vz.ocn_display_off \ - and vz.ocn_display_off==true - true - else false - end end def ocn_display - if @md.markup.inspect =~/no_ocn/ \ - or @md.opt.mod.inspect =~/--no-ocn/ \ - or @skin_no_ocn - ocn_class='ocn_off' - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"> </label>}) - elsif @ocn.to_i==0 - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"> </label>}) - else + @make=SiSU_Env::ProcessingSettings.new(@md) + if @make.build.ocn? ocn_class='ocn' + if @ocn.to_i==0 + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"> </label>}) + else + @ocn.gsub(/^(\d+|)$/, + %{<label class="#{ocn_class}"><a href="#o\\1" class="lnk#{ocn_class}">\\1</a></label>}) + end + else + ocn_class='ocn_off' @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"><a href="#o\\1" class="lnk#{ocn_class}">\\1</a></label>}) + %{<label class="#{ocn_class}"> </label>}) end end def name @@ -1198,36 +1194,6 @@ module SiSU_EPUB_Format background-color: #f9f9aa; } - .minitoc { - font-weight: normal; - margin-top: 2px; - margin-bottom: 2px; - } - h1.minitoc, h2.minitoc, h3.minitoc { - margin-left: 0em; - font-weight: bold; - text-align: left; - font-size: 90%; - margin-top: 4px; - margin-bottom: 4px; - } - h4.minitoc { - margin-left: 0em; - font-size: 90%; - } - h5.minitoc { - margin-left: 1em; - font-size: 85%; - } - h6.minitoc { - margin-left: 2em; - font-size: 85%; - } - h0.minitoc { - margin-left: 0em; - font-size: 90%; - } - h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c { text-align: center } @@ -2123,52 +2089,6 @@ WOK def initialize(md,txt) super(md,txt) end - def navigation_toc_lev1_advert - %{#{@banner.home_button}\n -<p class="center"> -#{@txt} -#{@two} -</a></p>} - end - def navigation_toc_lev1 - %{#{@banner.nav_toc}} - end - def navigation_toc_lev2 #change bold use css - %{<table summary="navigation segment level 2"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev3 #change bold use css - %{<table summary="navigation segment level 3"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev4 - %{<table summary="navigation segment level 4"> -<tr><td width ="80"> -</td> -<td> -<p> - #{@txt} -</p> -#{@vz.table_close}} - end - def navigation_toc_lev5 - end - def navigation_toc_lev6 - end def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 fn='doc' if fn.to_s.empty? #you may wish to reconsider, sends to 'doc' where no segment info %{ @@ -2298,44 +2218,6 @@ WOK def lev0 #docinfo lev('h0','toc') end - def mini_lev1 - lev('h1','minitoc') - end - def mini_lev2 - lev('h2','minitoc') - end - def mini_lev3 - lev('h3','minitoc') - end - def mini_lev4 - lev('h4','minitoc') - end - def mini_lev5 - lev('h5','minitoc') - end - def mini_lev6 - lev('h6','minitoc') - end - def mini_lev0 #docinfo - lev('h0','minitoc') - end - def mini_tail - %{ - <h4 class="minitoc"> - <a href="sisu_manifest.html">Manifest (alternative outputs)</a> - </h4> -} - end - def mini_concord_tail - %{ - <h4 class="minitoc"> - <a href="concordance.html">Concordance (wordlist)</a> - </h4> - <h4 class="minitoc"> - <a href="sisu_manifest.html">Manifest (alternative outputs)</a> - </h4> -} - end end end __END__ |