aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2015-05-01 18:51:40 -0400
committerRalph Amissah <ralph@amissah.com>2015-05-01 18:51:40 -0400
commit58d01ddb946f666b2bc70b867314c00b1e78b1e3 (patch)
tree6ed99ea64d1ad4b02a1c8f901fb6248af9abfe08
parentdebian/changelog (5.8.0-1) (diff)
parentversion & changelog, tag for release (diff)
Merge tag 'sisu_6.5.0' into debian/sid
SiSU 6.5.0
-rw-r--r--.gitignore2
-rwxr-xr-x[-rw-r--r--]bin/sisu2
-rwxr-xr-x[-rw-r--r--]bin/sisu-concordance0
-rwxr-xr-x[-rw-r--r--]bin/sisu-epub0
-rwxr-xr-x[-rw-r--r--]bin/sisu-harvest0
-rwxr-xr-x[-rw-r--r--]bin/sisu-html0
-rwxr-xr-x[-rw-r--r--]bin/sisu-html-scroll0
-rwxr-xr-x[-rw-r--r--]bin/sisu-html-seg0
-rwxr-xr-x[-rw-r--r--]bin/sisu-misc-utils0
-rwxr-xr-x[-rw-r--r--]bin/sisu-odf0
-rwxr-xr-x[-rw-r--r--]bin/sisu-pdf0
-rwxr-xr-x[-rw-r--r--]bin/sisu-pdf-landscape0
-rwxr-xr-x[-rw-r--r--]bin/sisu-pdf-portrait0
-rwxr-xr-x[-rw-r--r--]bin/sisu-pg0
-rwxr-xr-x[-rw-r--r--]bin/sisu-sqlite0
-rwxr-xr-x[-rw-r--r--]bin/sisu-txt0
-rwxr-xr-x[-rw-r--r--]bin/sisu-webrick0
-rw-r--r--data/doc/sisu/CHANGELOG_v57
-rw-r--r--data/doc/sisu/CHANGELOG_v67
-rw-r--r--data/doc/sisu/org/sisu_packaging.org174
-rw-r--r--data/sisu/version/current.yml6
-rw-r--r--data/sisu/version/develop.yml6
-rw-r--r--lib/sisu/current/ao.rb106
-rw-r--r--lib/sisu/current/ao_character_check.rb9
-rw-r--r--lib/sisu/current/ao_composite.rb30
-rw-r--r--lib/sisu/current/ao_doc_objects.rb12
-rw-r--r--lib/sisu/current/ao_doc_str.rb406
-rw-r--r--lib/sisu/current/ao_endnotes.rb15
-rw-r--r--lib/sisu/current/ao_expand_insertions.rb16
-rw-r--r--lib/sisu/current/ao_hash_digest.rb8
-rw-r--r--lib/sisu/current/ao_idx.rb25
-rw-r--r--lib/sisu/current/ao_images.rb6
-rw-r--r--lib/sisu/current/ao_misc_arrange.rb8
-rw-r--r--lib/sisu/current/ao_numbering.rb16
-rw-r--r--lib/sisu/current/ao_persist.rb194
-rw-r--r--lib/sisu/current/ao_references.rb502
-rw-r--r--lib/sisu/current/ao_syntax.rb22
-rw-r--r--lib/sisu/current/cgi_sql_common.rb20
-rw-r--r--lib/sisu/current/constants.rb33
-rw-r--r--lib/sisu/current/db_drop.rb8
-rw-r--r--lib/sisu/current/db_sqltxt.rb24
-rw-r--r--lib/sisu/current/dp.rb49
-rw-r--r--lib/sisu/current/git.rb72
-rw-r--r--lib/sisu/current/html.rb19
-rw-r--r--lib/sisu/current/html_format.rb50
-rw-r--r--lib/sisu/current/html_harvest_authors.rb2
-rw-r--r--lib/sisu/current/html_harvest_topics.rb8
-rw-r--r--lib/sisu/current/html_lite_shared.rb3
-rw-r--r--lib/sisu/current/html_manifest.rb381
-rw-r--r--lib/sisu/current/html_minitoc.rb5
-rw-r--r--lib/sisu/current/html_parts.rb10
-rw-r--r--lib/sisu/current/html_persist.rb237
-rw-r--r--lib/sisu/current/html_segments.rb356
-rw-r--r--lib/sisu/current/html_tune.rb15
-rw-r--r--lib/sisu/current/hub.rb6
-rw-r--r--lib/sisu/current/hub_actions.rb192
-rw-r--r--lib/sisu/current/hub_loop_markup_files.rb3
-rw-r--r--lib/sisu/current/hub_options.rb81
-rw-r--r--lib/sisu/current/manpage.rb103
-rw-r--r--lib/sisu/current/object_munge.rb307
-rw-r--r--lib/sisu/current/se_clear.rb1
-rw-r--r--lib/sisu/current/se_file_op.rb116
-rw-r--r--lib/sisu/current/se_filemap.rb6
-rw-r--r--lib/sisu/current/se_get_init.rb44
-rw-r--r--lib/sisu/current/se_info_env.rb14
-rw-r--r--lib/sisu/current/se_programs.rb10
-rw-r--r--lib/sisu/current/se_version.rb54
-rw-r--r--lib/sisu/current/shared_markup_alt.rb3
-rw-r--r--lib/sisu/current/shared_metadata.rb40
-rw-r--r--lib/sisu/current/src_po4a_share.rb309
-rw-r--r--lib/sisu/current/src_po4a_shelf.rb (renamed from lib/sisu/current/po4a.rb)947
-rw-r--r--lib/sisu/current/src_po4a_shelf_set.rb (renamed from lib/sisu/current/po4a_set.rb)10
-rw-r--r--lib/sisu/current/src_po4a_sst_ao_sst.rb893
-rw-r--r--lib/sisu/current/src_po4a_sst_ao_sst_set.rb284
-rw-r--r--lib/sisu/current/src_po4a_sstm.rb135
-rw-r--r--lib/sisu/current/src_shared.rb102
-rw-r--r--lib/sisu/current/src_sisupod_sstm.rb (renamed from lib/sisu/current/src_share.rb)4
-rw-r--r--lib/sisu/current/sst_convert_markup.rb5
-rw-r--r--lib/sisu/current/sst_from_xml.rb2
-rw-r--r--lib/sisu/current/sst_to_s_xml_sax.rb2
-rw-r--r--lib/sisu/current/texinfo_format.rb2
-rw-r--r--lib/sisu/current/texpdf_format.rb8
-rw-r--r--lib/sisu/current/txt_asciidoc.rb239
-rw-r--r--lib/sisu/current/txt_asciidoc_decorate.rb207
-rw-r--r--lib/sisu/current/txt_markdown.rb242
-rw-r--r--lib/sisu/current/txt_markdown_decorate.rb207
-rw-r--r--lib/sisu/current/txt_orgmode.rb376
-rw-r--r--lib/sisu/current/txt_orgmode_decorate.rb186
-rw-r--r--lib/sisu/current/txt_output.rb86
-rw-r--r--lib/sisu/current/txt_plain.rb243
-rw-r--r--lib/sisu/current/txt_plain_decorate.rb189
-rw-r--r--lib/sisu/current/txt_read.rb109
-rw-r--r--lib/sisu/current/txt_rst.rb218
-rw-r--r--lib/sisu/current/txt_rst_decorate.rb186
-rw-r--r--lib/sisu/current/txt_textile.rb240
-rw-r--r--lib/sisu/current/txt_textile_decorate.rb186
-rw-r--r--lib/sisu/current/urls.rb31
-rw-r--r--lib/sisu/current/utils_composite.rb115
-rw-r--r--lib/sisu/current/utils_response.rb25
-rw-r--r--lib/sisu/current/wikispeak.rb4
-rw-r--r--lib/sisu/current/xhtml.rb120
-rw-r--r--lib/sisu/current/xhtml_epub2.rb478
-rw-r--r--lib/sisu/current/xhtml_epub2_format.rb7
-rw-r--r--lib/sisu/current/xhtml_epub2_persist.rb278
-rw-r--r--lib/sisu/current/xhtml_epub2_segments.rb351
-rw-r--r--lib/sisu/current/xhtml_parts.rb2
-rw-r--r--lib/sisu/current/xhtml_table.rb1
-rw-r--r--lib/sisu/current/xml_dom.rb134
-rw-r--r--lib/sisu/current/xml_fictionbook2.rb4
-rw-r--r--lib/sisu/current/xml_odf_odt.rb48
-rw-r--r--lib/sisu/current/xml_odf_odt_format.rb4
-rw-r--r--lib/sisu/current/xml_persist.rb126
-rw-r--r--lib/sisu/current/xml_sax.rb145
-rw-r--r--lib/sisu/current/xml_shared.rb2
-rw-r--r--setup.rb2
-rw-r--r--setup/qi_libs.rb16
-rw-r--r--setup/sisu_version.rb4
117 files changed, 8146 insertions, 3219 deletions
diff --git a/.gitignore b/.gitignore
index 2811a579..327d5c62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,5 @@
*.rb_
.pc
0???-*.patch
+*.gz
+*.xz
diff --git a/bin/sisu b/bin/sisu
index 9bb41736..f7c36bb3 100644..100755
--- a/bin/sisu
+++ b/bin/sisu
@@ -16,7 +16,7 @@ class Orient
'6'
end
def default
- stable
+ unstable
end
def current
'current'
diff --git a/bin/sisu-concordance b/bin/sisu-concordance
index 0eabb80c..0eabb80c 100644..100755
--- a/bin/sisu-concordance
+++ b/bin/sisu-concordance
diff --git a/bin/sisu-epub b/bin/sisu-epub
index 2c7efc38..2c7efc38 100644..100755
--- a/bin/sisu-epub
+++ b/bin/sisu-epub
diff --git a/bin/sisu-harvest b/bin/sisu-harvest
index 9430f8b3..9430f8b3 100644..100755
--- a/bin/sisu-harvest
+++ b/bin/sisu-harvest
diff --git a/bin/sisu-html b/bin/sisu-html
index 8f1e4dbc..8f1e4dbc 100644..100755
--- a/bin/sisu-html
+++ b/bin/sisu-html
diff --git a/bin/sisu-html-scroll b/bin/sisu-html-scroll
index f5098f32..f5098f32 100644..100755
--- a/bin/sisu-html-scroll
+++ b/bin/sisu-html-scroll
diff --git a/bin/sisu-html-seg b/bin/sisu-html-seg
index c5851331..c5851331 100644..100755
--- a/bin/sisu-html-seg
+++ b/bin/sisu-html-seg
diff --git a/bin/sisu-misc-utils b/bin/sisu-misc-utils
index 47d8f32b..47d8f32b 100644..100755
--- a/bin/sisu-misc-utils
+++ b/bin/sisu-misc-utils
diff --git a/bin/sisu-odf b/bin/sisu-odf
index c6eee725..c6eee725 100644..100755
--- a/bin/sisu-odf
+++ b/bin/sisu-odf
diff --git a/bin/sisu-pdf b/bin/sisu-pdf
index 45a6ba7b..45a6ba7b 100644..100755
--- a/bin/sisu-pdf
+++ b/bin/sisu-pdf
diff --git a/bin/sisu-pdf-landscape b/bin/sisu-pdf-landscape
index 1fe79491..1fe79491 100644..100755
--- a/bin/sisu-pdf-landscape
+++ b/bin/sisu-pdf-landscape
diff --git a/bin/sisu-pdf-portrait b/bin/sisu-pdf-portrait
index 4f40aa03..4f40aa03 100644..100755
--- a/bin/sisu-pdf-portrait
+++ b/bin/sisu-pdf-portrait
diff --git a/bin/sisu-pg b/bin/sisu-pg
index 83585b75..83585b75 100644..100755
--- a/bin/sisu-pg
+++ b/bin/sisu-pg
diff --git a/bin/sisu-sqlite b/bin/sisu-sqlite
index 9863e983..9863e983 100644..100755
--- a/bin/sisu-sqlite
+++ b/bin/sisu-sqlite
diff --git a/bin/sisu-txt b/bin/sisu-txt
index 14dcb085..14dcb085 100644..100755
--- a/bin/sisu-txt
+++ b/bin/sisu-txt
diff --git a/bin/sisu-webrick b/bin/sisu-webrick
index 75d97238..75d97238 100644..100755
--- a/bin/sisu-webrick
+++ b/bin/sisu-webrick
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index 6e68ba5c..af735e3f 100644
--- a/data/doc/sisu/CHANGELOG_v5
+++ b/data/doc/sisu/CHANGELOG_v5
@@ -34,6 +34,13 @@ v2 branch is removed; it is available in sisu =< 3.3.2
--- HEAD ---
+** 5.9.0.orig.tar.xz (2015-04-21:16/2)
+http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.9.0
+http://www.jus.uio.no/sisu/pkg/src/sisu_5.9.0.orig.tar.xz
+ sisu_5.9.0.orig.tar.xz
+
+ * merge v6 into v5, and make v6 the default branch, so v5 is legacy
+
** 5.8.0.orig.tar.xz (2015-04-20:16/1)
http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.8.0
http://www.jus.uio.no/sisu/pkg/src/sisu_5.8.0.orig.tar.xz
diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6
index 857d19ea..e260b312 100644
--- a/data/doc/sisu/CHANGELOG_v6
+++ b/data/doc/sisu/CHANGELOG_v6
@@ -24,6 +24,13 @@ v2 branch is removed; it is available in sisu =< 3.3.2
--- HEAD ---
+** 6.5.0.orig.tar.xz (2015-04-21:16/2)
+http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.4.1
+http://www.jus.uio.no/sisu/pkg/src/sisu_6.4.1.orig.tar.xz
+ sisu_6.4.1.orig.tar.xz
+
+ * v6 made the default branch (prior to restructuring for v7)
+
** 6.4.0.orig.tar.xz (2015-04-20:16/1)
http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.4.0
http://www.jus.uio.no/sisu/pkg/src/sisu_6.4.0.orig.tar.xz
diff --git a/data/doc/sisu/org/sisu_packaging.org b/data/doc/sisu/org/sisu_packaging.org
index 3ef53fe7..66e7b965 100644
--- a/data/doc/sisu/org/sisu_packaging.org
+++ b/data/doc/sisu/org/sisu_packaging.org
@@ -3,36 +3,34 @@ Developer Notes, Dependencies
* description
** short summary: 80 chars
-smart text parser for document structuring, multiple format publishing & search
+documents - structuring, publishing in multiple formats and search
** longer
SiSU is a lightweight markup based, command line oriented, document
- structuring, publishing and search framework for document collections.
+ structuring, publishing and search, static content tool for document
+ collections.
.
- With minimal preparation of a plain-text (UTF-8) file, using sisu markup
- syntax in a text editor of your choice, SiSU can generate various document
- formats (most of which share a common object numbering system for locating
- content), including plain text, HTML, XHTML, XML, EPUB, OpenDocument text
- (ODF:ODT), LaTeX, PDF files, and populate an SQL database with objects
- (roughly paragraph-sized chunks) so searches may be performed and matches
- returned with that degree of granularity. Think being able to finely match
- text in documents, using object numbers, across different output formats (and
- across languages if you have translations of the same document). Search results
- can be an index of documents and object numbers within them, your criteria is
- met by these documents at these locations within each document (equally
- relevant across different output formats and languages). To be clear (if
- obvious) page numbers provide none of this functionality. Object numbering is
- particularly suitable for "published" works (finalized texts as opposed to
- works that are frequently changed or updated) for which it provides a fixed
- means of reference of content. Document outputs can also share provided
- semantic meta-data.
+ With minimal preparation of a plain-text (UTF-8) file, using sisu markup syntax
+ in your text editor of choice, SiSU can generate various document formats, most
+ of which share a common object numbering system for locating content, including
+ plain text, HTML, XHTML, XML, EPUB, OpenDocument text (ODF:ODT), LaTeX, PDF
+ files, and populate an SQL database with objects (roughly paragraph-sized
+ chunks) so searches may be performed and matches returned with that degree of
+ granularity. Think of being able to finely match text in documents, using
+ common object numbers, across different output formats and across languages if
+ you have translations of the same document. For search, your criteria is met
+ by these documents at these locations within each document (equally relevant
+ across different output formats and languages). To be clear (if obvious) page
+ numbers provide none of this functionality. Object numbering is particularly
+ suitable for "published" works (finalized texts as opposed to works that are
+ frequently changed or updated) for which it provides a fixed means of reference
+ of content. Document outputs can also share provided semantic meta-data.
.
SiSU also provides concordance files, document content certificates and
- manifests of generated output. SiSU provides the means to make book indexes
- that make use of its object numbering.
+ manifests of generated output and the means to make book indexes that make use
+ of its object numbering.
.
- A vim syntax highlighting file and an ftplugin with folds for sisu markup is
- provided. Vim 7 includes syntax highlighting for SiSU. Some syntax hilighting
- is also available for Emacs and a few other editors.
+ Syntax highlighting and folding (outlining) files are provided for the Vim and
+ Emacs editors.
.
Dependencies for various features are taken care of in sisu related packages.
The package sisu-complete installs the whole of SiSU.
@@ -49,6 +47,7 @@ smart text parser for document structuring, multiple format publishing & search
.
SiSU works well under po4a translation management, for which an administrative
sample Rakefile is provided with sisu_manual under markup-samples.
+
* Generic Dependencies
** source
git clone --depth 1 git://git.sisudoc.org/git/code/sisu.git --branch upstream
@@ -67,11 +66,11 @@ $ qi setup --all --dryrun
$ sudo ./qi setup --all dryrun
** minimal
- needed for
-----------------------
-ruby all, provides outputs text, html
-xz sisupod
-zip unzip epub & odt
+*** interpreter
+ruby all, provides outputs text, html
+*** compression tools
+xz sisupod (sisu source)
+zip unzip epub & odt
*** images
imagemagick | graphicsmagick
@@ -79,6 +78,87 @@ ruby-rmagick ?
** special requirements
+*** ruby requires
+(checked for sisu 6.5.0 & 7.0.0)
+require 'RMagick' ao_images.rb
+require 'base64' xml_fictionbook2.rb
+require 'cgi' cgi_pgsql.rb
+ cgi_sqlite.rb
+ webrick.rb
+require 'date' se_date.rb
+require 'dbi' se_load.rb
+require 'digest/md5' shared_markup_alt.rb
+require 'digest/sha2' shared_markup_alt.rb
+ shared_markup_alt.rb
+require 'fcgi' cgi_pgsql.rb
+ cgi_sqlite.rb
+ webrick.rb
+require 'fileutils' dbi_discrete.rb
+ hub.rb
+ se.rb
+ se_cleanoutput.rb
+ se_createsite.rb
+ se_file_op.rb
+ se_file_op.rb
+ se_info_env.rb
+ se_info_env.rb
+ se_remotes.rb
+ src_kdissert_share.rb
+require 'find' xml_odf_odt.rb
+require 'net/http' remote.rb
+require 'open-uri' ao_composite.rb
+ remote.rb
+require 'pathname' hub_options.rb
+ se_info_env.rb
+require 'pg' cgi_pgsql.rb
+ dbi.rb
+ se_db.rb
+require 'pp' ao_composite.rb
+ remote.rb
+require 'profile' hub.rb
+require 'pstore' dp.rb
+ html.rb
+ texpdf.rb
+ texpdf.rb
+ xhtml_epub2.rb
+require 'rbconfig' se_info_system.rb
+ se_version.rb
+require 'rexml/document' sst_from_xml.rb
+ rexml.rb
+ rexml.rb
+require 'singleton' se.rb
+ se_clear.rb
+ se_envcall.rb
+ se_hub_particulars.rb
+ se_info_env.rb
+ se_programs.rb
+ se_version.rb
+ se_version.rb
+require 'socket' se_remotes.rb
+require 'sqlite3' cgi_sqlite.rb
+ dbi.rb
+ dbi_discrete.rb
+ se_db.rb
+require 'time' webrick.rb
+ webrick.rb
+require 'timeout' src_po4a_shelf.rb
+ src_po4a_sst_ao_sst.rb
+require 'uri' ao_composite.rb
+ dp.rb
+ hub.rb
+ hub_loop_markup_files.rb
+require 'webrick' webrick.rb
+require 'yaml' se_get_init.rb
+ se_get_init.rb
+ se_get_init.rb
+ se_get_init.rb
+ se_version.rb
+require 'zlib' xml_odf_odt.rb
+require @prog se_load.rb
+require termsheet termsheet.rb
+
+ao_hash_digest.rb sha_ ? (require 'digest/sha2') : (require 'digest/md5')
+
*** pdf
texlive
@@ -119,23 +199,27 @@ xunicode.sty
*** sql db
**** sqlite3
-sqlite3
-ruby-sqlite3
-
-ruby-fcgi (fast-cgi)
-httpd
+sqlite3 sql db, search
+ruby-sqlite3 ruby driver
**** postgresql
-postgresql
-ruby-pg
+postgresql sql db, search
+ruby-pg ruby driver
-ruby-fcgi (fast-cgi)
-httpd
+*** web serve & search
+
+ruby-fcgi (fast-cgi) search form
+httpd web server
+(along with sql db)
*** qr codes
-qrencode
+qrencode qr codes based on document metadata
+
+*** misc
+
+tree information on document structure
*** maintenance/installation
ruby-thor | rake
@@ -214,24 +298,26 @@ needs more than a shallow clone of depth 1
** pacman install
sudo pacman -S ruby \
- zip unzip xy
+ zip unzip xy tree
sudo pacman -S ruby \
texlive-core texlive-latexextra texlive-fontsextra texlive-langcjk
sudo pacman -S ruby \
- sqlite postgresql
+ sqlite postgresql \
+ fastcgi ruby-sqlite ruby-postgrsql
# issue with ruby-pg ruby-sqlite ruby-fcgi
-** interpreter
+** sort
+*** interpreter
ruby
-** compression tools (epub, odf:odt, sisupod)
+*** compression tools (epub, odf:odt, sisupod)
zip unzip
xy
-** texlive (pdf)
+*** texlive (pdf)
sudo pacman -S texlive-core texlive-latexextra
sudo pacman -S texlive-core texlive-latexextra texlive-fontsextra texlive-langcjk
diff --git a/data/sisu/version/current.yml b/data/sisu/version/current.yml
index 18463362..82262ef8 100644
--- a/data/sisu/version/current.yml
+++ b/data/sisu/version/current.yml
@@ -1,5 +1,5 @@
---
:project: SiSU
-:version: 5.8.0
-:date_stamp: 2015w16/1
-:date: "2015-04-20"
+:version: 5.9.0
+:date_stamp: 2015w16/2
+:date: "2015-04-21"
diff --git a/data/sisu/version/develop.yml b/data/sisu/version/develop.yml
index 5ae6ac06..f69fce72 100644
--- a/data/sisu/version/develop.yml
+++ b/data/sisu/version/develop.yml
@@ -1,5 +1,5 @@
---
:project: SiSU
-:version: 6.4.0
-:date_stamp: 2015w16/1
-:date: "2015-04-20"
+:version: 6.5.0
+:date_stamp: 2015w16/2
+:date: "2015-04-21"
diff --git a/lib/sisu/current/ao.rb b/lib/sisu/current/ao.rb
index 3467c4c6..b7878dbf 100644
--- a/lib/sisu/current/ao.rb
+++ b/lib/sisu/current/ao.rb
@@ -64,6 +64,7 @@ module SiSU_AO
require_relative 'ao_syntax' # ao_syntax.rb
include SiSU_AO_Syntax
require_relative 'ao_doc_str' # ao_doc_str.rb
+ require_relative 'ao_references' # ao_references.rb
require_relative 'ao_idx' # ao_idx.rb
require_relative 'ao_numbering' # ao_numbering.rb
require_relative 'ao_hash_digest' # ao_hash_digest.rb
@@ -73,6 +74,7 @@ module SiSU_AO
require_relative 'ao_character_check' # ao_character_check.rb
require_relative 'ao_misc_arrange' # ao_misc_arrange.rb
require_relative 'ao_expand_insertions' # ao_expand_insertions.rb
+ require_relative 'ao_persist' # ao_persist.rb
require_relative 'prog_text_translation' # prog_text_translation.rb
require_relative 'shared_sem' # shared_sem.rb
class Instantiate < SiSU_Param::Parameters::Instructions
@@ -82,13 +84,10 @@ module SiSU_AO
end
end
class Source <Instantiate
- @@ao_array=[]
- @@idx_arr={ sst: [], tex: [], html: [], xhtml: [] }
- @@map_arr={ nametags: [], ocn_htmlseg: [] }
- @@fns=nil
def initialize(opt,fnx=nil,process=:complete)
@opt,@fnx,@process=opt,fnx,process
- @@fns ||=opt.fns
+ @per ||=SiSU_AO_Persist::Persist.new.persist_init
+ @per.fns ||=opt.fns
fn_use=if fnx \
and fnx =~/\.ss[tmi]$/
fnx
@@ -110,32 +109,34 @@ module SiSU_AO
end
def read #creates ao
begin
- @@ao_array=[]
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ @per=SiSU_AO_Persist::Persist.new
+ @per.ao_arr=[]
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
create_ao
rescue
- SiSU_Errors::Rescued.new($!,$@,@opt.selections,@@fns).location do
+ SiSU_Errors::Rescued.new($!,$@,@opt.selections,@per.fns).location do
__LINE__.to_s + ':' + __FILE__
end
ensure
+ SiSU_AO_Persist::Persist.new.persist_init
SiSU_AO::Instantiate.new
end
end
def get #reads ao, unless does not exist then creates first
begin
ao=[]
- unless @@fns==@opt.fns \
- or @@fns==@fnx
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ unless @per.fns==@opt.fns \
+ or @per.fns==@fnx
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
- @@ao_array=[]
+ @per.ao_arr=[]
end
- ao=(@@ao_array.empty?) \
+ ao=(@per.ao_arr.empty?) \
? read_fnc
- : @@ao_array.dup
+ : @per.ao_arr.dup
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -147,16 +148,16 @@ module SiSU_AO
def get_idx_sst #reads ao idx.sst, #unless does not exist then creates first
begin
ao=[]
- unless @@fns==@opt.fns \
- or @@fns==@fnx
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ unless @per.fns==@opt.fns \
+ or @per.fns==@fnx
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
- @@idx_arr[:sst]=[]
+ @per.idx_arr_sst=[]
end
- ao=(@@idx_arr[:sst].empty?) \
+ ao=(@per.idx_arr_sst.empty?) \
? read_idx_sst
- : @@idx_arr[:sst].dup #check
+ : @per.idx_arr_sst.dup #check
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -168,16 +169,16 @@ module SiSU_AO
def get_idx_raw
begin
ao=[]
- unless @@fns==@opt.fns \
- or @@fns==@fnx
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ unless @per.fns==@opt.fns \
+ or @per.fns==@fnx
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
- @@idx_arr[:tex]=[]
+ @per.idx_arr_tex=[]
end
- ao=(@@idx_arr[:tex].empty?) \
+ ao=(@per.idx_arr_tex.empty?) \
? read_idx_raw
- : @@idx_arr[:tex].dup #check
+ : @per.idx_arr_tex.dup #check
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -189,16 +190,16 @@ module SiSU_AO
def get_idx_html #reads ao idx.html, #unless does not exist then creates first
begin
ao=[]
- unless @@fns==@opt.fns \
- or @@fns==@fnx
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ unless @per.fns==@opt.fns \
+ or @per.fns==@fnx
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
- @@idx_arr[:html]=[]
+ @per.idx_arr_html=[]
end
- ao=(@@idx_arr[:html].empty?) \
+ ao=(@per.idx_arr_html.empty?) \
? read_idx_html
- : @@idx_arr[:html].dup
+ : @per.idx_arr_html.dup
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -210,16 +211,16 @@ module SiSU_AO
def get_idx_xhtml #reads ao idx.xhtml, #unless does not exist then creates first
begin
ao=[]
- unless @@fns==@opt.fns \
- or @@fns==@fnx
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ unless @per.fns==@opt.fns \
+ or @per.fns==@fnx
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
- @@idx_arr[:xthml]=[]
+ @per.idx_arr_xhtml=[] #...
end
- ao=(@@idx_arr[:xhtml].empty?) \
+ ao=(@per.idx_arr_xhtml.empty?) \
? read_idx_xhtml
- : @@idx_arr[:xhtml].dup
+ : @per.idx_arr_xhtml.dup
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -231,16 +232,16 @@ module SiSU_AO
def get_map_nametags #reads ao map.nametags, #unless does not exist then creates first
begin
ao=[]
- unless @@fns==@opt.fns \
- or @@fns==@fnx
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ unless @per.fns==@opt.fns \
+ or @per.fns==@fnx
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
- @@map_arr[:nametags]=[]
+ @per.map_arr_nametags=[]
end
- ao=(@@map_arr[:nametags].empty?) \
+ ao=(@per.map_arr_nametags.empty?) \
? read_map_nametags
- : @@map_arr[:nametags].dup
+ : @per.map_arr_nametags.dup
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -252,16 +253,16 @@ module SiSU_AO
def get_map_ocn_htmlseg #reads ao map.ocn_htmlseg, #unless does not exist then creates first
begin
ao=[]
- unless @@fns==@opt.fns \
- or @@fns==@fnx
- @@fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
+ unless @per.fns==@opt.fns \
+ or @per.fns==@fnx
+ @per.fns=(@fnx && @fnx =~/\.ss[tmi]$/) \
? @fnx
: @opt.fns
- @@map_arr[:ocn_htmlseg]=[]
+ @per.map_arr_ocn_htmlseg=[]
end
- ao=(@@map_arr[:ocn_htmlseg].empty?) \
+ ao=(@per.map_arr_ocn_htmlseg.empty?) \
? read_map_ocn_htmlseg
- : @@map_arr[:ocn_htmlseg].dup
+ : @per.map_arr_ocn_htmlseg.dup
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -539,11 +540,12 @@ module SiSU_AO
SiSU_AO_MiscArrangeText::SI.new(@md,data_txt). # ao_misc_arrange.rb
prepare_text
data_obj,
- metadata=
+ metadata,
+ bibliography=
SiSU_AO_DocumentStructureExtract::Build.new(@md,data_txt). # ao_doc_str.rb
identify_parts
data_obj=
- SiSU_AO_Syntax::Markup.new(@md,data_obj).songsheet # ao_syntax.rb
+ SiSU_AO_Syntax::Markup.new(@md,data_obj,bibliography).songsheet # ao_syntax.rb
data_obj,
endnote_array=
SiSU_AO_CharacterCheck::Check.new(data_obj). # ao_character_check.rb
diff --git a/lib/sisu/current/ao_character_check.rb b/lib/sisu/current/ao_character_check.rb
index faee5924..9d91baa5 100644
--- a/lib/sisu/current/ao_character_check.rb
+++ b/lib/sisu/current/ao_character_check.rb
@@ -63,9 +63,9 @@ module SiSU_AO_CharacterCheck
end
def character_check_and_oldstyle_endnote_array
data=@data
- @tuned_file,@endnote_array=[],[]
+ @endnote_array=[]
endnote_no=1
- data.each do |dob|
+ @tuned_file=data.select do |dob|
unless dob.is ==:table
dob.obj=dob.obj.strip.
gsub(/^[{~}]\s*$/,'').
@@ -93,9 +93,8 @@ module SiSU_AO_CharacterCheck
end
end
end
- @tuned_file << dob if dob.is_a?(Object)
- end
- @tuned_file=@tuned_file.flatten.compact
+ dob if dob.is_a?(Object)
+ end.flatten.compact
[@tuned_file,@endnote_array]
end
end
diff --git a/lib/sisu/current/ao_composite.rb b/lib/sisu/current/ao_composite.rb
index 611dd70c..24683cba 100644
--- a/lib/sisu/current/ao_composite.rb
+++ b/lib/sisu/current/ao_composite.rb
@@ -57,6 +57,7 @@
=end
module SiSU_Assemble
require_relative 'se' # se.rb
+ require_relative 'utils_composite' # utils_composite.rb
class RemoteImage
def initialize
@env=SiSU_Env::InfoEnv.new
@@ -86,7 +87,7 @@ module SiSU_Assemble
end
end
class Composite
- @@imager={}
+ include SiSU_Composite_Doc_Utils # composite doc, .ssm, extract all related insert files, array of filenames test
def initialize(opt)
@opt=opt
@env=SiSU_Env::InfoEnv.new
@@ -101,14 +102,14 @@ module SiSU_Assemble
'Composite Document',
"[#{@opt.f_pth[:lng_is]}] #{@opt.fno}",
).grey_title_hi unless @opt.act[:quiet][:set]==:on
+ composite_and_imported_filenames_array(@opt.fno) # composite doc, .ssm, extract all related insert files, array of filenames test
assembled=loadfile(@opt.fno)
- #assembled=insertions?(fns_array)
- write(assembled)
write(assembled)
end
Dir.chdir(pwd)
rescue
- SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do
+ SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).
+ location do
__LINE__.to_s + ':' + __FILE__
end
ensure
@@ -126,7 +127,6 @@ module SiSU_Assemble
end
end
def loadfile(loadfilename)
- tuned_file=[]
begin
if FileTest.file?(loadfilename)
insert_array=IO.readlines(loadfilename,'')
@@ -140,18 +140,17 @@ module SiSU_Assemble
loadfilename,
).txt_grey
end
- if loadfilename =~/\S+?\.ss[im]$/
- insert_array.each do |para|
- tuned_file << insert?(para)
+ tuned_file=if loadfilename =~/\S+?\.ss[im]$/
+ insert_array.each.map do |para|
+ insert?(para)
end
elsif loadfilename =~/\S+?\.sst$/
- insert_array.each do |para|
- tuned_file << para
+ insert_array.each.map do |para|
+ para
end
- end
+ end.flatten.compact
end
end
- tuned_file=tuned_file.flatten.compact
rescue
SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do
__LINE__.to_s + ':' + __FILE__
@@ -162,9 +161,6 @@ module SiSU_Assemble
def url(loadfilename)
if loadfilename =~ /((?:https?|file):\/\/\S+?\.ss[it])$/ # and NetTest
loadfilename=$1
- imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/.
- match(loadfilename).captures.join +
- '/_sisu/image' #watch
begin
require 'uri'
require 'open-uri'
@@ -173,13 +169,10 @@ module SiSU_Assemble
SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
error('uri, open-uri or pp NOT FOUND (LoadError)')
end
- image_uri=URI.parse(imagedir)
insert=open(loadfilename)
insert_array=insert.dup
insert.close
file=insertion(loadfilename,insert_array)
- @@imager[image_uri] ||=[]
- @@imager[image_uri] << file[:images]
file[:prepared]
end
end
@@ -238,7 +231,6 @@ module SiSU_Assemble
end
end
class CompositeFileList
- @@imager={}
def initialize(opt)
@opt=opt
@env=SiSU_Env::InfoEnv.new
diff --git a/lib/sisu/current/ao_doc_objects.rb b/lib/sisu/current/ao_doc_objects.rb
index ac528b90..a4b2fa8a 100644
--- a/lib/sisu/current/ao_doc_objects.rb
+++ b/lib/sisu/current/ao_doc_objects.rb
@@ -495,6 +495,18 @@ module SiSU_AO_DocumentStructure
of,is, obj, flag, act, selections,tmp
self
end
+ def flag_lng(h,o=nil)
+ of= @of #Symbol, classification - group
+ is= :flag_lng
+ obj= nil #String, text content
+ flag= h[:flag] || ((defined? o.flag) ? o.flag : nil) #Symbol, :lng_on or :lng_off
+ act= h[:act] || ((defined? o.act) ? o.act : nil) #Symbol, language set to :en etc.
+ selections= h[:selections] || ((defined? o.selections) ? o.selections : nil) #String, text content
+ tmp= h[:act] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use
+ @of, @is,@obj,@flag,@act,@selections,@tmp=
+ of,is, obj, flag, act, selections,tmp
+ self
+ end
end
class ObjectLayout
attr_accessor :obj,:sym,:attr,:is,:is_for,:of,:from,:tmp,:num
diff --git a/lib/sisu/current/ao_doc_str.rb b/lib/sisu/current/ao_doc_str.rb
index 50916d10..fba1724e 100644
--- a/lib/sisu/current/ao_doc_str.rb
+++ b/lib/sisu/current/ao_doc_str.rb
@@ -55,45 +55,21 @@
=end
module SiSU_AO_DocumentStructureExtract
+ require_relative 'ao_persist' # ao_persist.rb
class Instantiate < SiSU_Param::Parameters::Instructions
- @@flag={
- ocn: :on,
- code: :off,
- lngsyn: :txt,
- poem: :off,
- block: :off,
- box: :off,
- group: :off,
- alt: :off,
- quote: :off,
- table: :off,
- table_to: :off,
- }
def initialize
@@counter=@@column=@@columns=0
@@line_mode=''
end
end
class Build
- @@flag={
- ocn: :on,
- code: :off,
- lngsyn: :txt,
- poem: :off,
- block: :off,
- box: :off,
- group: :off,
- alt: :off,
- quote: :off,
- table: :off,
- table_to: :off,
- }
def initialize(md,data)
@md,@data=md,data
SiSU_AO_DocumentStructureExtract::Instantiate.new
@pb=SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page])
@pbn=SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new])
@pbl=SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_line])
+ @per=SiSU_AO_Persist::PersistDocStructExt.new
end
def ln_get(lv)
case lv
@@ -120,7 +96,7 @@ module SiSU_AO_DocumentStructureExtract
: false
end
def quotes?
- @@flag[:quote]==:open \
+ @per.quote==:open \
? true
: false
end
@@ -255,42 +231,29 @@ module SiSU_AO_DocumentStructureExtract
array: idx_array,
}
end
- def identify_parts
- tuned_file=[]
- @tuned_block,@tuned_code=[],[]
- @@counter,@verse_count=0,0
- @num_id={
- code_block: 0,
- poem: 0,
- box: 0,
- group: 0,
- alt: 0,
- quote: 0,
- table: 0,
- }
- @metadata={}
- @data.each do |t_o|
+ def extract_structure_loop(data,tuned_file)
+ data.each do |t_o|
if t_o =~/^--([+~-])[#]$/
h=case $1
when /[+]/
- @@flag[:ocn]=:on
+ @per.ocn=:on
{
flag: :ocn_on,
}
when /[~]/
- @@flag[:ocn]=:ocn_off_headings_keep
+ @per.ocn=:ocn_off_headings_keep
{
flag: :ocn_off,
mod: :headings_keep,
}
when /[-]/ #of particular relevance with level 1~ which is required to precede substantive text & used e.g. in html segmented text
- @@flag[:ocn]=:ocn_off_headings_dummy_lev1
+ @per.ocn=:ocn_off_headings_dummy_lev1
{
flag: :ocn_off,
mod: :headings_exclude,
}
else
- @@flag[:ocn]=:on
+ @per.ocn=:on
{
flag: :ocn_on,
}
@@ -298,7 +261,30 @@ module SiSU_AO_DocumentStructureExtract
t_o=SiSU_AO_DocumentStructure::ObjectFlag.new.flag_ocn(h)
next
end
- t_o=t_o.gsub(/(?:\n\s*\n)+/m,"\n") if @@flag[:code]==:off
+ if t_o =~/^:[~](#{SiSU_is.language_list_regex?}|-)$/ # work with for identifying language of objects
+ lng=$1
+ h=case lng
+ when /(?:#{SiSU_is.language_list_regex?})/
+ @per.lng=:on
+ @per.lng_is=lng.to_sym
+ {
+ flag: :lng_on,
+ act: lng.to_sym,
+ }
+ else # ^:~-
+ if @per.lng==:on
+ @per.lng=:off
+ @per.lng_is=:doc_default
+ {
+ flag: :lng_off,
+ act: :doc_default,
+ }
+ end
+ end
+ t_o=SiSU_AO_DocumentStructure::ObjectFlag.new.flag_lng(h)
+ next
+ end
+ t_o=t_o.gsub(/(?:\n\s*\n)+/m,"\n") if @per.code==:off
unless t_o =~/^(?:@\S+?:|%+)\s/ # extract book index for paragraph if any
idx=if t_o=~/^=\{\s*(.+)\s*\}\s*$\Z/m
m=$1
@@ -313,13 +299,13 @@ module SiSU_AO_DocumentStructureExtract
end
if t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\{|\{table)[ ~]/ \
and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$|^`:quote_(?:open|close)`/ \
- and @@flag[:code]==:off \
- and @@flag[:poem]==:off \
- and @@flag[:group]==:off \
- and @@flag[:block]==:off \
- and @@flag[:alt]==:off \
- and @@flag[:box]==:off \
- and @@flag[:table]==:off
+ and @per.code==:off \
+ and @per.poem==:off \
+ and @per.group==:off \
+ and @per.block==:off \
+ and @per.alt==:off \
+ and @per.box==:off \
+ and @per.table==:off
t_o=case t_o
when /^#{Mx[:meta_o]}\S+?#{Mx[:meta_c]}/ #metadata, header
if t_o=~/^#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*(.+)/m
@@ -340,14 +326,14 @@ module SiSU_AO_DocumentStructureExtract
obj=$1
note=endnote_test?(obj)
obj,tags=extract_tags(obj)
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
unless obj =~ /[~-][#]\s*$/
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
and t_o =~/^1\~\S*\s+/m
obj << ' -#'
- elsif @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ elsif @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
obj << ' ~#'
end
end
@@ -364,14 +350,14 @@ module SiSU_AO_DocumentStructureExtract
name,obj=$1,$2
note=endnote_test?(obj)
obj,tags=extract_tags(obj)
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
unless obj =~ /[~-][#]\s*$/
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
and t_o =~/^1\~\S*\s+/m
obj << ' -#'
- elsif @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ elsif @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
obj << ' ~#'
end
end
@@ -389,14 +375,14 @@ module SiSU_AO_DocumentStructureExtract
name,obj=$1,$2
note=endnote_test?(obj)
obj,tags=extract_tags(obj,name)
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
unless obj =~ /[~-][#]\s*$/
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
and t_o =~/^1\~\S*\s+/m
obj << ' -#'
- elsif @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ elsif @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
obj << ' ~#'
end
end
@@ -424,8 +410,8 @@ module SiSU_AO_DocumentStructureExtract
note=endnote_test?(obj)
obj,tags=extract_tags(obj)
unless obj=~/\A\s*\Z/m
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
unless obj =~ /[~-][#]\s*$/
obj << ' ~#'
end
@@ -457,8 +443,8 @@ module SiSU_AO_DocumentStructureExtract
note=endnote_test?(obj)
obj,tags=extract_tags(obj)
unless obj=~/\A\s*\Z/m
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
unless obj =~ /[~-][#]\s*$/
obj << ' ~#'
end
@@ -489,8 +475,8 @@ module SiSU_AO_DocumentStructureExtract
image=image_test(t_o)
note=endnote_test?(t_o)
obj,tags=extract_tags(t_o)
- if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \
- or @@flag[:ocn]==:ocn_off_headings_keep
+ if @per.ocn==:ocn_off_headings_dummy_lev1 \
+ or @per.ocn==:ocn_off_headings_keep
unless obj =~ /[~-][#]\s*$/
obj << ' ~#'
end
@@ -511,14 +497,14 @@ module SiSU_AO_DocumentStructureExtract
end
t_o=SiSU_AO_DocumentStructureExtract::Structure.new(@md).structure_markup(t_o) #must happen earlier, node info etc. require
end
- elsif @@flag[:code]==:off
+ elsif @per.code==:off
if t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?)/
- @@flag[:code]=case t_o
+ @per.code=case t_o
when /^code(?:\.[a-z][0-9a-z_]+)?\{/ then :curls
when /^```[ ]+code/ then :tics
- else @@flag[:code] #error
+ else @per.code #error
end
- @@flag[:lngsyn]=if t_o =~/^(?:code\.[a-z][0-9a-z_]+\{|```[ ]+code\.[a-z_]+)/
+ @per.lngsyn=if t_o =~/^(?:code\.[a-z][0-9a-z_]+\{|```[ ]+code\.[a-z_]+)/
case t_o
when /^code\.([a-z][0-9a-z_]+)\{/
:"#{$1}"
@@ -539,14 +525,14 @@ module SiSU_AO_DocumentStructureExtract
obj: '',
sym: :code_block_open,
num: @num_id[:code_block],
- syntax: @@flag[:lngsyn],
+ syntax: @per.lngsyn,
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
elsif t_o =~/^(?:poem\{|```[ ]+poem)/
- @@flag[:poem]=case t_o
+ @per.poem=case t_o
when /^poem\{/ then :curls
when /^```[ ]+poem/ then :tics
- else @@flag[:poem] #error
+ else @per.poem #error
end
@num_id[:poem] +=1
h={
@@ -558,10 +544,10 @@ module SiSU_AO_DocumentStructureExtract
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
tuned_file << t_o
elsif t_o =~/^(?:box(?:\.[a-z_]+)?\{|```[ ]+box(?:\.[a-z_]+)?)/
- @@flag[:box]=case t_o
+ @per.box=case t_o
when /^box\{/ then :curls
when /^```[ ]+box/ then :tics
- else @@flag[:box] #error
+ else @per.box #error
end
@num_id[:box] +=1
h={
@@ -573,10 +559,10 @@ module SiSU_AO_DocumentStructureExtract
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
tuned_file << t_o
elsif t_o =~/^(?:group\{|```[ ]+group)/
- @@flag[:group]=case t_o
+ @per.group=case t_o
when /^group\{/ then :curls
when /^```[ ]+group/ then :tics
- else @@flag[:group] #error
+ else @per.group #error
end
@num_id[:group] +=1
h={
@@ -588,10 +574,10 @@ module SiSU_AO_DocumentStructureExtract
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
tuned_file << t_o
elsif t_o =~/^(?:block\{|```[ ]+block)/
- @@flag[:block]=case t_o
+ @per.block=case t_o
when /^block\{/ then :curls
when /^```[ ]+block/ then :tics
- else @@flag[:block] #error
+ else @per.block #error
end
@num_id[:block] +=1
h={
@@ -603,10 +589,10 @@ module SiSU_AO_DocumentStructureExtract
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
tuned_file << t_o
elsif t_o =~/^(?:alt\{|```[ ]+alt)/
- @@flag[:alt]=case t_o
+ @per.alt=case t_o
when /^alt\{/ then :curls
when /^```[ ]+alt/ then :tics
- else @@flag[:alt] #error
+ else @per.alt #error
end
@num_id[:alt] +=1
h={
@@ -618,7 +604,7 @@ module SiSU_AO_DocumentStructureExtract
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
tuned_file << t_o
elsif t_o =~/^`:quote_open`/
- @@flag[:quote]=:open
+ @per.quote=:open
@num_id[:quote] +=1
h={
is_for: :quote,
@@ -639,7 +625,7 @@ module SiSU_AO_DocumentStructureExtract
ins_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
tuned_file << ins_o
if t_o=~/^table\{(?:~h)?\s+/
- @@flag[:table]=:curls
+ @per.table=:curls
@rows=''
case t_o
when /table\{~h\s+c(\d+);\s+(.+)/
@@ -658,7 +644,7 @@ module SiSU_AO_DocumentStructureExtract
idx: idx,
}
elsif t_o=~/^```[ ]+table(?:~h)?\s+c\d+/
- @@flag[:table]=:tics
+ @per.table=:tics
@rows=''
case t_o
when /^```[ ]+table~h\s+c(\d+);\s+(.+)/
@@ -797,12 +783,12 @@ module SiSU_AO_DocumentStructureExtract
end
t_o
end
- if @@flag[:table]==:curls or @@flag[:table]==:tics
- if (@@flag[:table]==:curls \
+ if @per.table==:curls or @per.table==:tics
+ if (@per.table==:curls \
and t_o =~/^\}table/) \
- or (@@flag[:table]==:tics \
+ or (@per.table==:tics \
and t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
- @@flag[:table]=:off
+ @per.table=:off
headings,columns,widths,idx=@h[:head_],@h[:cols],@h[:widths],@h[:idx]
@h={
head_: headings,
@@ -832,13 +818,13 @@ module SiSU_AO_DocumentStructureExtract
t_o=nil
end
end
- if @@flag[:code]==:curls \
- or @@flag[:code]==:tics
- if (@@flag[:code]==:curls \
+ if @per.code==:curls \
+ or @per.code==:tics
+ if (@per.code==:curls \
&& t_o =~/^\}code/) \
- or (@@flag[:code]==:tics \
+ or (@per.code==:tics \
&& t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/m)
- @@flag[:code]=:off
+ @per.code=:off
if @tuned_code[-1]
@tuned_code[-1].
gsub!(/\s*(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*\Z/m,'')
@@ -848,12 +834,12 @@ module SiSU_AO_DocumentStructureExtract
h={
obj: obj,
idx: idx,
- syntax: @@flag[:lngsyn],
+ syntax: @per.lngsyn,
tags: tags,
num: @num_id[:code_block],
number_: @codeblock_numbered,
}
- @@flag[:lngsyn]=:txt
+ @per.lngsyn=:txt
t_o=SiSU_AO_DocumentStructure::ObjectBlockTxt.new.code(h)
@tuned_code=[]
tuned_file << t_o
@@ -865,8 +851,8 @@ module SiSU_AO_DocumentStructureExtract
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
end
- if (@@flag[:code]==:curls \
- || @@flag[:code]==:tics) \
+ if (@per.code==:curls \
+ || @per.code==:tics) \
and t_o.is_a?(String)
sub_array=t_o.dup + "#{Mx[:br_nl]}"
@line_mode=[]
@@ -875,23 +861,23 @@ module SiSU_AO_DocumentStructureExtract
@tuned_code << t_o
t_o=nil
end
- elsif (@@flag[:poem]==:curls \
- || @@flag[:poem]==:tics) \
- or (@@flag[:box]==:curls \
- || @@flag[:box]==:tics) \
- or (@@flag[:group]==:curls \
- || @@flag[:group]==:tics) \
- or (@@flag[:block]==:curls \
- || @@flag[:block]==:tics) \
- or (@@flag[:alt]==:curls \
- || @@flag[:alt]==:tics) \
- or (@@flag[:quote]==:open \
+ elsif (@per.poem==:curls \
+ || @per.poem==:tics) \
+ or (@per.box==:curls \
+ || @per.box==:tics) \
+ or (@per.group==:curls \
+ || @per.group==:tics) \
+ or (@per.block==:curls \
+ || @per.block==:tics) \
+ or (@per.alt==:curls \
+ || @per.alt==:tics) \
+ or (@per.quote==:open \
&& t_o =~/`:quote_close`/m) #not
- if (@@flag[:poem]==:curls \
+ if (@per.poem==:curls \
&& t_o =~/^\}poem$/m) \
- or (@@flag[:poem]==:tics \
+ or (@per.poem==:tics \
&& t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
- @@flag[:poem]=:off
+ @per.poem=:off
h={
is_for: :poem,
obj: '',
@@ -900,11 +886,11 @@ module SiSU_AO_DocumentStructureExtract
num: @num_id[:poem],
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
- elsif (@@flag[:box]==:curls \
+ elsif (@per.box==:curls \
&& t_o =~/^\}box/) \
- or (@@flag[:box]==:tics \
+ or (@per.box==:tics \
&& t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
- @@flag[:box]=:off
+ @per.box=:off
obj,tags=extract_tags(@tuned_block.join("\n"))
h={
obj: obj,
@@ -923,11 +909,11 @@ module SiSU_AO_DocumentStructureExtract
num: @num_id[:box],
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
- elsif (@@flag[:group]==:curls \
+ elsif (@per.group==:curls \
&& t_o =~/^\}group/) \
- or (@@flag[:group]==:tics \
+ or (@per.group==:tics \
&& t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
- @@flag[:group]=:off
+ @per.group=:off
obj,tags=extract_tags(@tuned_block.join("\n"))
h={
obj: obj,
@@ -945,11 +931,11 @@ module SiSU_AO_DocumentStructureExtract
num: @num_id[:group],
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
- elsif (@@flag[:block]==:curls \
+ elsif (@per.block==:curls \
&& t_o =~/^\}block/) \
- or (@@flag[:block]==:tics \
+ or (@per.block==:tics \
&& t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
- @@flag[:block]=:off
+ @per.block=:off
obj,tags=extract_tags(@tuned_block.join("\n"))
h={
obj: obj,
@@ -967,11 +953,11 @@ module SiSU_AO_DocumentStructureExtract
num: @num_id[:block],
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
- elsif (@@flag[:alt]==:curls \
+ elsif (@per.alt==:curls \
&& t_o =~/^\}alt/) \
- or (@@flag[:alt]==:tics \
+ or (@per.alt==:tics \
&& t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
- @@flag[:alt]=:off
+ @per.alt=:off
obj,tags=extract_tags(@tuned_block.join("\n"))
h={
obj: obj,
@@ -989,9 +975,9 @@ module SiSU_AO_DocumentStructureExtract
num: @num_id[:alt],
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
- elsif @@flag[:quote]==:open \
+ elsif @per.quote==:open \
and t_o =~/`:quote_close`/m
- @@flag[:quote]=:off
+ @per.quote=:off
h={
is_for: :quote,
idx: idx,
@@ -1000,7 +986,7 @@ module SiSU_AO_DocumentStructureExtract
num: @num_id[:quote],
}
t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
- elsif @@flag[:quote]==:open
+ elsif @per.quote==:open
t_o,tags=extract_tags(t_o)
h={
indent: 1,
@@ -1013,18 +999,18 @@ module SiSU_AO_DocumentStructureExtract
}
SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
end
- if (@@flag[:poem]==:curls \
- || @@flag[:poem]==:tics) \
- or (@@flag[:group]==:curls \
- || @@flag[:group]==:tics) \
- or (@@flag[:alt]==:curls \
- || @@flag[:alt]==:tics) \
+ if (@per.poem==:curls \
+ || @per.poem==:tics) \
+ or (@per.group==:curls \
+ || @per.group==:tics) \
+ or (@per.alt==:curls \
+ || @per.alt==:tics) \
and t_o =~/\S/ \
and t_o !~/^(?:\}(?:verse|code|box|alt|group|block)|(?:verse|code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|alt|group|block)\{)/ \
and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/ # fix logic
sub_array=t_o.dup
@line_mode=sub_array.scan(/.+/)
- type=if @@flag[:poem]==:curls or @@flag[:poem]==:tics
+ type=if @per.poem==:curls or @per.poem==:tics
t_o=SiSU_AO_DocumentStructureExtract::Build.new(@md,@line_mode).build_lines(type).join
poem=t_o.split(/\n\n/)
poem.each do |v|
@@ -1042,14 +1028,14 @@ module SiSU_AO_DocumentStructureExtract
else :group
end
end
- @verse_count+=1 if @@flag[:poem]==:curls or @@flag[:poem]==:tics
+ @verse_count+=1 if @per.poem==:curls or @per.poem==:tics
end
- if @@flag[:code]==:off
- if @@flag[:poem]==:curls or @@flag[:poem]==:tics \
- or @@flag[:box]==:curls or @@flag[:box]==:tics \
- or @@flag[:group]==:curls or @@flag[:group]==:tics \
- or @@flag[:alt]==:curls or @@flag[:alt]==:tics \
- or (@@flag[:quote]==:open and t_o =~/`:quote_close`/m)
+ if @per.code==:off
+ if @per.poem==:curls or @per.poem==:tics \
+ or @per.box==:curls or @per.box==:tics \
+ or @per.group==:curls or @per.group==:tics \
+ or @per.alt==:curls or @per.alt==:tics \
+ or (@per.quote==:open and t_o =~/`:quote_close`/m)
if t_o.is_a?(String)
t_o=t_o.gsub(/\n/m,"#{Mx[:br_nl]}").
gsub(/[ ][ ]/m,"#{Mx[:nbsp]*2}").
@@ -1070,6 +1056,24 @@ module SiSU_AO_DocumentStructureExtract
else tuned_file << t_o
end
end
+ tuned_file
+ end
+ def identify_parts
+ tuned_file=[]
+ @tuned_block,@tuned_code=[],[]
+ @@counter,@verse_count=0,0
+ @num_id={
+ code_block: 0,
+ poem: 0,
+ box: 0,
+ group: 0,
+ alt: 0,
+ quote: 0,
+ table: 0,
+ }
+ @metadata={}
+ @data,bibliography=SiSU_AO_References::Bibliography.new(@md,@data).biblio_extraction
+ tuned_file=extract_structure_loop(@data,tuned_file)
if @md.flag_endnotes
tuned_file << @pb
h={
@@ -1089,7 +1093,98 @@ module SiSU_AO_DocumentStructureExtract
tuned_file << SiSU_AO_DocumentStructure::ObjectHeading.new.heading_insert(h)
h={
obj: 'Endnotes'
- }
+ }
+ end
+ if @md.flag_auto_biblio
+ tuned_file << @pb
+ h={
+ ln: 1,
+ lc: 1,
+ obj: 'References',
+ autonum_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectHeading.new.heading_insert(h)
+ h={
+ ln: 4,
+ lc: 2,
+ obj: 'Bibliography',
+ name: 'biblio',
+ autonum_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectHeading.new.heading_insert(h)
+ h={
+ obj: 'Bibliography'
+ }
+ citenumber=0
+ bibliography.each do |c|
+ citenumber +=1 if c.is_a?(Hash)
+ if c[:is]==:book
+ h={
+ obj: %{[#{citenumber}] *{#{c[:author]}}* /{"#{c[:fulltitle]}"}/ #{c[:publisher]} (#{c[:year]}) #{c[:url]}},
+ tags: [c[:id]],
+ hang: 0,
+ indent: 2,
+ ocn_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
+ elsif c[:is]==:article
+ h={
+ obj: %{[#{citenumber}] *{#{c[:author]}}* /{"#{c[:title]}"}/ #{c[:journal]} #{c[:volume]} (#{c[:year]}) #{c[:url]}},
+ tags: [c[:id]],
+ hang: 0,
+ indent: 2,
+ ocn_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
+ end
+ end
+ elsif @md.flag_biblio
+ tuned_file << @pb
+ h={
+ ln: 1,
+ lc: 1,
+ obj: 'References',
+ autonum_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectHeading.new.heading_insert(h)
+ h={
+ ln: 4,
+ lc: 2,
+ obj: 'Bibliography',
+ name: 'biblio',
+ autonum_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectHeading.new.heading_insert(h)
+ h={
+ obj: 'Bibliography'
+ }
+ if bibliography.length > 0
+ tuned_file=extract_structure_loop(bibliography,tuned_file)
+ else
+ tuned_file, citations =
+ SiSU_AO_References::Citations.new(@md,tuned_file).songsheet # ao_references.rb
+ citenumber=0
+ citations.compact.each do |c|
+ citenumber +=1 if c.is_a?(Hash)
+ if c[:is]==:book
+ h={
+ obj: %{[#{citenumber}] *{#{c[:author]}}* /{#{c[:publication]}}/ (#{c[:year]})},
+ hang: 0,
+ indent: 2,
+ ocn_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
+ elsif c[:is]==:article
+ h={
+ obj: %{[#{citenumber}] *{#{c[:author]}}* /{"#{c[:title]}"}/ #{c[:publication]} editor #{c[:editor]} (#{c[:year]})},
+ hang: 0,
+ indent: 2,
+ ocn_: false,
+ }
+ tuned_file << SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
+ end
+ end
+ end
end
if @md.book_idx
tuned_file << @pb
@@ -1134,7 +1229,7 @@ module SiSU_AO_DocumentStructureExtract
obj: 'eof',
}
meta=SiSU_AO_DocumentStructure::ObjectMetadata.new.metadata(@metadata)
- [tuned_file,meta]
+ [tuned_file,meta,bibliography]
end
def table_rows_and_columns_array(table_str)
table=[]
@@ -1162,13 +1257,13 @@ module SiSU_AO_DocumentStructureExtract
SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h)
end
def build_lines(type=:none)
- lines,lines_new=@data,[]
- lines.each do |line|
+ lines=@data
+ lines.each.map do |line|
line=if line =~/\S/ \
and line !~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{|\}code)/ \
and line !~/^(?:```[ ]+code(?:\.[a-z][0-9a-z_]+)?|```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$)/ \
and not line.is_a?(Hash) #watch
- @@counter+=1 if @@flag[:code]==:curls or @@flag[:code]==:tics
+ @@counter+=1 if @per.code==:curls or @per.code==:tics
line=line.gsub(/\s\s/,"#{Mx[:nbsp]*2}").
gsub(/#{Mx[:nbsp]}\s/,"#{Mx[:nbsp]*2}")
line=line.gsub(/^/,"#{Mx[:gr_o]}codeline#{Mx[:gr_c]}") if type==:code # REMOVE try sort for texpdf special case
@@ -1180,9 +1275,8 @@ module SiSU_AO_DocumentStructureExtract
line.gsub(/\s*$/,"#{Mx[:br_nl]}")
else line
end
- lines_new << line
+ line
end
- lines_new
end
end
class Structure # this must happen early
diff --git a/lib/sisu/current/ao_endnotes.rb b/lib/sisu/current/ao_endnotes.rb
index 7c9ae067..508d798a 100644
--- a/lib/sisu/current/ao_endnotes.rb
+++ b/lib/sisu/current/ao_endnotes.rb
@@ -66,9 +66,8 @@ module SiSU_AO_Endnotes
end
def endnotes
data=@data
- @tuned_file=[]
endnote_ref=1
- data.each do |dob|
+ @tuned_file=data.each.map do |dob|
# manually numbered endnotes <!e(\d)!> <!e_(\d)!> -->
if @md.opt.selections.str =~/--no-asterisk|--no-annotate/
dob.obj=dob.obj.
@@ -89,20 +88,20 @@ module SiSU_AO_Endnotes
word_mode=endnote_call_number(word_mode)
dob.obj=word_mode.join(' ')
endnote_ref+=1
- when /~\^(?:\s|$)|<:e>/ #%note inserts endnotes previously gathered from /^(<!e[:_]!>|[-~]\{{3})/ (in earlier loop)
+ when /~\^(?:\s|$)/ #%note inserts endnotes previously gathered from /^(<!e[:_]!>|[-~]\{{3})/ (in earlier loop)
word_mode=dob.obj.scan(/\S+/m)
word_mode=endnote_call_number(word_mode)
dob.obj=word_mode.join(' ')
endnote_ref+=1
end
end
- @tuned_file << dob
- end
+ dob
+ end.flatten
@endnote_counter,
@endnote_counter_asterisk,
@endnote_counter_dag=
1,1,1
- @tuned_file=@tuned_file.flatten
+ @tuned_file
end
def endnote_call_number(words)
words.each do |word|
@@ -123,9 +122,9 @@ module SiSU_AO_Endnotes
"#{Mx[:en_b_o]}\*#{@endnote_counter_asterisk} ")
@endnote_counter_asterisk+=1
end
- when /~\^|<:e>/
+ when /~\^/
if @endnote_array
- word.gsub!(/~\^|<:e>/,
+ word.gsub!(/~\^/,
"#{@endnote_array[@endnote_counter-1]}")
@endnote_counter+=1
end
diff --git a/lib/sisu/current/ao_expand_insertions.rb b/lib/sisu/current/ao_expand_insertions.rb
index 3a749df3..3d4ea8cb 100644
--- a/lib/sisu/current/ao_expand_insertions.rb
+++ b/lib/sisu/current/ao_expand_insertions.rb
@@ -484,21 +484,19 @@ module SiSU_AO_Insertions
linked_title="#{m_pre}{#{m_txt} }#{lnk[:manifest]}#{m_note}\n\n"
tuned_file_tmp << linked_title
output_filetypes=output_filetypes_in_cmd(m_cmd,lnk)
- output_filetypes[:gen].each do |o_f|
- describe = o_f
- if describe
- tuned_file_tmp << if @u.remote #to double space <:br> at beginning of entry
- "#{Mx[:nbsp]*4} #{describe} "
+ output_filetypes[:gen].each do |desc|
+ if desc
+ tuned_file_tmp << if @u.remote
+ "#{Mx[:nbsp]*4} #{desc} "
else # remove ...
"[provide document placement host location]"
end
end
end
- output_filetypes[:src].each do |o_f|
- describe = o_f
- if describe
+ output_filetypes[:src].each do |desc|
+ if desc
tuned_file_tmp << if @u.remote
- "#{Mx[:nbsp]*4} #{describe} "
+ "#{Mx[:nbsp]*4} #{desc} "
else
"[provide document placement host location]"
end
diff --git a/lib/sisu/current/ao_hash_digest.rb b/lib/sisu/current/ao_hash_digest.rb
index bc86a485..0864989c 100644
--- a/lib/sisu/current/ao_hash_digest.rb
+++ b/lib/sisu/current/ao_hash_digest.rb
@@ -103,9 +103,8 @@ module SiSU_AO_Hash
#use md5 or to create hash of each ao object including ocn, & add into to each ao object
end
def endnote_digest(data)
- t_o_bit=[]
- data.each do |en_plus|
- t_o_bit <<= case en_plus
+ data.each.map do |en_plus|
+ case en_plus
when /#{Mx[:en_a_o]}|#{Mx[:en_b_o]}/
if en_plus =~/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/
t_o_txt,en_open,en_txt,en_close=
@@ -133,8 +132,7 @@ module SiSU_AO_Hash
end
else en_plus
end
- end
- t_o_bit.join
+ end.join
end
def stamped(t_o,hash_class) #decide what hash information is most useful, is compromise necessary?
t_o.obj=SiSU_TextRepresentation::Alter.new(t_o).strip_clean_of_extra_spaces
diff --git a/lib/sisu/current/ao_idx.rb b/lib/sisu/current/ao_idx.rb
index 0c9c8a43..defad2c3 100644
--- a/lib/sisu/current/ao_idx.rb
+++ b/lib/sisu/current/ao_idx.rb
@@ -61,8 +61,6 @@ module SiSU_AO_BookIndex
@rgx_idx=/#{Mx[:idx_o]}(?:.+?)#{Mx[:idx_c]}\s*/
@rgx_idx_ocn_seg=/(.+?)~(\d+)~(\S+)/
@rgx_idx_ocn=/(.+?)~(\d+)/
- @ocn_html_identifier=
- SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
@env ||=SiSU_Env::InfoEnv.new(@md.fns)
end
def indexing_song
@@ -261,13 +259,13 @@ module SiSU_AO_BookIndex
if a[:range]
idx[:sst_rel_html_seg][@o]=
idx[:sst_rel_html_seg][@o] +
- %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}/#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}#{Mx[:rel_c]}, }
+ %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}/#{a[:seg]}.html##{a[:ocn]}#{Mx[:rel_c]}, }
idx[:sst_rel][@t]=
idx[:sst_rel][@t] +
%{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=
idx[:html][@q] +
- %{<a href="#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}">#{a[:range]}</a>, }
+ %{<a href="#{a[:seg]}.html##{a[:ocn]}">#{a[:range]}</a>, }
idx[:xhtml][@q]=
idx[:xhtml][@q] +
%{<a href="#{a[:seg]}.xhtml#o#{a[:ocn]}">#{a[:range]}</a>, }
@@ -275,13 +273,13 @@ module SiSU_AO_BookIndex
elsif a[:ocn]
idx[:sst_rel_html_seg][@o]=
idx[:sst_rel_html_seg][@o] +
- %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}#{Mx[:rel_c]}, }
+ %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:seg]}.html##{a[:ocn]}#{Mx[:rel_c]}, }
idx[:sst_rel][@t]=
idx[:sst_rel][@t] +
%{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{a[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=
idx[:html][@q] +
- %{<a href="#{a[:seg]}.html##{@ocn_html_identifier}#{a[:ocn]}">#{a[:ocn]}</a>, }
+ %{<a href="#{a[:seg]}.html##{a[:ocn]}">#{a[:ocn]}</a>, }
idx[:xhtml][@q]=
idx[:xhtml][@q] +
%{<a href="#{a[:seg]}.xhtml#o#{a[:ocn]}">#{a[:ocn]}</a>, }
@@ -313,13 +311,13 @@ module SiSU_AO_BookIndex
if z[:range]
idx[:sst_rel_html_seg][@o]=
idx[:sst_rel_html_seg][@o] +
- %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}#{Mx[:rel_c]}, }
+ %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{z[:ocn]}#{Mx[:rel_c]}, }
idx[:sst_rel][@t]=
idx[:sst_rel][@t] +
%{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=
idx[:html][@q] +
- %{<a href="#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}">#{z[:range]}</a>, }
+ %{<a href="#{z[:seg]}.html##{z[:ocn]}">#{z[:range]}</a>, }
idx[:xhtml][@q]=
idx[:xhtml][@q] +
%{<a href="#{z[:seg]}.xhtml#o#{z[:ocn]}">#{z[:range]}</a>, }
@@ -327,13 +325,13 @@ module SiSU_AO_BookIndex
elsif z[:ocn]
idx[:sst_rel_html_seg][@o]=
idx[:sst_rel_html_seg][@o] +
- %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}#{Mx[:rel_c]}, }
+ %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:seg]}.html##{z[:ocn]}#{Mx[:rel_c]}, }
idx[:sst_rel][@t]=
idx[:sst_rel][@t] +
%{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{Mx[:rel_o]}#{z[:ocn]}#{Mx[:rel_c]}, }
idx[:html][@q]=
idx[:html][@q] +
- %{<a href="#{z[:seg]}.html##{@ocn_html_identifier}#{z[:ocn]}">#{z[:ocn]}</a>, }
+ %{<a href="#{z[:seg]}.html##{z[:ocn]}">#{z[:ocn]}</a>, }
idx[:xhtml][@q]=
idx[:xhtml][@q] +
%{<a href="#{z[:seg]}.xhtml#o#{z[:ocn]}">#{z[:ocn]}</a>, }
@@ -415,12 +413,9 @@ module SiSU_AO_BookIndex
tuned_file
end
def clean_index(data) #check on use of dob
- tuned_file=[]
- data.each do |para|
- para=para.gsub(/\n*#{@rgx_idx}/m,'')
- tuned_file << para
+ data.each.map do |para|
+ para.gsub(/\n*#{@rgx_idx}/m,'')
end
- tuned_file
end
end
end
diff --git a/lib/sisu/current/ao_images.rb b/lib/sisu/current/ao_images.rb
index c0c45712..38fde812 100644
--- a/lib/sisu/current/ao_images.rb
+++ b/lib/sisu/current/ao_images.rb
@@ -67,7 +67,6 @@ module SiSU_AO_Images
end
def images
data=@data
- tuned_file=[]
@rmgk=false
imagemagick_=true #imagemagick_=SiSU_Env::InfoSettings.new.program?('rmagick')
if imagemagick_
@@ -85,7 +84,7 @@ module SiSU_AO_Images
).warn
end
end
- data.each do |dob|
+ data.select do |dob|
unless dob.is ==:table
dob.obj=dob.obj.strip
if dob.obj =~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif)(?:\s*|\s+.+)?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/
@@ -179,9 +178,8 @@ module SiSU_AO_Images
dob.obj=dob.obj.gsub(/(#{Mx[:lnk_o]})\s*(\S+\.(?:png|jpg|gif))\s+/i,'\1\2 ')
end
end
- tuned_file << dob unless dob.nil?
+ dob unless dob.nil?
end
- tuned_file
end
end
end
diff --git a/lib/sisu/current/ao_misc_arrange.rb b/lib/sisu/current/ao_misc_arrange.rb
index e010eaca..d023c44f 100644
--- a/lib/sisu/current/ao_misc_arrange.rb
+++ b/lib/sisu/current/ao_misc_arrange.rb
@@ -189,7 +189,6 @@ module SiSU_AO_MiscArrangeText
end
def prepare_text
data=@data
- data_new=[],[]
if data[0] =~ /^#!\s*(?:\/usr\/bin\/env sisu|\/usr\/bin\/sisu)/ # remove bang from top #! (however file is stripped, so will be removed provided no content precedes it)
data[0]=data[0].gsub(/^#!\s*\/usr\/bin\/sisu/,'').
gsub(/^#!\s*\/usr\/bin\/env sisu/,'')
@@ -198,11 +197,10 @@ module SiSU_AO_MiscArrangeText
data[0]=data[0].gsub(/^(SiSU\s*[\d.]*)$/,'% \1').
gsub(/^(sisu-[\d.]+)$/,'% \1')
end
- data.each do |para|
+ data.each.map do |para|
para=conditional_headings(para)
- data_new << markup_blocks(para)
- end
- data_new=data_new.flatten
+ markup_blocks(para)
+ end.flatten
end
end
end
diff --git a/lib/sisu/current/ao_numbering.rb b/lib/sisu/current/ao_numbering.rb
index 31986a86..861bbf07 100644
--- a/lib/sisu/current/ao_numbering.rb
+++ b/lib/sisu/current/ao_numbering.rb
@@ -172,7 +172,6 @@ module SiSU_AO_Numbering
gsub(/#{Mx[:gl_bullet]}/,'')
end
def auto_number_heading_ie_title(data) #also does some segment naming
- @tuned_file=[]
if defined? @md.make.num_top \
and @md.make.num_top \
and @md.make.num_top !~/^$/
@@ -185,7 +184,7 @@ module SiSU_AO_Numbering
end
chapter_number_counter=0
data=data.compact
- data.each do |dob| #@md.seg_names << [additions to segment names]
+ @tuned_file=data.each.map do |dob| #@md.seg_names << [additions to segment names]
title_no=nil
if dob.is ==:heading \
&& dob.autonum_ \
@@ -274,9 +273,8 @@ module SiSU_AO_Numbering
dob.tags=set_tags(dob.tags,dob.name)
end
dob.tags=dob.tags.uniq if defined? dob.tags
- @tuned_file << dob
- end
- @tuned_file=@tuned_file.flatten
+ dob
+ end.flatten
end
def ocn(data) #and auto segment numbering increment
@tuned_file=SiSU_AO_DocumentStructureExtract::OCN.new(@md,data,@fnx,@process).ocn
@@ -287,10 +285,9 @@ module SiSU_AO_Numbering
@tuned_file
end
def minor_numbering(data) #and auto segment numbering increment
- @tuned_file=[]
number_small,letter_small=0,0
letter=%w( a b c d e f g h i j k l m n o p q r s t u v w x y z )
- data.each do |dob|
+ @tuned_file=data.each.map do |dob|
if dob.of ==:heading \
|| dob.of ==:heading_insert \
|| dob.of ==:para \
@@ -313,9 +310,8 @@ module SiSU_AO_Numbering
end
end
end
- @tuned_file << dob
- end
- @tuned_file=@tuned_file.flatten
+ dob
+ end.flatten
end
def leading_zeros_fixed_width_number(possible_seg_name)
if possible_seg_name.to_s =~/^([0-9]+?\.|[0-9]+)$/m #!~/[.,:-]+/
diff --git a/lib/sisu/current/ao_persist.rb b/lib/sisu/current/ao_persist.rb
new file mode 100644
index 00000000..72126c90
--- /dev/null
+++ b/lib/sisu/current/ao_persist.rb
@@ -0,0 +1,194 @@
+# encoding: utf-8
+=begin
+
+* Name: SiSU
+
+** Description: documents, structuring, processing, publishing, search
+*** document abstraction
+
+** Author: Ralph Amissah
+ <ralph@amissah.com>
+ <ralph.amissah@gmail.com>
+
+** Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Ralph Amissah,
+ All Rights Reserved.
+
+** License: GPL 3 or later:
+
+ SiSU, a framework for document structuring, publishing and search
+
+ Copyright (C) Ralph Amissah
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see <http://www.gnu.org/licenses/>.
+
+ If you have Internet connection, the latest version of the GPL should be
+ available at these locations:
+ <http://www.fsf.org/licensing/licenses/gpl.html>
+ <http://www.gnu.org/licenses/gpl.html>
+
+ <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html>
+
+** SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+** Hompages:
+ <http://www.jus.uio.no/sisu>
+ <http://www.sisudoc.org>
+
+** Git
+ <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
+ <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/current/ao_persist.rb;hb=HEAD>
+
+=end
+module SiSU_AO_Persist
+ class Persist
+ @@persistance=nil
+ attr_accessor :fns, :ao_arr, :idx_arr_sst, :idx_arr_tex, :idx_arr_html, :idx_arr_xhtml, :map_arr_nametags, :map_arr_ocn_htmlseg
+ def initialize(args=nil)
+ @@persistance=args=(args ? args : (@@persistance || persist_init_hash_values))
+ @fns=args[:fns]
+ @ao_arr=args[:ao_arr]
+ @idx_arr_sst=args[:idx_arr_sst]
+ @idx_arr_tex=args[:idx_arr_tex]
+ @idx_arr_html=args[:idx_arr_html]
+ @idx_arr_xhtml=args[:idx_arr_xhtml]
+ @map_arr_nametags=args[:map_arr_nametags]
+ @map_arr_ocn_htmlseg=args[:map_arr_ocn_htmlseg]
+ end
+ def fns
+ @fns
+ end
+ def ao_arr
+ @ao_arr
+ end
+ def idx_arr_sst
+ @idx_arr_sst
+ end
+ def idx_arr_tex
+ @idx_arr_tex
+ end
+ def idx_arr_html
+ @idx_arr_html
+ end
+ def idx_arr_xhtml
+ @idx_arr_xhtml
+ end
+ def map_arr_nametags
+ @map_arr_nametags
+ end
+ def map_arr_ocn_htmlseg
+ @map_arr_ocn_htmlseg
+ end
+ def persist_init_hash_values
+ {
+ fns: nil,
+ ao_arr: [],
+ idx_arr_sst: [],
+ idx_arr_tex: [],
+ idx_arr_html: [],
+ idx_arr_xhtml: [],
+ map_arr_nametags: [],
+ map_arr_ocn_htmlseg: [],
+ }
+ end
+ def persist_init
+ @@persistance=nil
+ Persist.new(persist_init_hash_values)
+ end
+ end
+ class PersistDocStructExt
+ @@persist=nil
+ attr_accessor :ocn, :lng, :lng_is, :code, :lngsyn, :poem, :block, :box, :group, :alt, :quote, :table, :table_to
+ def initialize(args=nil)
+ @@persist=args=(args ? args : (@@persist || persist_init_hash_values))
+ @ocn=args[:ocn]
+ @lng=args[:lng]
+ @lng_is=args[:lng_is]
+ @code=args[:code]
+ @lngsyn=args[:lngsyn]
+ @poem=args[:poem]
+ @block=args[:block]
+ @box=args[:box]
+ @group=args[:group]
+ @alt=args[:alt]
+ @quote=args[:quote]
+ @table=args[:table]
+ @table_to=args[:table_to]
+ end
+ def ocn
+ @ocn
+ end
+ def lng
+ @lng
+ end
+ def lng_is
+ @lng_is
+ end
+ def code
+ @code
+ end
+ def lngsyn
+ @lngsyn
+ end
+ def poem
+ @poem
+ end
+ def block
+ @block
+ end
+ def box
+ @box
+ end
+ def group
+ @group
+ end
+ def alt
+ @alt
+ end
+ def quote
+ @quote
+ end
+ def table
+ @table
+ end
+ def table_to
+ @table_to
+ end
+ def persist_init_hash_values
+ {
+ ocn: :on,
+ lng: :off,
+ lng_is: :doc_default,
+ code: :off,
+ lngsyn: :txt,
+ poem: :off,
+ block: :off,
+ box: :off,
+ group: :off,
+ alt: :off,
+ quote: :off,
+ table: :off,
+ table_to: :off,
+ }
+ end
+ def persist_init
+ @@persist=nil
+ PersistDocStructExt.new(persist_init_hash_values)
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/current/ao_references.rb b/lib/sisu/current/ao_references.rb
new file mode 100644
index 00000000..9a5e195b
--- /dev/null
+++ b/lib/sisu/current/ao_references.rb
@@ -0,0 +1,502 @@
+# encoding: utf-8
+=begin
+
+* Name: SiSU
+
+** Description: documents, structuring, processing, publishing, search
+*** system environment, resource control and configuration details
+
+** Author: Ralph Amissah
+ <ralph@amissah.com>
+ <ralph.amissah@gmail.com>
+
+** Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Ralph Amissah,
+ All Rights Reserved.
+
+** License: GPL 3 or later:
+
+ SiSU, a framework for document structuring, publishing and search
+
+ Copyright (C) Ralph Amissah
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see <http://www.gnu.org/licenses/>.
+
+ If you have Internet connection, the latest version of the GPL should be
+ available at these locations:
+ <http://www.fsf.org/licensing/licenses/gpl.html>
+ <http://www.gnu.org/licenses/gpl.html>
+
+ <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html>
+
+** SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+** Hompages:
+ <http://www.jus.uio.no/sisu>
+ <http://www.sisudoc.org>
+
+** Git
+ <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
+ <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/current/ao_references.rb;hb=HEAD>
+
+=end
+module SiSU_AO_References
+ class Bibliography
+ def initialize(md,data)
+ @md,@data=md,data
+ end
+ def sort_bibliography_array_by_author_year_title(bib)
+ if bib
+ bib.compact.sort_by do |c|
+ [c[:author_arr][0],c[:year],c[:title]]
+ end
+ end
+ end
+ def citation_in_prepared_bibliography(cite)
+ @cite=cite
+ def article
+ {
+ is: :article,
+ author_raw: nil,
+ author: nil,
+ author_arr: nil,
+ title: nil,
+ language: nil,
+ journal: nil,
+ volume: nil,
+ editor: nil,
+ year: nil,
+ where: nil,
+ url: nil,
+ note: nil,
+ short_name: nil,
+ id: nil,
+ }
+ end
+ def book
+ {
+ is: :book,
+ author_raw: nil,
+ author: nil,
+ author_arr: nil,
+ #editor: nil,
+ title: nil,
+ subtitle: nil,
+ fulltitle: nil,
+ language: nil,
+ publisher: nil,
+ edition: nil,
+ year: nil,
+ where: nil,
+ url: nil,
+ note: nil,
+ short_name: nil,
+ id: nil,
+ }
+ end
+ def citation_metadata
+ type=if @cite =~/^jo: \S+/m
+ :article
+ elsif @cite =~/^au: \S+/m
+ :book
+ end
+ if type
+ citeblock=@cite.split("\n")
+ if type == :article
+ citation=article
+ citeblock.select do |meta|
+ case meta
+ when /^((?:au|author):\s+)\S+/ #req
+ citation[:author_raw]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:ti|title):\s+)\S+/ #req
+ citation[:title]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:lng|language):\s+)\S+/
+ citation[:language]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:jo|journal):\s+)\S+/ #req?
+ citation[:journal]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:vo|volume):\s+)\S+/
+ citation[:volume]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:edr|editor):\s+)\S+/
+ citation[:editor]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:yr|year):\s+)\S+/ #req?
+ citation[:year]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:pst|publisher_state):\s+)\S+/
+ citation[:where]=/^#{$1}(.+)/.match(meta)[1]
+ when /^(url:\s+)\S+/
+ citation[:url]=/^#{$1}(.+)/.match(meta)[1]
+ when /^(note:\s+)\S+/
+ citation[:note]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:sn|shortname):\s+)\S+/
+ citation[:short_name]=/^#{$1}(.+)/.match(meta)[1]
+ when /^(id:\s+)\S+/
+ citation[:id]=/^#{$1}(.+)/.match(meta)[1]
+ end
+ end
+ end
+ if type == :book
+ citation=book
+ citeblock.select do |meta|
+ case meta
+ when /^((?:au|author):\s+)\S+/ #req
+ citation[:author_raw]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:ti|title):\s+)\S+/ #req
+ citation[:title]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:st|subtitle):\s+)\S+/
+ citation[:subtitle]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:lng|language):\s+)\S+/
+ citation[:language]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:pb|publisher):\s+)\S+/
+ citation[:publisher]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:edn|edition):\s+)\S+/
+ citation[:edition]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:yr|year):\s+)\S+/ #req?
+ citation[:year]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:pst|publisher_state):\s+)\S+/
+ citation[:where]=/^#{$1}(.+)/.match(meta)[1]
+ when /^(url:\s+)\S+/
+ citation[:url]=/^#{$1}(.+)/.match(meta)[1]
+ when /^(note:\s+)\S+/
+ citation[:note]=/^#{$1}(.+)/.match(meta)[1]
+ when /^((?:sn|shortname):\s+)\S+/
+ citation[:short_name]=/^#{$1}(.+)/.match(meta)[1]
+ when /^(id:\s+)\S+/
+ citation[:id]=/^#{$1}(.+)/.match(meta)[1]
+ end
+ end
+ end
+ if citation[:is]==:book
+ if citation[:subtitle]
+ citation[:fulltitle] = citation[:title] \
+ + ' - ' \
+ + citation[:subtitle]
+ else
+ citation[:fulltitle] = citation[:title]
+ end
+ end
+ citation[:author_arr]=citation[:author_raw].split(/;\s*/)
+ citation[:author]=citation[:author_arr].map do |author|
+ author.gsub(/(.+?),\s+(.+)/,'\2 \1').strip
+ end.join(', ').strip
+ unless citation[:short_name]
+ citation[:short_name]=%{#{c[:author]}, "#{c[:short_name]}" (#{c[:date]})}
+ end
+ end
+ citation
+ end
+ self
+ end
+ def biblio_extraction
+ bibliography=[]
+ biblioflag=false
+ code_flag=false
+ flag_code_curly=:not_code_curly
+ flag_code_tics=:not_code_tics
+ @data=@data.select do |t_o|
+ if t_o =~/^code\{/
+ flag_code_curly=:code_curly
+ elsif t_o =~/^\}code/
+ flag_code_curly=:not_code_curly
+ elsif t_o =~/^``` code/
+ flag_code_tics=:code_tics
+ elsif flag_code_tics ==:code_tics \
+ and t_o =~/^```/
+ flag_code_tics=:not_code_tics
+ end
+ code_flag=if flag_code_curly==:code_curly \
+ or flag_code_tics==:code_tics
+ true
+ else false
+ end
+ unless code_flag
+ if @md.flag_auto_biblio
+ if t_o =~/^1~biblio(?:graphy)?/
+ biblioflag = true
+ t_o
+ elsif t_o =~/^:?[B-D1]~/
+ biblioflag = false
+ t_o
+ elsif biblioflag
+ if t_o !~/\A%+ /
+ bibliography << citation_in_prepared_bibliography(t_o).citation_metadata
+ next
+ else
+ t_o
+ end
+ else t_o
+ end
+ elsif @md.flag_biblio
+ if t_o =~/^1~biblio(?:graphy)?/
+ biblioflag = true
+ next
+ elsif t_o =~/^:?[B-D]~/
+ next
+ elsif t_o =~/^:?[B-D1]~/
+ biblioflag = false
+ t_o
+ elsif biblioflag
+ if t_o !~/\A%+ /
+ bibliography << t_o
+ next
+ else
+ t_o
+ end
+ else t_o
+ end
+ else t_o
+ end
+ else t_o
+ end
+ end.compact
+ if @md.flag_auto_biblio \
+ and bibliography.length > 0
+ data_new=[]
+ bibliography=sort_bibliography_array_by_author_year_title(bibliography)
+ @data.select do |t_o|
+ if t_o =~/^1~biblio(?:graphy)?/
+ bibliography.each do |c|
+ if c[:is]==:book
+ <<-WOK
+
+!_ #{c[:author]}
+/{"#{c[:fulltitle]}"}/ #{c[:publisher]} (#{c[:year]})
+ WOK
+ elsif c[:is]==:article
+ <<-WOK
+
+!_ #{c[:author]}
+/{"#{c[:title]}"}/ #{c[:journal]} (#{c[:year]})
+ WOK
+ end
+ end
+ else data_new << t_o
+ end
+ end
+ @data=data_new
+ end
+ [@data,bibliography]
+ end
+ end
+ class Citations
+ def initialize(md='',data='')
+ @md,@data=md,data
+ #@biblio=[]
+ end
+ def songsheet
+ tuned_file,citations=citations_scan(@data)
+ [tuned_file,citations]
+ end
+ def sort_bibliography_array_by_author_year(bib)
+ bib.sort_by do |c|
+ [c[:author_raw],c[:year]]
+ #[c[:author_arr][0],c[:year],c[:title]]
+ end
+ end
+ def citations_regex
+ def pages_pattern
+ %r{(?:[,.:]?\s+(?:p{1,2}\.?\s+)?(?:\d+--?\d+)[,.]?\s+)?}
+ end
+ def editor_pattern
+ %r{(?<editor>(?:editor|edited by)\s+.+?)}
+ end
+ def year_pattern
+ %r{[(\[]?(?<year>\d{4})[\])]?[.,]?}
+ end
+ def authors_year_title_publication_editor_pages
+ /(?<authors>.+?)\s+#{year_pattern}\s+"(?<title>.+?)"\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})\s+#{editor_pattern}#{pages_pattern}/m # note ed. is usually edition rather than editor
+ end
+ def authors_title_publication_year_editor_pages
+ /(?<authors>.+?)\s+"(?<title>.+?)"\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})\s+#{year_pattern}\s+#{editor_pattern}#{pages_pattern}/m # note ed. is usually edition rather than editor
+ end
+ def authors_title_publication_editor_year_pages ###
+ /(?<authors>.+?)\s+"(?<title>.+?)"\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})\s+ed.\s+#{editor_pattern}#{year_pattern}#{pages_pattern}/m
+ # note ed. is usually edition rather than editor
+ end
+ def authors_title_publication_editor_pages_year ###
+ /(?<authors>.+?)\s+"(?<title>.+?)"\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})\s+#{editor_pattern}#{pages_pattern}#{year_pattern}/m # note ed. is usually edition rather than editor
+ end
+ def authors_year_title_publication_pages
+ /(?<authors>.+?)\s+#{year_pattern}\s+"(?<title>.+?)"\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})[,.;]?#{pages_pattern}/m
+ end
+ def authors_title_publication_year_pages
+ /(?<authors>.+?)\s+"(?<title>.+?)"\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})\s+#{year_pattern}\s+#{pages_pattern}/m
+ end
+ def authors_title_publication_pages_year ###
+ /(?<authors>.+?)\s+"(?<title>.+?)"\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})#{pages_pattern}#{year_pattern}/m
+ end
+ def authors_year_publication_pages
+ /(?<authors>.+?)\s+#{year_pattern}\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})#{pages_pattern}/m
+ end
+ def authors_publication_year_pages
+ /(?<authors>.+?)\s+(?:#{Mx[:fa_italics_o]}|#{Mx[:srcrgx_italics_o]})(?<publication>.+?)(?:#{Mx[:fa_italics_c]}|#{Mx[:srcrgx_italics_c]})[,.;]?\s+(?<publisher>.+?)?#{year_pattern}#{pages_pattern}[.;]?/m
+ end
+ self
+ end
+ def authors?(citations)
+ citations.each.map do |b|
+ if b =~ /^.+\s+::.+?:$/
+ c=/^(?<citation>.+?)\s+::(?<shortref>.+?):$/.match(b)
+ {
+ citation: c[:citation],
+ shortref: c[:shortref],
+ c[:shortref].to_s => c[:citation]
+ }
+ else { citation: b }
+ end
+ end
+ end
+ def long_and_short_ref?(citations) #could be useful, keep ... ectract shortref
+ citations.each.map do |b|
+ if b =~ /^.+\s+::.+?:$/
+ c=/^(?<citation>.+?)\s+::(?<shortref>.+?):$/.match(b)
+ {
+ citation: c[:citation],
+ shortref: c[:shortref],
+ c[:shortref].to_s => c[:citation]
+ }
+ else { citation: b }
+ end
+ end
+ end
+ def citation_detail(citations) #could be useful, keep ... extract shortref
+ bibahash=[]
+ number=0
+ missed=0
+ citations.select do |b|
+ z=if b =~citations_regex.authors_year_title_publication_editor_pages
+ c=citations_regex.authors_year_title_publication_editor_pages.match(b)
+ {
+ is: :article,
+ author_raw: c[:authors],
+ year: c[:year],
+ title: c[:title],
+ publication: c[:publication],
+ editor: c[:editor],
+ }
+ elsif b =~citations_regex.authors_title_publication_year_editor_pages
+ c=citations_regex.authors_title_publication_year_editor_pages.match(b)
+ {
+ is: :article,
+ author_raw: c[:authors],
+ year: c[:year],
+ title: c[:title],
+ publication: c[:publication],
+ editor: c[:editor],
+ }
+ elsif b =~citations_regex.authors_title_publication_editor_year_pages
+ c=citations_regex.authors_title_publication_editor_year_pages.match(b)
+ {
+ is: :article,
+ author_raw: c[:authors],
+ year: c[:year],
+ title: c[:title],
+ publication: c[:publication],
+ editor: c[:editor],
+ }
+ elsif b =~citations_regex.authors_title_publication_editor_pages_year
+ c=citations_regex.authors_title_publication_editor_pages_year.match(b)
+ {
+ is: :article,
+ author_raw: c[:authors],
+ year: c[:year],
+ title: c[:title],
+ publication: c[:publication],
+ editor: c[:editor],
+ }
+ elsif b =~citations_regex.authors_year_title_publication_pages
+ c=citations_regex.authors_year_title_publication_pages.match(b)
+ {
+ is: :article,
+ author_raw: c[:authors],
+ year: c[:year],
+ title: c[:title],
+ publication: c[:publication],
+ }
+ elsif b =~citations_regex.authors_title_publication_year_pages
+ c=citations_regex.authors_title_publication_year_pages.match(b)
+ {
+ is: :article,
+ author_raw: c[:authors],
+ year: c[:year],
+ title: c[:title],
+ publication: c[:publication],
+ }
+ elsif b =~citations_regex.authors_year_publication_pages
+ c=citations_regex.authors_year_publication_pages.match(b)
+ {
+ is: :book,
+ author_raw: c[:authors],
+ year: c[:year],
+ publication: c[:publication],
+ }
+ elsif b =~citations_regex.authors_publication_year_pages
+ c=citations_regex.authors_publication_year_pages.match(b)
+ {
+ is: :book,
+ author_raw: c[:authors],
+ year: c[:year],
+ publication: c[:publication],
+ }
+ else b
+ end
+ if not z.is_a?(NilClass) \
+ and z.is_a?(Hash) \
+ and z[:author_raw].length > 0
+ z[:author_arr]=z[:author_raw].split(/;\s*/)
+ z[:author]=z[:author_arr].map do |author|
+ author.gsub(/(.+?),\s+(.+)/,'\2 \1').strip
+ end.join(', ').strip
+ if @md.opt.act[:verbose_plus][:set]==:on \
+ || @md.opt.act[:maintenance][:set]==:on
+ number +=1 if z.is_a?(Hash)
+ missed +=1 if z.is_a?(String)
+ (z.is_a?(Hash)) \
+ ? (p '[' + number.to_s + '] ' + z.to_s)
+ : (p '<' + missed.to_s + '> ' + z.to_s)
+ end
+ end
+ bibahash << z if z.is_a?(Hash)
+ end
+ bibahash=sort_bibliography_array_by_author_year(bibahash.compact)
+ bibahash
+ end
+ def citations_scan(data)
+ citations=[]
+ #short_ref=[]
+ tuned_file = data.compact.select do |dob|
+ if dob.is !=:meta \
+ && dob.is !=:comment \
+ && dob.is !=:code \
+ && dob.is !=:table
+ if dob.obj =~/\.:.+?:\./
+ citations << dob.obj.scan(/\.:\s*(.+?)\s*:\./m)
+ #short_ref << dob.obj.scan(/\.:\s+(.+?)\s+::([^:]+)::\./m) #look at later
+ ##short_ref << dob.obj.scan(/\.:\s+(.+?)\s+::(.+?)::\./m) #look at later
+ #short_ref << dob.obj.scan(/\.:\s*(.+?)\s*(::(.+?):)?:\./m) #look at later
+ citations=citations.flatten.compact
+ dob.obj=dob.obj. #remove citations delimiter & helpers from text
+ gsub(/\.:|:\./,'')
+ end
+ end
+ dob if dob.is_a?(Object)
+ end
+ #bib=long_and_short_ref?(citations) #could be useful, keep ... extract shortref
+ citations=citation_detail(citations)
+ [tuned_file,citations]
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/current/ao_syntax.rb b/lib/sisu/current/ao_syntax.rb
index 554daae5..c3108668 100644
--- a/lib/sisu/current/ao_syntax.rb
+++ b/lib/sisu/current/ao_syntax.rb
@@ -61,8 +61,8 @@ module SiSU_AO_Syntax
end
end
class Markup
- def initialize(md='',data='')
- @md,@data=md,data
+ def initialize(md='',data='',biblio=[])
+ @md,@data,@bibliography=md,data,biblio
@data_new=[]
url_and_stub=SiSU_Env::InfoEnv.new.url
@output_url="#{url_and_stub.remote}"
@@ -221,6 +221,24 @@ module SiSU_AO_Syntax
end
def substitutions(dob)
dob=dob.dup
+ dob=if @md.flag_auto_biblio \
+ and @bibliography.length > 0
+ dob=if dob.is !=:meta \
+ && dob.is !=:heading_insert \
+ && dob.is !=:code \
+ && dob.is !=:comment \
+ && dob.is !=:table
+ @bibliography.each do |c|
+ if c[:id] and not c[:id].nil? and not c[:id].empty?
+ dob.obj=dob.obj.gsub(/#{c[:id]}/mi,c[:short_name])
+ end
+ end
+ dob
+ else dob
+ end
+ dob
+ else dob
+ end
dob=if defined? @md.substitution_match_list[:match_and_replace] \
and @md.substitution_match_list[:match_and_replace].is_a?(Array)
dob=if dob.is !=:meta \
diff --git a/lib/sisu/current/cgi_sql_common.rb b/lib/sisu/current/cgi_sql_common.rb
index 94f6126e..62bec041 100644
--- a/lib/sisu/current/cgi_sql_common.rb
+++ b/lib/sisu/current/cgi_sql_common.rb
@@ -537,14 +537,14 @@ module SiSU_CGI_SQL
<!-- SiSU Rights -->
<p class="tiny_left"><font color="#666666" size="2">
Generated by
- #{v[:project]} #{v[:version]} #{v[:date]} (#{v[:date_stamp]})
+ #{v.project} #{v.version} #{v.date} (#{v.date_stamp})
<br>
<a href="http://www.sisudoc.org" >
- <b>#{v[:project]}</b></a> <sup>&copy;</sup> Ralph Amissah
+ <b>#{v.project}</b></a> <sup>&copy;</sup> Ralph Amissah
1993, current 2014.
All Rights Reserved.
<br>
- #{v[:project]} is software for document structuring, publishing and search,
+ #{v.project} is software for document structuring, publishing and search,
<br>
<a href="http://www.jus.uio.no/sisu" >
www.jus.uio.no/sisu
@@ -574,7 +574,7 @@ module SiSU_CGI_SQL
</font></p>
</td><td valign="top" width="45%">
<p class="tiny_left"><font color="#666666" size="2">
- #{v[:project]} using:
+ #{v.project} using:
<br>Standard SiSU markup syntax,
<br>Standard SiSU meta-markup syntax, and the
<br>Standard SiSU <u>object citation numbering</u> and system, (object/text identifying/locating system)
@@ -601,7 +601,7 @@ module SiSU_CGI_SQL
</font></p>
</td><td valign="top" width="45%">
<p class="tiny_left"><font color="#666666" size="2">
- #{v[:project]}, developed using
+ #{v.project}, developed using
<a href="http://www.ruby-lang.org/en/">
Ruby
</a>
@@ -908,13 +908,11 @@ module SiSU_CGI_SQL
else nil
end
@search_regx=if unescaped_search #check
- search_regex=[]
- build=unescaped_search.scan(/\S+/).each do |g|
+ search_regex=unescaped_search.scan(/\S+/).each.map do |g|
(g.to_s =~/(AND|OR)/) \
- ? (search_regex << '|')
- : (search_regex << %{#{g.to_s}})
- end
- search_regex=search_regex.join(' ')
+ ? ('|')
+ : (%{#{g.to_s}})
+ end.join(' ')
search_regex=search_regex.gsub(/\s*\|\s*/,'|')
Regexp.new(search_regex, Regexp::IGNORECASE)
else nil
diff --git a/lib/sisu/current/constants.rb b/lib/sisu/current/constants.rb
index 7a23027d..175c2e70 100644
--- a/lib/sisu/current/constants.rb
+++ b/lib/sisu/current/constants.rb
@@ -62,6 +62,7 @@ Sfx={
txt_asciidoc: '.ad',
txt_markdown: '.md',
txt_rst: '.rst',
+ txt_orgmode: '.org',
html: '.html',
xhtml: '.xhtml',
xml: '.xml',
@@ -146,6 +147,26 @@ Mx={
sm_set_o: '◢', sm_set_c: '◣',
sm_subset_o: '◢', sm_subset_c: '◣',
vline: '┆', # ¦ |
+ src_bold_o: '!{', src_bold_c: '}!',
+ src_italics_o: '/{', src_italics_c: '}/',
+ src_underscore_o: '_{', src_underscore_c: '}_',
+ src_cite_o: '"{', src_cite_c: '}"',
+ src_insert_o: '+{', src_insert_c: '}+',
+ src_strike_o: '-{', src_strike_c: '}-',
+ src_superscript_o: '^{', src_superscript_c: '}^',
+ src_subscript_o: ',{', src_subscript_c: '}',
+ src_hilite_o: '*{', src_hilite_c: '}*',
+ src_monospace_o: '#{', src_monospace_c: '}#',
+ srcrgx_bold_o: '\!\{', srcrgx_bold_c: '\}\!',
+ srcrgx_italics_o: '\/\{', srcrgx_italics_c: '\}\/',
+ srcrgx_underscore_o: '_\{', srcrgx_underscore_c: '\}_',
+ srcrgx_cite_o: '"\{', srcrgx_cite_c: '\}"',
+ srcrgx_insert_o: '\+\{', srcrgx_insert_c: '\}\+',
+ srcrgx_strike_o: '\-\{', srcrgx_strike_c: '\}\-',
+ srcrgx_superscript_o: '\^\{', srcrgx_superscript_c: '\}\^',
+ srcrgx_subscript_o: ',\{', srcrgx_subscript_c: '\},',
+ srcrgx_hilite_o: '\*\{', srcrgx_hilite_c: '\}\*',
+ srcrgx_monospace_o: '\#\{', srcrgx_monospace_c: '\}\#',
}
Mx[:fa_bold_o]= "#{Mx[:fa_o]}b#{Mx[:fa_o_c]}"
Mx[:fa_bold_c]= "#{Mx[:fa_c_o]}b#{Mx[:fa_c]}"
@@ -220,16 +241,6 @@ Px={
subscript_o: '[', subscript_c: ']',
hilite_o: '*', hilite_c: '*',
monospace_o: '', monospace_c: '',
- po_bold_o: '!{', po_bold_c: '}!',
- po_italics_o: '/{', po_italics_c: '}/',
- po_underscore_o: '_{', po_underscore_c: '}_',
- po_cite_o: '"{', po_cite_c: '}"',
- po_insert_o: '+{', po_insert_c: '}+',
- po_strike_o: '-{', po_strike_c: '}-',
- po_superscript_o: '^{', po_superscript_c: '}^',
- po_subscript_o: ',{', po_subscript_c: '},',
- po_hilite_o: '*{', po_hilite_c: '}*',
- po_monospace_o: '#{', po_monospace_c: '}#',
lng_lst: SiSU_is.language_list?,
lng_lst_rgx: SiSU_is.language_list_regex?,
lv1: '*',
@@ -352,7 +363,7 @@ check:
#˝ " λ Ω β α π Ѫ Ж Я Ѳ ѳ Ф ✠ ㈣
Ѳ ѳ Ф
♩ ♭  ✠  ▭ ▬ ▪
-【】〖〗◢ ◣ ◀ ▶ ◘ ◙
+【】〖〗◢ ◣ ◀ ▶ ◘ ◙ « ▲ »
《》「」
‹ › ∗  ∴ ∷
'〔lv1〕','〔lv2〕','〔lv3〕','〔lv4〕','〔lv5〕','〔lv6〕','〔lv7〕','〔lv8〕','〔lv9〕'
diff --git a/lib/sisu/current/db_drop.rb b/lib/sisu/current/db_drop.rb
index acdae9da..b90a81e5 100644
--- a/lib/sisu/current/db_drop.rb
+++ b/lib/sisu/current/db_drop.rb
@@ -55,11 +55,11 @@
=end
module SiSU_DbDrop
+ require_relative 'utils_response' # utils_response.rb
class Drop
- require_relative 'utils_response' # utils_response.rb
+ include SiSU_Response
def initialize(opt,conn,db_info,sql_type)
@opt,@conn,@db_info,@sql_type=opt,conn,db_info,sql_type
- @ans=SiSU_Response::Response.new
case @sql_type
when :sqlite
cascade=''
@@ -82,7 +82,7 @@ module SiSU_DbDrop
case @sql_type
when :sqlite
puts msg_sqlite
- ans=@ans.response?('remove sql database?')
+ ans=response?('remove sql database?')
if ans \
and File.exist?(@db_info.sqlite.db)
@conn.close
@@ -133,7 +133,7 @@ module SiSU_DbDrop
rescue
case @sql_type
when :sqlite
- ans=@ans.response?('remove sql database?')
+ ans=response?('remove sql database?')
if ans and File.exist?(@db_info.sqlite.db); File.unlink(@db_info.sqlite.db)
end
else
diff --git a/lib/sisu/current/db_sqltxt.rb b/lib/sisu/current/db_sqltxt.rb
index a307dc1d..de717cc6 100644
--- a/lib/sisu/current/db_sqltxt.rb
+++ b/lib/sisu/current/db_sqltxt.rb
@@ -66,9 +66,9 @@ module SiSU_DbText
gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/m,'\1')
end
def clean_searchable_text_from_document_objects(arr)
- txt_arr,en=[],[]
+ en=[]
arr=(arr.is_a?(String)) ? [ arr ] : arr
- arr.each do |s|
+ txt_arr=arr.each.map do |s|
s=s.gsub(/#{Mx[:fa_o]}[a-z]{1,4}#{Mx[:fa_o_c]}/m,'').
gsub(/#{Mx[:fa_c_o]}[a-z]{1,4}#{Mx[:fa_c]}/m,'').
gsub(/<br>/m,' ')
@@ -77,25 +77,26 @@ module SiSU_DbText
gsub(/#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/m,'').
gsub(/ \s+/m,' ')
#p s if s =~/[^ \nA-Za-z0-9'"`?!#@$%^&*=+,.;:\[\]()<>{}‹›|\\\/~_-]/
- txt_arr << s
+ s
end
txt_arr=txt_arr << en
txt=txt_arr.flatten.join("\n")
special_character_escape(txt)
end
def clean_document_objects_body(arr)
- txt_arr,en,en_arr=[],[],[]
+ en=[]
arr=(arr.is_a?(String)) ? [ arr ] : arr
- arr.each do |s|
+ txt_arr=arr.each.map do |s|
en << s.scan(/#{Mx[:en_a_o]}\s*(.+?)\s*#{Mx[:en_a_c]}/m)
- s=s.gsub(/#{Mx[:en_a_o]}\s*(\d+).+?#{Mx[:en_a_c]}/m,'<sup>\1</sup>').
+ s=s.
+ gsub(/#{Mx[:en_a_o]}\s*(\d+).+?#{Mx[:en_a_c]}/m,
+ '<sup>\1</sup>').
gsub(/#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/m,'').
gsub(/ \s+/m,' ')
- txt_arr << s
+ s
end
- en.flatten.each do |e|
- e=e.sub(/^(\d+)\s*/,'<sup>\1</sup> ')
- en_arr << e
+ en_arr=en.flatten.each.map do |e|
+ e.sub(/^(\d+)\s*/,'<sup>\1</sup> ')
end
txt_arr=txt_arr << en_arr
txt=txt_arr.flatten.join("\n<br>")
@@ -106,7 +107,8 @@ module SiSU_DbText
arr=(arr.is_a?(String)) ? arr.split(/\n+/m) : arr
arr.each do |s|
s=s.gsub(/([*\/_-])\{(.+?)\}\1/m,'\2').
- gsub(/^(?:block|group|poem|code)\{/m,'').gsub(/^\}(?:block|group|poem|code)/m,'').
+ gsub(/^(?:block|group|poem|code)\{/m,'').
+ gsub(/^\}(?:block|group|poem|code)/m,'').
gsub(/\A(?:@\S+:\s+.+)\Z/m,'')
if s =~/^:A~/
if defined? @md.creator \
diff --git a/lib/sisu/current/dp.rb b/lib/sisu/current/dp.rb
index 4cf058e7..85264771 100644
--- a/lib/sisu/current/dp.rb
+++ b/lib/sisu/current/dp.rb
@@ -132,8 +132,14 @@ module SiSU_Param
@@md=@md
else @@md
end
- @@md.opt=@opt
- @@md
+ begin
+ @@md.opt=@opt
+ @@md
+ rescue
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
+ mark('has an existing option been selected?')
+ exit
+ end
end
class MdDefault
def rights(author,date)
@@ -891,9 +897,9 @@ module SiSU_Param
@doc={ lv: [] }
@doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','',''
@@publisher='SiSU scribe'
- attr_accessor :make,:env,:path,:file,:fn,:fns,:fno,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:sisu,:sisu_version,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_publisher,:contributor,:date,:date_created,:date_issued,:date_available,:date_valid,:date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:type,:format,:identifier,:source,:language,:language_original,:relation,:coverage,:rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv0,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:pageline,:num_top,:bold_match_list,:italics_match_list,:substitution_match_list,:emphasis_set_to,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:flag_tables,:vocabulary,:doc_css,:yaml,:lnk,:links,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:lang_code_insert,:en,:notes,:dgst,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy,:home_button_image,:home_button_links,:footer_links,:cover_image,:man_section
+ attr_accessor :make,:env,:path,:file,:fn,:fns,:fno,:fnb,:fnn,:fnt,:fnl,:flv,:fnz,:fnstex,:ocn,:sfx_src,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:sisu,:project_details,:ruby_version,:title,:subtitle,:full_title,:html_title,:subtitle_tex,:creator,:classify,:author_home,:author,:author_title,:author_nationality,:authors,:authorship,:translator,:illustrator,:prepared_by,:digitized_by,:subject,:description,:publisher,:current_publisher,:contributor,:date,:date_created,:date_issued,:date_available,:date_valid,:date_modified,:date_translated,:date_added_to_site,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:type,:format,:identifier,:source,:language,:language_original,:relation,:coverage,:rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:papersize_array,:toc,:lv0,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:lvs,:pagenew,:pagebreak,:pageline,:num_top,:bold_match_list,:italics_match_list,:substitution_match_list,:emphasis_set_to,:toc_lev_limit,:flag_biblio,:flag_auto_biblio,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:markup,:markup_instruction,:flag_tables,:vocabulary,:doc_css,:yaml,:lnk,:links,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:filesize,:user,:home,:hostname,:pwd,:firstseg,:programs,:author_copymark,:i18n,:lang,:lang_code_insert,:en,:notes,:dgst,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program,:ec,:opt,:sem_tag,:book_idx,:topic_register,:topic_register_array,:original,:writing_focus,:audio,:daisy,:home_button_image,:home_button_links,:footer_links,:cover_image,:man_section
def initialize(fns_array,opt)
- @env=@path,@file=@fn=@fns=@fno=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@make=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@sisu=@sisu_version=@ruby_version=@title=@subtitle=@full_title=@html_title=@subtitle_tex=@creator=@classify=@author_home=@author=@author_title=@author_nationality=@translator=@illustrator=@prepared_by=@digitized_by=@subject=@description=@publisher=@current_publisher=@contributor=@date=@date_created=@date_issued=@date_available=@date_valid=@date_modified=@date_translated=@date_added_to_site=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@type=@format=@identifier=@source=@language=@language_original=@relation=@coverage=@rights=@keywords=@comments=@abstract=@cls_loc=@cls_dewey=@cls_pg=@cls_isbn=@papersize=@toc=@lv0=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@pageline=@num_top=@bold_match_list=@italics_match_list=@substitution_match_list=@emphasis_set_to=@toc_lev_limit=@flag_tables=@vocabulary=@doc_css=@yaml=@lnk=@links=@prefix_a=@prefix_b=@suffix=@information=@contact=@icon=@ad_url=@ad_png=@ad_alt=@ad_began=@promo=@ad_home=@stmp=@stmpd=@sc_filename=@sc_number=@sc_date=@sc_time=@sc_info=@yamladdr=@locale=@wc_lines=@wc_words=@wc_bytes=@file_encoding=@filesize=@firstseg=@programs=@author_copymark=@i18n=@lang=@lang_code_insert=@en=@notes=@dgst=@generated=@heading_seg_first=@base_program=@topic_register=@original=@writing_focus=@audio=@home_button_image=@home_button_links=@cover_image=@man_section=nil
+ @env=@path,@file=@fn=@fns=@fno=@fnb=@fnn=@fnt=@fnl=@flv=@fnz=@fnstex=@ocn=@sfx_src=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@make=@flag_biblio=@flag_auto_biblio=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@sisu=@project_details=@ruby_version=@title=@subtitle=@full_title=@html_title=@subtitle_tex=@creator=@classify=@author_home=@author=@author_title=@author_nationality=@translator=@illustrator=@prepared_by=@digitized_by=@subject=@description=@publisher=@current_publisher=@contributor=@date=@date_created=@date_issued=@date_available=@date_valid=@date_modified=@date_translated=@date_added_to_site=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@type=@format=@identifier=@source=@language=@language_original=@relation=@coverage=@rights=@keywords=@comments=@abstract=@cls_loc=@cls_dewey=@cls_pg=@cls_isbn=@papersize=@toc=@lv0=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@pageline=@num_top=@bold_match_list=@italics_match_list=@substitution_match_list=@emphasis_set_to=@toc_lev_limit=@flag_tables=@vocabulary=@doc_css=@yaml=@lnk=@links=@prefix_a=@prefix_b=@suffix=@information=@contact=@icon=@ad_url=@ad_png=@ad_alt=@ad_began=@promo=@ad_home=@stmp=@stmpd=@sc_filename=@sc_number=@sc_date=@sc_time=@sc_info=@yamladdr=@locale=@wc_lines=@wc_words=@wc_bytes=@file_encoding=@filesize=@firstseg=@programs=@author_copymark=@i18n=@lang=@lang_code_insert=@en=@notes=@dgst=@generated=@heading_seg_first=@base_program=@topic_register=@original=@writing_focus=@audio=@home_button_image=@home_button_links=@cover_image=@man_section=nil
@data, @path, @fns, @fno, @opt=
fns_array,opt.pth,opt.fns,opt.fno,opt #@data used as data
@flag_tables,@set_header_title,@set_heading_top,@set_heading_seg,@heading_seg_first_flag,@flag_promo,@book_idx=
@@ -1008,22 +1014,35 @@ module SiSU_Param
@fnstex=@fns.gsub(/_/,'\_\-').gsub(/\./,'.\-')
@flag_endnotes,@flag_auto_endnotes,@flag_separate_endnotes=false,false,false
@flag_separate_endnotes_make=true
+ @flag_biblio,@flag_auto_biblio=false,false
ver=SiSU_Env::InfoVersion.instance
- @sisu_version=ver.get_version
+ @project_details=ver.get_version
@ruby_version=ver.rbversion
@generated=Time.now
fns_array=@data.dup
skip unless fns_array # consider
@code_flag=false
+ flag_code_curly=:not_code_curly
+ flag_code_tics=:not_code_tics
fns_array.each do |para| #% scan document
if para !~/^%+\s/ \
and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included
- raise "Old markup style in file #{@fns}, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n"
+ raise "Old markup style in file #{@fns}, current version #{@project_details.project} #{@project_details.version} #{@project_details.date_stamp} #{@project_details.date}:\n\t\t#{para}\n\n"
+ end
+ if para =~/^code\{/
+ flag_code_curly=:code_curly
+ elsif para =~/^\}code/
+ flag_code_curly=:not_code_curly
+ elsif para =~/^``` code/
+ flag_code_tics=:code_tics
+ elsif flag_code_tics ==:code_tics \
+ and para =~/^```/
+ flag_code_tics=:not_code_tics
end
- @code_flag=case para
- when /^code\{\s*$/ then true
- when /^\}code\s*$/ then false
- else @code_flag
+ @code_flag=if flag_code_curly==:code_curly \
+ or flag_code_tics==:code_tics
+ true
+ else false
end
regx_header=/^@\S+?:[+-]?\s/
if para =~regx_header \
@@ -1196,6 +1215,16 @@ module SiSU_Param
%{#{title}#{creator}}
).txt_grey if @opt.act[:verbose][:set]==:on
end
+ unless @code_flag
+ if para =~/^1~biblio(?:graphy)?/
+ @flag_auto_biblio,@flag_biblio=false,true
+ #@flag_biblio=true
+ elsif @flag_biblio ==true \
+ and @flag_auto_biblio ==false \
+ and para =~/^(?:au|author):/m
+ @flag_auto_biblio =true
+ end
+ end
if not @book_idx \
and para =~/^=\{(.+?)\}[\s`]*\Z/m
@book_idx=true
diff --git a/lib/sisu/current/git.rb b/lib/sisu/current/git.rb
index 0ec3520b..b8b5f106 100644
--- a/lib/sisu/current/git.rb
+++ b/lib/sisu/current/git.rb
@@ -132,14 +132,22 @@ module SiSU_Git
(found =~/bin\/git\b/) ? true : false
end
def make_dir_fnb
- FileUtils::mkdir_p(@git_path[:fnb]) unless FileTest.directory?(@git_path[:fnb])
- FileUtils::mkdir_p(@git_path[:doc]) unless FileTest.directory?(@git_path[:doc])
- FileUtils::mkdir_p(@git_path[:po]) unless FileTest.directory?(@git_path[:po])
- FileUtils::mkdir_p(@git_path[:pot]) unless FileTest.directory?(@git_path[:pot])
- FileUtils::mkdir_p(@git_path[:conf]) unless FileTest.directory?(@git_path[:conf])
- FileUtils::mkdir_p(@git_path[:image]) unless FileTest.directory?(@git_path[:image])
- #FileUtils::mkdir_p(@git_path[:audio]) unless FileTest.directory?(@git_path[:audio])
- #FileUtils::mkdir_p(@git_path[:video]) unless FileTest.directory?(@git_path[:video])
+ FileUtils::mkdir_p(@git_path[:fnb]) \
+ unless FileTest.directory?(@git_path[:fnb])
+ FileUtils::mkdir_p(@git_path[:doc]) \
+ unless FileTest.directory?(@git_path[:doc])
+ FileUtils::mkdir_p(@git_path[:po]) \
+ unless FileTest.directory?(@git_path[:po])
+ FileUtils::mkdir_p(@git_path[:pot]) \
+ unless FileTest.directory?(@git_path[:pot])
+ FileUtils::mkdir_p(@git_path[:conf]) \
+ unless FileTest.directory?(@git_path[:conf])
+ FileUtils::mkdir_p(@git_path[:image]) \
+ unless FileTest.directory?(@git_path[:image])
+ #FileUtils::mkdir_p(@git_path[:audio]) \
+ # unless FileTest.directory?(@git_path[:audio])
+ #FileUtils::mkdir_p(@git_path[:video]) \
+ # unless FileTest.directory?(@git_path[:video])
end
def git_init
unless FileTest.directory?("#{@git_path[:fnb]}/.git")
@@ -168,13 +176,23 @@ module SiSU_Git
p __LINE__
end
def copy_src_head
- if @opt.f_pth[:lng]
- FileUtils::cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}",@git_path[:doc])
+ if @opt.f_pth[:lng] \
+ and File.exist?("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}")
+ FileUtils::cp_r(
+ "#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}",
+ @git_path[:doc]
+ )
elsif @opt.fns =~/\.ssm\.sst/
ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm')
- FileUtils::cp_r("#{@env.path.pwd}/#{ssm}",@git_path[:doc])
- else
- FileUtils::cp_r("#{@env.path.pwd}/#{@opt.fns}",@git_path[:doc])
+ FileUtils::cp_r(
+ "#{@env.path.pwd}/#{ssm}",
+ @git_path[:doc]
+ )
+ elsif File.exist?("#{@env.path.pwd}/#{@opt.fns}")
+ FileUtils::cp_r(
+ "#{@env.path.pwd}/#{@opt.fns}",
+ @git_path[:doc]
+ )
end
end
def copy_related_sst_ssi
@@ -183,14 +201,21 @@ module SiSU_Git
file_array=IO.readlines(@opt.fns,'')
file_array.each do |f|
if f =~@rgx_doc_import
- doc_import = doc_import + f.scan(@rgx_doc_import).uniq.flatten
+ doc_import = doc_import \
+ + f.scan(@rgx_doc_import).uniq.flatten
end
end
doc_import.each do |f|
if @opt.f_pth[:lng]
- FileUtils::cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{f}",@git_path[:doc])
+ FileUtils::cp_r(
+ "#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{f}",
+ @git_path[:doc]
+ )
else
- FileUtils::cp_r("#{@env.path.pwd}/#{f}",@git_path[:doc])
+ FileUtils::cp_r(
+ "#{@env.path.pwd}/#{f}",
+ @git_path[:doc]
+ )
end
end
end
@@ -200,10 +225,19 @@ module SiSU_Git
and not @opt.act[:ao][:set]==:on
##SiSU_Assemble::Composite.new(@opt).read
#SiSU_AO::Source.new(@opt).read # -m
- "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst"
+ @env.processing_path.composite_file \
+ + '/' \
+ + @opt.fnb \
+ + '.ssm.sst'
elsif composite_src
- "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst"
- else "#{@env.path.pwd}/#{@opt.fns}"
+ @env.processing_path.composite_file \
+ + '/' \
+ + @opt.fnb \
+ + '.ssm.sst'
+ else
+ @env.path.pwd
+ + '/' \
+ + @opt.fns
end
end
def read_composite
diff --git a/lib/sisu/current/html.rb b/lib/sisu/current/html.rb
index 582773e5..3aab3be7 100644
--- a/lib/sisu/current/html.rb
+++ b/lib/sisu/current/html.rb
@@ -165,11 +165,10 @@ module SiSU_HTML
end
end
SiSU_Env::Clear.new(@opt.selections.str,@opt.fns,@md).param_instantiate
- @@flag,@@scr,@@seg,@@seg_endnotes,@@seg_subtoc,@@seg_ad={},{},{},{},{},{}
- @@seg_total,@@tracker,@@loop_count,@@tablehead,@@number_of_cols=0,0,0,0,0
- @@seg_name,@@seg_name_html,@@seg_subtoc_array,@@seg_endnotes_array,@@segtocband,@@tablefoot=Array.new(7){[]}
- @@filename_seg,@@seg_url,@@fn,@@to_lev4,@@get_hash_to,@@get_hash_fn='','','','','','',''
- @@is4=@@is3=@@is2=@@is1=@@heading1=@@heading2=@@heading3=@@heading4=0
+ @@flag,@@scr,@@seg,@@seg_endnotes,@@seg_subtoc={},{},{},{},{}
+ @@tracker=0
+ @@seg_name,@@seg_name_x,@@seg_subtoc_array,@@seg_endnotes_array,@@tablefoot=Array.new(5){[]}
+ @@filename_seg,@@seg_url,@@to_lev4,@@get_hash_to,@@get_hash_fn='','','','',''
end
end
private
@@ -262,8 +261,6 @@ module SiSU_HTML
@@firstseg=nil
def initialize(md=nil,data='')
@data,@md=data,md
- @ocn_html_identifier=
- SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
@tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) if @md
end
def songsheet #extracts toc for scroll & seg
@@ -378,7 +375,7 @@ WOK
title=if dob.ocn ==0 then linkname
else
@@toc[:scr] << '<br>'
- %{<b><a href="##{@ocn_html_identifier}#{dob.ocn}">#{linkname}</a></b>}
+ %{<b><a href="##{dob.ocn}">#{linkname}</a></b>}
end
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
@@ -420,7 +417,7 @@ WOK
end
else
@@toc[:scr] << '<br>'
- %{<b><a href="##{@ocn_html_identifier}#{dob.ocn}">#{linkname}</a></b>}
+ %{<b><a href="##{dob.ocn}">#{linkname}</a></b>}
end
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
@@ -537,7 +534,7 @@ WOK
}
f=@md.file.base_filename.html_seg(fnh)
p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
- lnk_n_txt=%{ <a href="#{f}##{@ocn_html_identifier}#{ocn}">
+ lnk_n_txt=%{ <a href="#{f}##{ocn}">
#{linkname}
</a>}
txt_obj={ txt: lnk_n_txt }
@@ -562,7 +559,7 @@ WOK
}
f=@md.file.base_filename.html_seg(fnh)
p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
- lnk_n_txt=%{ <a href="#{f}##{@ocn_html_identifier}#{ocn}">
+ lnk_n_txt=%{ <a href="#{f}##{ocn}">
#{linkname}
</a>}
txt_obj={ txt: lnk_n_txt }
diff --git a/lib/sisu/current/html_format.rb b/lib/sisu/current/html_format.rb
index 8f83219f..b350170f 100644
--- a/lib/sisu/current/html_format.rb
+++ b/lib/sisu/current/html_format.rb
@@ -60,7 +60,6 @@ module SiSU_HTML_Format
def initialize(md,ocn)
@md,@ocn=md,ocn.to_s
@ocn ||=''
- @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
@make=SiSU_Env::ProcessingSettings.new(@md)
end
def ocn_display
@@ -69,7 +68,7 @@ module SiSU_HTML_Format
or @ocn.empty?
''
else
- %{<label class="ocn"><a href="##{@ocn_html_identifier}#{@ocn}" class="lnkocn">#{@ocn}</a></label>}
+ %{<label class="ocn"><a href="##{@ocn}" class="lnkocn">#{@ocn}</a></label>}
end
else
''
@@ -84,10 +83,12 @@ module SiSU_HTML_Format
end
end
def id #w3c? "tidy" complains about numbers as identifiers ! annoying
- (@ocn==nil || @ocn.empty?) ? '' : %{id="#{Mx[:ocn_id_char]}#{@ocn}"}
+ (@ocn==nil || @ocn.empty?) \
+ ? '' : %{id="#{Mx[:ocn_id_char]}#{@ocn}"}
end
def goto
- (@ocn==nil || @ocn.empty?) ? '' : %{<a href="##{@ocn_html_identifier}#{@ocn}">}
+ (@ocn==nil || @ocn.empty?) \
+ ? '' : %{<a href="##{@ocn}">}
end
end
class HeadInformation
@@ -99,8 +100,9 @@ module SiSU_HTML_Format
@md=md
# DublinCore 1 - title
@bits=SiSU_Proj_HTML::Bits.new
- @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || [])
- @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || [])
+ @per=SiSU_HTML_Persist::Persist.new
+ @per.seg_name_x=SiSU_HTML::Seg.new.seg_name_x
+ @per.seg_name_x_tracker=SiSU_HTML::Seg.new.seg_name_x_tracker
@tocband_scroll,@tocband_segtoc=nil,nil
@stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet
@o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure
@@ -403,7 +405,7 @@ WOK
<head>
<meta charset="utf-8">
<title>
- #{@md.html_title}
+ #{@md.title.full}
</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
#{rdf.metatag_html}
@@ -615,9 +617,9 @@ WOK
super(md)
end
def dot_control_pre_next
- pre="#{@seg_name_html[@seg_name_html_tracker-1]}#{@md.lang_code_insert}#{Sfx[:html]}"
+ pre="#{@per.seg_name_x[@per.seg_name_x_tracker-1]}#{@md.lang_code_insert}#{Sfx[:html]}"
up=@toc
- nxt="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}"
+ nxt="#{@per.seg_name_x[@per.seg_name_x_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}"
if nxt=~/sisu_manifest\.html/
@file=SiSU_Env::FileOp.new(@md) if @md
if @file.output_dir_structure.by_language_code? \
@@ -643,7 +645,7 @@ WOK
#{the_table_close}}
end
def dot_control_pre
- pre="#{@seg_name_html[@seg_name_html_tracker-2]}#{@md.lang_code_insert}#{Sfx[:html]}"
+ pre="#{@per.seg_name_x[@per.seg_name_x_tracker-2]}#{@md.lang_code_insert}#{Sfx[:html]}"
up=@toc
nxt="#{@md.file.base_filename.html_segtoc}"
%{<table summary="segment hidden control pre" width="100%" border="0" cellpadding="0" bgcolor=#{the_color.grey_pale} align="center">
@@ -671,12 +673,12 @@ WOK
</a>
</td>}
pre=%{<td align="center" bgcolor=#{the_color.band1}>
- <a href="#{@seg_name_html[@seg_name_html_tracker-use]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top">
+ <a href="#{@per.seg_name_x[@per.seg_name_x_tracker-use]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top">
#{png_nav.pre}
</a>
</td>} if f_pre==true
nxt=%{<td align="center" bgcolor=#{the_color.band1}>
- <a href="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top">
+ <a href="#{@per.seg_name_x[@per.seg_name_x_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top">
#{png_nav.nxt}
</a>
</td>} if f_nxt==true
@@ -721,23 +723,6 @@ WOK
else ''
end
end
- def navigation_table
- %{<table summary="navigation segment table" width=#{the_width.table1} border="0" bgcolor="white" cellpadding="0">
-<tr><th width="#{@@indent['leve_1']}" align="right">
-</td>
-<td valign="top">
- <font size=2>}
- end
- def navigation_table1
- %{<table summary="navigation segment table1" width=#{the_width.table1} border="0" cellpadding=#{the_table_cellpad_box} bgcolor=#{the_color.table1} align="left">
-<tr><td valign="top">
- <font size="2">}
- end
- def navigation_table2
- %{<table summary="navigation segment table2" width=#{the_width.table2} border="0" cellpadding=#{the_table_cellpad_box} bgcolor=#{the_color.table2} align="left">
-<tr><td valign="top">
- <font size="2">}
- end
def credit
%{
<div class="main_column">
@@ -799,8 +784,8 @@ WOK
<head>
<meta charset="utf-8">
<title>
- #{@seg_name_html[@seg_name_html_tracker]} -
- #{@md.html_title}
+ #{@per.seg_name_x[@per.seg_name_x_tracker]} -
+ #{@md.title.main}
</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
#{rdf.metatag_html}
@@ -1161,7 +1146,6 @@ WOK
end
def subtoc_lev(tag,attrib)
@txt=clean(@txt)
- @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
txt=if @txt \
and @txt =~/<\/?i>|<a\s+name="\S+?">/mi
@txt.gsub(/<\/?i>|<a\s+name="\S+?">/mi,'') #removes name markers from subtoc, go directly to substantive text
@@ -1175,7 +1159,7 @@ WOK
gsub(/<a[\s]+name="-\d+"[\s]+href="#_\d+">&nbsp;<sup>\d+<\/sup>&nbsp;/m,'')
end
%{<#{tag} class="#{attrib}">
- <a href="##{@ocn_html_identifier}#{@ocn}"><i>#{txt}</i></a> #{note}
+ <a href="##{@ocn}"><i>#{txt}</i></a> #{note}
</#{tag}>}
end
def subtoc_lev5
diff --git a/lib/sisu/current/html_harvest_authors.rb b/lib/sisu/current/html_harvest_authors.rb
index cbbd153c..4a91b69f 100644
--- a/lib/sisu/current/html_harvest_authors.rb
+++ b/lib/sisu/current/html_harvest_authors.rb
@@ -322,7 +322,7 @@ module SiSU_HarvestAuthors
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="dc.title" content= "SiSU metadata harvest, Authors - SiSU information Structuring Universe, Structured information Serialised Units" />
<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" />
-<meta name="generator" content="#{sv[:project]} #{sv[:version]} of #{sv[:date_stamp]} (n*x and Ruby!)" />
+<meta name="generator" content="#{sv.project} #{sv.version} of #{sv.date_stamp} (n*x and Ruby!)" />
<link rel="generator" href="http://www.jus.uio.no/sisu/SiSU" />
<link href="#{css_path}" rel="stylesheet" >
<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
diff --git a/lib/sisu/current/html_harvest_topics.rb b/lib/sisu/current/html_harvest_topics.rb
index 58f92bcb..4b6f493c 100644
--- a/lib/sisu/current/html_harvest_topics.rb
+++ b/lib/sisu/current/html_harvest_topics.rb
@@ -158,10 +158,9 @@ module SiSU_HarvestTopics
end
idx_array[lang] <<=if @idx_list =~/;/
g=@idx_list.scan(/[^;]+/)
- idxl=[]
- g.each do |i|
+ g.each.map do |i|
i=i.strip
- idxl << {
+ {
filename: filename,
file: file,
rough_idx: i,
@@ -171,7 +170,6 @@ module SiSU_HarvestTopics
lang: lang
}
end
- idxl
else {
filename: filename,
file: file,
@@ -691,7 +689,7 @@ module SiSU_HarvestTopics
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="dc.title" content= "SiSU metadata harvest, Topics - SiSU information Structuring Universe, Structured information Serialised Units" />
<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" />
-<meta name="generator" content="#{sv[:project]} #{sv[:version]} of #{sv[:date_stamp]} (n*x and Ruby!)" />
+<meta name="generator" content="#{sv.project} #{sv.version} of #{sv.date_stamp} (n*x and Ruby!)" />
<link rel="generator" href="http://www.jus.uio.no/sisu/SiSU" />
<link href="#{css_path}" rel="stylesheet">
<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
diff --git a/lib/sisu/current/html_lite_shared.rb b/lib/sisu/current/html_lite_shared.rb
index aac53727..55e49bd2 100644
--- a/lib/sisu/current/html_lite_shared.rb
+++ b/lib/sisu/current/html_lite_shared.rb
@@ -75,7 +75,6 @@ module SiSU_FormatShared
else @@hname
end
@tab="\t"
- @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
@@tablehead,@@tablefoot=[],[]
@env=SiSU_Env::InfoEnv.new(@md.fns)
@base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html"
@@ -204,7 +203,7 @@ GSUB
%{<p class="#{h[:class]}" type="#{h[:type]}">#{h[:txt]}</a></p>\n} << "\n"
end
def lev_toc_hname
- %{<p class="toc#{@lv}" header="#{@hname}"><a href="##{@ocn_html_identifier}#{@ocn}">#{@txt}</a></p>\n} #<< "\n"
+ %{<p class="toc#{@lv}" header="#{@hname}"><a href="##{@ocn}">#{@txt}</a></p>\n} #<< "\n"
end
def lev_toc
h={ txt: txt, class: "toc#{@lv}", type: 'toc' }
diff --git a/lib/sisu/current/html_manifest.rb b/lib/sisu/current/html_manifest.rb
index 44094383..7cffad71 100644
--- a/lib/sisu/current/html_manifest.rb
+++ b/lib/sisu/current/html_manifest.rb
@@ -160,19 +160,19 @@ module SiSU_Manifest
%{<p class="tiny">#{the_url_decoration.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{the_url_decoration.xml_close}</p>}
end
end
- def summarize(id,file,pth='',rel='',url='',img='● ')
+ def summarize(desc,id,file,pth='',rel='',url='',img='● ')
size=(File.size("#{pth}/#{file}")/1024.00).to_s
kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
- @manifest[:txt] << "#{file} #{id} #{kb}\n"
- @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{rel}/#{file}">#{file}</a></p>#{url_make(url,file)}</td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
+ @manifest[:txt] << "#{file} #{desc} #{kb}\n"
+ @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{img}#{desc}</a></p></th><td><p class="small"><a href="#{rel}/#{file}">#{file}</a></p>#{url_make(url,file)}</td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
end
- def summarize_html_seg(id,file,pth='',rel='',url='',img='● ')
+ def summarize_html_seg(desc,id,file,pth='',rel='',url='',img='● ')
size=(File.size("#{pth}/#{file}")/1024.00).to_s
kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
- @manifest[:txt] << "#{file} #{id} #{kb}\n"
- @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{img}#{id}</a></p></th><td><p class="small"><a href="#{rel}/#{file}">#{file}</a></p>#{url_make(url,file)}</td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
+ @manifest[:txt] << "#{file} #{desc} #{kb}\n"
+ @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{img}#{desc}</a></p></th><td><p class="small"><a href="#{rel}/#{file}">#{file}</a></p>#{url_make(url,file)}</td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
end
- def summarize_sources(id,file,pth,rel,url)
+ def summarize_sources(desc,id,file,pth,rel,url)
sys=SiSU_Env::SystemCall.new
dgst=case @dg
when :sha512
@@ -194,9 +194,9 @@ module SiSU_Manifest
end
size=(File.size("#{pth}/#{file}")/1024.00).to_s
kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
- @manifest[:txt] << "#{file} #{id} #{kb}\n"
+ @manifest[:txt] << "#{file} #{desc} #{kb}\n"
@manifest[:html] << %{<tr>} \
- + %{<th class="left"><p class="norm"><a href="#{rel}/#{file}">#{id}</a></p></th>} \
+ + %{<th class="left"><p class="norm" id="#{id}"><a href="#{rel}/#{file}">#{desc}</a></p></th>} \
+ %{<td class="right"><p class="tiny"><a href="#{rel}/#{file}">#{file}</a> &nbsp;&nbsp;#{dgst[1]}#{url_make(url,file,:src)}</p></td>} \
+ %{<td class="right"><p class="right">#{kb}</p></td>} \
+ %{</tr>\n} \
@@ -246,7 +246,7 @@ module SiSU_Manifest
end
@m=@m.uniq
end
- def languages(id,file)
+ def languages(desc,file)
@manifest[:html] << %{<tr><th class="left"><div id="horizontal_links"><ul id="horizontal">\n}
published_manifests?.each do |l|
SiSU_Translate::Source.new(@md,@language,l[:n]).language_list
@@ -255,15 +255,15 @@ module SiSU_Manifest
end
@manifest[:html] << %{</ul></div></th></tr>\n}
end
- def published_languages(id)
+ def published_languages(desc)
published_manifests?.each do |l|
@manifest[:txt] << "#{l[:mu]} #{l[:l]}\n"
@manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:mu]}">#{l[:l]}</a></p></th><td><p class="norm">#{l[:l]}</p><p class="tiny">#{the_url_decoration.xml_open}<a href="#{l[:mu]}">#{l[:mu]}</a>#{the_url_decoration.xml_close}</p></td><td class="right"><p class="right">&nbsp;</p></td></tr>\n}
end
end
- def metadata(id,info)
+ def metadata(desc,id,info)
info=info.to_s.gsub(/(?:#{Mx[:br_line]}|\\)+/,'<br>')
- @manifest[:html] << %{<tr><th class="left"><p class="bold_left">#{id}:</p></th><td><p class="left">#{info}</p></td></tr>\n}
+ @manifest[:html] << %{<tr><th class="left"><p class="bold_left" id="#{id}">#{desc}:</p></th><td><p class="left">#{info}</p></td></tr>\n}
end
def links(url,lnk,target)
static=if url =~/^\.\// then url.gsub(/^\.(\.)?/,@base_url)
@@ -278,271 +278,278 @@ module SiSU_Manifest
pth=@f.output_path.html_seg.dir
rel=@f.output_path.html_seg.rel_sm
url=@f.output_path.html_seg.url
- id,file='HTML, table of contents (for segmented text)',@f.base_filename.html_segtoc
- summarize_html_seg(id,file,pth,rel,url,img)
+ desc,id,file='HTML, table of contents (for segmented text)','html',@f.base_filename.html_segtoc
+ summarize_html_seg(desc,id,file,pth,rel,url,img)
end
if FileTest.file?(@f.place_file.html_scroll.dir)==true
img=%{<img border="0" height="15" width="15" src="#{@image_path}/b_doc.png" alt="Full Text" /> }
pth=@f.output_path.html_scroll.dir
rel=@f.output_path.html_scroll.rel_sm
url=@f.output_path.html_scroll.url
- id,file='HTML, full length document',@f.base_filename.html_scroll
- summarize(id,file,pth,rel,url,img)
+ desc,id,file='HTML, full length document','html_scroll',@f.base_filename.html_scroll
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?(@f.place_file.html_book_index.dir)==true
pth=@f.output_path.html_seg.dir
rel=@f.output_path.html_seg.rel_sm
url=@f.output_path.html_seg.url
- id,file='HTML, (book type) index',@f.base_filename.html_book_index
- summarize(id,file,pth,rel,url)
+ desc,id,file='HTML, (book type) index','html_book',@f.base_filename.html_book_index
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.html_concordance.dir)==true
pth=@f.output_path.html_seg.dir
rel=@f.output_path.html_seg.rel_sm
url=@f.output_path.html_seg.url
- id,file='HTML, concordance file',@f.base_filename.html_concordance
- summarize(id,file,pth,rel,url)
+ desc,id,file='HTML, concordance file','concordance',@f.base_filename.html_concordance
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.epub.dir)==true
img=%{<img border="0" height="18" width="18" src="#{@image_path}/b_epub.png" alt="EPUB" /> }
- id,file='EPUB (Electronic Publication, e-book standard)',@f.base_filename.epub
+ desc,id,file='EPUB (Electronic Publication, e-book standard)','epub',@f.base_filename.epub
pth=@f.output_path.epub.dir
rel=@f.output_path.epub.rel_sm
url=@f.output_path.epub.url
- summarize(id,file,pth,rel,url,img)
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_letter}")==true
img=%{<img border="0" height="18" width="15" src="#{@image_path}/b_pdf.png" alt="PDF portrait" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, U.S. letter size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_letter}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, U.S. letter size, portrait/vertical document (recommended for printing)",'pdf_letter',"#{@f.base_filename.pdf_p_letter}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_letter}")==true
img=%{<img border="0" height="15" width="18" src="#{@image_path}/b_pdf.png" alt="PDF landscape" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, U.S. letter size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_letter}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, U.S. letter size, landscape/horizontal document (recommended for screen viewing)",'pdf_letter_landscape',"#{@f.base_filename.pdf_l_letter}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_a4}")==true
img=%{<img border="0" height="18" width="15" src="#{@image_path}/b_pdf.png" alt="PDF portrait" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, A4 size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_a4}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, A4 size, portrait/vertical document (recommended for printing)",'pdf_a4',"#{@f.base_filename.pdf_p_a4}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_a4}")==true
img=%{<img border="0" height="15" width="18" src="#{@image_path}/b_pdf.png" alt="PDF landscape" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, A4 size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_a4}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, A4 size, landscape/horizontal document (recommended for screen viewing)",'pdf_a4_landscape',"#{@f.base_filename.pdf_l_a4}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_a5}")==true
img=%{<img border="0" height="18" width="15" src="#{@image_path}/b_pdf.png" alt="PDF portrait" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, A5 (book) size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_a5}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, A5 (book) size, portrait/vertical document (recommended for printing)",'pdf_a5',"#{@f.base_filename.pdf_p_a5}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_a5}")==true
img=%{<img border="0" height="15" width="18" src="#{@image_path}/b_pdf.png" alt="PDF landscape" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, A5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_a5}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, A5 (book) size, landscape/horizontal document (recommended for screen viewing)",'pdf_a5_landscape',"#{@f.base_filename.pdf_l_a5}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_b5}")==true
img=%{<img border="0" height="18" width="15" src="#{@image_path}/b_pdf.png" alt="PDF portrait" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, B5 (book) size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_b5}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, B5 (book) size, portrait/vertical document (recommended for printing)",'pdf_b5',"#{@f.base_filename.pdf_p_b5}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_b5}")==true
img=%{<img border="0" height="15" width="18" src="#{@image_path}/b_pdf.png" alt="PDF landscape" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, B5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_b5}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, B5 (book) size, landscape/horizontal document (recommended for screen viewing)",'pdf_a5_landscape',"#{@f.base_filename.pdf_l_b5}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_legal}")==true
img=%{<img border="0" height="18" width="15" src="#{@image_path}/b_pdf.png" alt="PDF portrait" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, U.S. legal size, portrait/vertical document (recommended for printing)","#{@f.base_filename.pdf_p_legal}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, U.S. legal size, portrait/vertical document (recommended for printing)",'pdf_legal',"#{@f.base_filename.pdf_p_legal}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_legal}")==true
img=%{<img border="0" height="15" width="18" src="#{@image_path}/b_pdf.png" alt="PDF landscape" /> }
pth=@f.output_path.pdf.dir
rel=@f.output_path.pdf.rel_sm
url=@f.output_path.pdf.url
- id,file="PDF, U.S. legal size, landscape/horizontal document (recommended for screen viewing)","#{@f.base_filename.pdf_l_legal}"
- summarize(id,file,pth,rel,url,img)
+ desc,id,file="PDF, U.S. legal size, landscape/horizontal document (recommended for screen viewing)",'pdf_legal_landscape',"#{@f.base_filename.pdf_l_legal}"
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?(@f.place_file.odt.dir)==true
img=%{<img border="0" height="18" width="18" src="#{@image_path}/b_odf.png" alt="ODF/ODT" /> }
pth=@f.output_path.odt.dir
rel=@f.output_path.odt.rel_sm
url=@f.output_path.odt.url
- id,file='ODF:ODT (Open Document Format)',@f.base_filename.odt
- summarize(id,file,pth,rel,url,img)
+ desc,id,file='ODF:ODT (Open Document Format)','odt',@f.base_filename.odt
+ summarize(desc,id,file,pth,rel,url,img)
end
if FileTest.file?(@f.place_file.xhtml.dir)==true
pth=@f.output_path.xhtml.dir
rel=@f.output_path.xhtml.rel_sm
url=@f.output_path.xhtml.url
- id,file='ODF:ODT (Open Document Format)',@f.base_filename.odt
- id,file='XHTML',@f.base_filename.xhtml
- summarize(id,file,pth,rel,url)
+ desc,id,file='XHTML','xhtml',@f.base_filename.xhtml
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.xml_sax.dir)==true
pth=@f.output_path.xml_sax.dir
rel=@f.output_path.xml_sax.rel_sm
url=@f.output_path.xml_sax.url
- id,file='XML SAX',@f.base_filename.xml_sax
- summarize(id,file,pth,rel,url)
+ desc,id,file='XML SAX','xml_sax',@f.base_filename.xml_sax
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.xml_dom.dir)==true
pth=@f.output_path.xml_dom.dir
rel=@f.output_path.xml_dom.rel_sm
url=@f.output_path.xml_dom.url
- id,file='XML DOM',@f.base_filename.xml_dom
- summarize(id,file,pth,rel,url)
+ desc,id,file='XML DOM','xml_dom',@f.base_filename.xml_dom
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.xml_docbook_article.dir)==true
pth=@f.output_path.xml_docbook_article.dir
rel=@f.output_path.xml_docbook_article.rel_sm
url=@f.output_path.xml_docbook_article.url
- id,file='XML Docbook Book',@f.base_filename.xml_docbook_article
- summarize(id,file,pth,rel,url)
+ desc,id,file='XML Docbook Article','docbook_article',@f.base_filename.xml_docbook_article
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.xml_docbook_book.dir)==true
pth=@f.output_path.xml_docbook_book.dir
rel=@f.output_path.xml_docbook_book.rel_sm
url=@f.output_path.xml_docbook_book.url
- id,file='XML Docbook Book',@f.base_filename.xml_docbook_book
- summarize(id,file,pth,rel,url)
+ desc,id,file='XML Docbook Book','docbook',@f.base_filename.xml_docbook_book
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.xml_fictionbook.dir)==true
pth=@f.output_path.xml_fictionbook.dir
rel=@f.output_path.xml_fictionbook.rel_sm
url=@f.output_path.xml_fictionbook.url
- id,file='XML Fictionbook',@f.base_filename.xml_fictionbook
- summarize(id,file,pth,rel,url)
+ desc,id,file='XML Fictionbook','fictionbook',@f.base_filename.xml_fictionbook
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.xml_scaffold_structure_sisu.dir)==true
pth=@f.output_path.xml_scaffold_structure_sisu.dir
rel=@f.output_path.xml_scaffold_structure_sisu.rel_sm
url=@f.output_path.xml_scaffold_structure_sisu.url
- id,file='XML Scaffold sisu structure',@f.base_filename.xml_scaffold_structure_sisu
- summarize(id,file,pth,rel,url)
+ desc,id,file='XML Scaffold sisu structure','xml_scaffold',@f.base_filename.xml_scaffold_structure_sisu
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.xml_scaffold_structure_collapse.dir)==true
pth=@f.output_path.xml_scaffold_structure_collapse.dir
rel=@f.output_path.xml_scaffold_structure_collapse.rel_sm
url=@f.output_path.xml_scaffold_structure_collapse.url
- id,file='XML Scaffold collapsed structure',@f.base_filename.xml_scaffold_structure_collapse
- summarize(id,file,pth,rel,url)
+ desc,id,file='XML Scaffold collapsed structure','xml_collapsed',@f.base_filename.xml_scaffold_structure_collapse
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.info.dir)==true
pth=@f.output_path.texinfo.dir
rel=@f.output_path.texinfo.rel_sm
url=@f.output_path.texinfo.url
- id,file='Info file',@f.base_filename.info
- summarize(id,file,pth,rel,url)
+ desc,id,file='Info file','info',@f.base_filename.info
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.manpage.dir)==true
pth=@f.output_path.manpage.dir
rel=@f.output_path.manpage.rel_sm
url=@f.output_path.manpage.url
- id,file='Manpage',@f.base_filename.manpage
- summarize(id,file,pth,rel,url)
+ desc,id,file='Manpage','manpage',@f.base_filename.manpage
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.sqlite_discrete.dir)==true
- id,file='SQLite3 file',@f.base_filename.sqlite_discrete
+ desc,id,file='SQLite3 file','sqlite',@f.base_filename.sqlite_discrete
pth=@f.output_path.sqlite_discrete.dir
rel=@f.output_path.sqlite_discrete.rel_sm
url=@f.output_path.sqlite_discrete.url
- summarize(id,file,pth,rel,url)
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.txt.dir)==true
- id='Plaintext (UTF-8)'
+ desc,id='Plaintext (UTF-8)','text'
pth=@f.output_path.txt.dir
rel=@f.output_path.txt.rel_sm
url=@f.output_path.txt.url
file=@f.base_filename.txt
- summarize(id,file,pth,rel,url)
+ summarize(desc,id,file,pth,rel,url)
end
if FileTest.file?(@f.place_file.textile.dir)==true
- id='Textile text (UTF-8)'