From 0245c394af1a4a1400f87916bd10c398005f40da Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 14 Jun 2016 22:52:15 -0400 Subject: step4 some additional work --- .gitignore | 5 +- devnotes.org | 406 ---------- dub.sdl | 65 ++ makefile | 35 +- maker.org | 227 +++++- org/ao_abstract_doc_source.org | 228 +++--- org/ao_defaults.org | 5 +- org/ao_output_debugs.org | 48 +- org/ao_read_source_files.org | 30 +- org/output.org | 1601 ++++++++++++++++++++++++++++++++++++++ org/sdp.org | 233 ++++-- src/sdp.d | 144 +++- src/sdp/ao_abstract_doc_source.d | 219 +++--- src/sdp/ao_output_debugs.d | 48 +- src/sdp/ao_read_source_files.d | 28 +- src/sdp/ao_rgx.d | 5 +- src/sdp/output_hub.d | 1484 +++++++++++++++++++++++++++++++++++ subprojects/archived | 1 + subprojects/d2sqlite3 | 1 + subprojects/imageformats-d | 1 + subprojects/toml-d | 1 + tangle | 2 +- 22 files changed, 3993 insertions(+), 824 deletions(-) delete mode 100644 devnotes.org create mode 100644 dub.sdl create mode 100644 org/output.org create mode 100644 src/sdp/output_hub.d create mode 160000 subprojects/archived create mode 160000 subprojects/d2sqlite3 create mode 160000 subprojects/imageformats-d create mode 160000 subprojects/toml-d diff --git a/.gitignore b/.gitignore index dc50ab2..8baf90a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,12 @@ # git ls-files --others --exclude-from=.git/info/exclude #./.dub/** -.dub/** * !.gitignore !makefile !version.txt -!./dub.json +!dub.json +!dub.sdl +.dub/** !tangle !*.org !*.d diff --git a/devnotes.org b/devnotes.org deleted file mode 100644 index 7b64fa8..0000000 --- a/devnotes.org +++ /dev/null @@ -1,406 +0,0 @@ -#+TITLE: sdp (project) discussion -#+AUTHOR: Ralph Amissah -#+EMAIL: ralph.amissah@gmail.com -#+STARTUP: indent -#+LANGUAGE: en -#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t -#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc -#+OPTIONS: author:nil email:nil creator:nil timestamp:nil -#+PROPERTY: header-args :padline no :exports none :noweb yes -#+EXPORT_SELECT_TAGS: export -#+EXPORT_EXCLUDE_TAGS: noexport -#+PRIORITIES: A F E -#+TAGS: Amissah(A) Class(c) WEB(W) noexport(n) -#+FILETAGS: :sdp:dev:notes: -* sdp -** debug :debug: -objects -header -heading -poem verse ocn - -** tasks :tasks: -*** sisu_loop.d -**** TODO [#A] header extraction (make instructions & metadata) -***** metadata -title & author heading -***** make -****** header make: search and replace -****** auto-identify structure from make instructions -****** auto-number headings, with starting level as instructed in header make -**** markup -***** para markers: extract (hash store) & clean (remove from text) -place in hash - heading level, numeric - indent info, numeric: first, rest - bullet, bool -issue representing complex structures, consider using bits of json! -string h = "{ \"heading_level\": \"A\" }"; -string para_attrib = "{ \"indent_first\": 0, \"indent_rest\": 0, \"bullet\": false }"; -# string s = "{ -# \"indent_first\": 0, -# \"indent_rest\": 0, -# \"bullet\": false, -# \"name\": "", -# \"tags\": "", -# \"digest\": "", -# }"; -string para_attrib = "{ - \"indent_first\": 0, - \"indent_rest\": 0, - \"bullet\": false, -}"; -string obj_ids = "{ - \"name\": \"\", - \"tags\": \"\", - \"digest\": \"\", -}"; -string obj_lv = "{ - \"markup\": \"\", // [A-D1-4] lv - \"num_markup\": 0, // [0-7] ln - \"num_collapsed\": 0, // [0-7] lc -}"; -string obj_citation = "{ - \"ocn\": 0, // - \"on\": true, // -}"; - -***** structure as json? -odv -osp -node -parent - -you could keep ocn info (bool & number?) this way, consider - -also clean - block markers - book index! -***** inline markup of text for subsequent processing -regex substitution -search and replace inline ascii markup with less ambiguous utf-8 markers -****** footnotes count/number -**** TODO [#B] endnotes/ footnotes for doc objects other than paragraphs & headings various forms of grouped text -**** TODO [#C] ocn (on & off) -**** TODO [#B] headings -***** heading numbering? - -***** segment naming & id tags - -**** TODO [#B] backmatter -***** book index -clean from object, store under separate key -consider json -****** TODO [#B] book index sort -sort algorithm currently sorts A-Za-z need Aa-Zz -also main terms references need to follow main term ... placed under _a which is not always sorted first -***** bibliography -identify and store under separate hash -consider using json to structure -***** glossary -identify and store under separate hash? -**** DONE [#B] composite documents -import files - -<< path_to/file.sst - -*** cleanup - -*** ranges & node structure info: structure information (levels, ranges & relationships) -**** heading pointers -***** headings_array heading pointer -***** data_abstration_array heading pointer -**** ocn -**** heading -***** markup level [A-D1-4] -***** collapsed level [0-7] -**** parent -***** heading markup level [A-D1-4] -***** heading ocn -**** range, heading & children (till next heading of same level or higher (close level mark)) -***** array range (x..y) -includes sub headings and non-heading objects till next heading -debate whether to use relative or absolute values (i.e. array points) -***** ocn range (x..y) - -NodeStructureMetadata see node_jstr -abstract_doc: obj_att\|node_jstr\|node -emitter: ObjAttrib -heading_pointer -*** misc -**** temporarily turn off ocn - ---~# ---# --+# - -~# & -# - -**** parent & children -heading parent & children -paragraph parent - -**** dir (read using dlang lib) -**** how to deal with complex data structures? -try hashes with json - -**** read files -***** config -***** make -** compile :compile: - [[http://www.dprogramming.com/tutorial.php][tutorial]] - [[http://www.dprogramming.com/tutorial.php#newusers][tutorial new users]] -*** rdmd -rdmd --build-only --chatty -d-debug sdp.d -rdmd -d-debug sisu_ref0.d ../markup/test0.sst - -VER='sdp2' && rdmd --build-only --chatty lib/${VER}/sdp.d - -rdmd --makedepend --chatty -debug lib/sdp.d - -*** dmd :dmd: -dmd -de -w -unittest -debug sdp.d - -VER='sdp2' -dmd -debug -of./bin/${VER} lib/${VER}/sdp.d -VER='sdp2' && dmd -debug=checkdoc -of./bin/${VER} lib/${VER}/sdp.d - -VER='2' && dmd -debug=checkdoc -debug=summary -of./bin/sdp${VER} lib/sdp${VER}/sdp.d - -*** ldc2 :ldc: -ldc2 -d-debug=checkdoc -d-debug=summary -of=./bin/sdp lib/sdp/sdp.d - -ldc2 -de -w -unittest -d-debug sdp.d - -VER='2' && ldc2 -d-debug=checkdoc -d-debug=summary -of=./bin/sdp${VER} ./lib/sdp${VER}/sdp.d - -VER='2' && ldc2 -unittest -d-debug=summary -of=./bin/sdp${VER} lib/sdp${VER}/sdp.d -VER='2' && ldc2 -d-debug=checkdoc -d-debug=summary -of=./bin/sdp${VER} lib/sdp${VER}/sdp.d -VER='2' && ldc2 -d-debug=checkdoc -d-debug=summary -of=./bin/sdp${VER} lib/sdp${VER}/sdp.d - -VER='sdp2' && ldc2 -d-debug=objects -d-debug=summary -of=./bin/${VER} lib/${VER}/sdp.d - -VER='sdp0' -VER='sdp1' -VER='sdp2' -VER='sdp3' -VER='sdp' -ldc2 -d-debug -of=./bin/sisu_${VER} lib/${VER}/sdp.d -ldc2 -d-debug -of=./bin/sisu_${VER} lib/${VER}/sdp.d -ldc2 -d-debug=heading -of=./bin/sisu_${VER} lib/${VER}/sdp.d -ldc2 -d-debug=objects -of=./bin/sisu_${VER} lib/${VER}/sdp.d - -VER='sdp2' && ldc2 -d-debug=objects -d-debug=summary -of=./bin/sdp lib/${VER}/sdp.d - -// VER='2' && ldc2 -unittest -d-debug=insert -d-debug=objects -d-debug=headings -d-debug=summary -d-debug=checkdoc -d-debug=subheader -of=./bin/sdp${VER} lib/sdp${VER}/sdp.d - -**** remove later -binbuild="sdp1"; ldc2 -d-debug ./${binbuild}.d && time ./${binbuild} markup/test0.sst -binbuild="sdp1"; gdc -fdebug -o ./${binbuild} ./${binbuild}.d && time ./${binbuild} markup/test0.sst - -binbuild="sdp2" -ldc2 -release ./${binbuild}.d && time ./${binbuild} markup/test0.sst - -#cd lib -#ldc2 -d-debug -of=../bin/sdp0 sdp/sdp.d - -*** gdc :gdc: - [[http://wiki.dlang.org/GDC/Using_GDC][Using GDC]] -copy/symlink deps, and then "*.d **/*.d" - -gdc -o ./bin/sdp0 lib/sdp.d -VER='sdp2' && -gdc -o ./bin/${VER} lib/${VER}/sdp.d - -VER='sdp2' && gdc-5 -o ./bin/${VER} ./lib/${VER}/sdp.d - -VER='sdp2' && gdc-5 -o ./bin/${VER} ./lib/${VER}/sdp.d ./lib/${VER}/*.d - -# VER='sdp2' && gdc -o -d-debug=objects -d-debug=summary -of=./bin/${VER} lib/${VER}/sdp.d - -# check flags -# VER='sdp2' && gdc-5 -I. -O3 -fPIC -c -o ./bin/${VER} ./lib/${VER}/sdp.d - -**** remove later -binbuild="sdp1" -ldc2 -d-debug ${binbuild}.d && time ${binbuild} markup/test0.sst -gdc -fdebug -o ${binbuild} ${binbuild}.d && time ${binbuild} markup/test0.sst - -// gdc -release -o ./${binbuild} ./${binbuild}.d && time ./${binbuild} markup/test0.sst - -**** bug - -[http://forum.dlang.org/thread/mailman.284.1442659522.22025.digitalmars-d-learn@puremagic.com?page=3] - -[http://www.mail-archive.com/digitalmars-d-learn@puremagic.com/msg61467.html] - -?? -[https://github.com/Dicebot/Arch-PKGBUILDs/blob/master/gdc/folders.diff] -from -[https://www.mail-archive.com/d.gnu@puremagic.com/msg03844.html] - -[https://www.mail-archive.com/digitalmars-d-learn@puremagic.com/msg61470.html] - -*** run :run: - -sdp0 markup/test0.sst - -~utils/d/bin/sdp0 filename.sst -~utils/d/bin/sdp1 filename.sst - -cd markup -sdp0 test0.sst - -*** compile notes -**** ldc -import path[0] = /usr/include/d/ldc -import path[1] = /usr/include/d -**** gdc -gdmd -help -import path[0] = /usr/include/d/4.9/x86_64-linux-gnu -import path[1] = /usr/include/d/4.9 -**** dmd (non-free) install arch? -**** issues - -** run test :run:test: -*** sisu-markup-samples -cd /home/ralph/grotto/repo/git.repo/doc/sisu-markup-samples/data/samples/current -cd ~sisumarkupgit/data/samples/current - -time ~sdp/bin/sdp --html --no-assert en/viral_spiral.david_bollier.sst -time ~sdpdev/bin/sdp --html --no-assert en/viral_spiral.david_bollier.sst -time ~sdpniu/bin/sdp --html --no-assert en/viral_spiral.david_bollier.sst - -*** live-manual -cd ~/live-manual/manual - -time ~sdp/bin/sdp --html --no-assert en/live-manual.ssm -time ~sdpdev/bin/sdp --html --no-assert en/live-manual.ssm -time ~sdpniu/bin/sdp --html --no-assert en/live-manual.ssm - -** notes :notes: -**** read file -char[][] markup_sourcefile_content = split(cast(char[])read(fn_src), rgx_line_delimiter); -char[][] markup_sourcefile_content = markupSourceLineArray(markupSourceString(fn_src)); -*** build - -** book index -// [http://forum.dlang.org/post/k8of07$1bgu$1@digitalmars.com] -// [http://forum.dlang.org/post/dfyowpjhdaemhxhepfmk@forum.dlang.org] - // recast --- - // ocns ; sub ; main - string[][string][string] bookindex; - // as --- - // ocns ; sub ; main - string[]string[][string][] bookindex_the; - // with sorted main & sub - -// vim ./lib/sdp2/sisu_*.d -// vim **/sdp2/sisu_*.d - -// emacs **/sdp2/sisu_*.d & -// emacs ./lib/sdp2/sisu_*.d & - -** bugs :bugs: -**** batch processing issue with ldc, not dmd -ok with dmd issue with ldc -time ~dlang/bin/sdp --html --no-assert en/[a-eg-z]* -not ok -time ~dlang/bin/sdp --html --no-assert en/free_for_all.peter_wayner.sst en/gpl3.fsf.sst -works if: - poems removed from gpl3; - biblio removed from free for all -time ~dlang/bin/sdp --html --no-assert en/free_for_all.peter_wayner.sst en/gpl2.fsf.sst en/gpl3.fsf.sst -time ~dlang/bin/sdp --html --no-assert en/[fg]* -time ~dlang/bin/sdp --html --no-assert en/[a-z]* -leaving out free_for_all seems to make it ok -time ~dlang/bin/sdp --html --no-assert en/[a-eg-z]* -leaving out any two bibliography entries within free_for_all appears to fix the problem! - -works in dmd not in ldc2 - -Error in `/home/ralph/grotto/repo/git.repo/utils/d/bin/sdp2': corrupted double-linked list: 0x00000008b905b310 *** -in free_for_all bibliography first instance FatBrain ref -gets stuck after: -en/free_for_all.peter_wayner.sst - -**** master & imports e.g. live-manual works with dmd not ldc - -** desc :desc: -*** process files -.sst (text) regular -.ssm (master) contains either .sst or .ssi -.ssi (insert) processed within .ssm (or called into a .ssm by another .ssi) -*** header -**** metadata -**** make (@make:) -cover_image -home_button_image -home_button_text -footer -headings -num_top -breaks -substitute -bold -italics -emphasis -texpdf_font -css - -*** structure -document structure is determined by headings of different levels -headings must either -(a) be explicitly marked as such, or -(b) given by a regex (in the appropriate make header) that allows the program determine headings within text -types of heading: -**** document separators (A-D) -level A is the title -**** text headings (1-4) -**** header make heading regex -***** heading levels -****** markup level [A-D1-4] -****** markup level numbers [0-7] or [1-8] -****** collapsed level numbers [0-7] or [1-8] -****** nodes -****** json search segments? chapter equivalent, decide -***** switches, ocn on off (dummy header) -*** object attributes -types of object: -**** headings (document structure objects) -***** level -***** segment name -***** numbering -**** paragraphs -**** blocks -types of block object: -***** group -***** block -***** poem (verse) -***** code -***** table -***** quote -***** TODO alt? -*** paragraph attributes -types of paragraph attribute: -**** indent -***** paragraph (1 - 9) -***** first line level (1 - 9), & subsequent text level (1 - 9) -indent (first, rest), bullet -**** bullets -*** inline text (paragraph) attributes -bold, italics, emphasis, superscript, substcript, strike, add, monospace, footnote (number them) -types of text (within paragraph) attribute: -**** bold -**** italics -**** emphasis -**** underscore -**** strike -**** superscript -**** subscript -** package -*** dub - against dub: - [[http://forum.dlang.org/post/hmdyrzbbhbcgqwqznqwz@forum.dlang.org][against dub]] -** dlang general -*** books - [[http://wiki.dlang.org/Bookshttp://wiki.dlang.org/Books][D books]] - [[http://ddili.org/ders/d.en/index.html][programming in D]] diff --git a/dub.sdl b/dub.sdl new file mode 100644 index 0000000..1af641b --- /dev/null +++ b/dub.sdl @@ -0,0 +1,65 @@ +name "sdp" +description "sisu document parser." +homepage "http://sisudoc.org" +authors "Ralph Amissah" +copyright "©2016 Ralph Amissah" +license "AGPL-3+" +targetPath "./bin" +sourcePath "./src" +stringImportPaths "./views" +buildRequirements "disallowDeprecations" +configuration "sdp-release" { + name "release" + targetType "executable" + platforms "posix" + targetName "sdp" + buildOptions "releaseMode" "optimize" "inline" + postGenerateCommands "/usr/bin/notify-send -t 0 'D release executable ready' 'sdp'" +} +configuration "sdp-dmd" { + name "dmd" + targetType "executable" + platforms "posix" + #compiler "dmd" + targetName "sdp-dmd" + buildOptions "releaseMode" "optimize" "inline" + postGenerateCommands "/usr/bin/notify-send -t 0 'D dmd compiled test release executable ready' 'sdp-dmd'" +} +configuration "sdp-ldc" { + name "ldc" + targetType "executable" + platforms "posix" + #compiler "ldc2" + targetName "sdp-ldc" + buildOptions "releaseMode" "optimize" "inline" + postGenerateCommands "/usr/bin/notify-send -t 0 'D ldc2 compiled test release executable ready' 'sdp-ldc'" +} +configuration "sdp-debug" { + name "debuging" + targetType "executable" + platforms "posix" + targetName "sdp-debug" + debugVersions "checkdoc" + debugVersions "summary" + debugVersions "dumpdoc" + buildOptions "debugMode" "debugInfo" "optimize" + postGenerateCommands "/usr/bin/notify-send -t 0 'D (debug) executable ready' 'sdp-debug'" +} +configuration "sdp-tmp" { + name "tmp" + targetType "executable" + platforms "posix" + targetName "sdp-tmp" + debugVersions "tmp" + debugVersions "crap" + buildOptions "debugMode" "debugInfo" "optimize" + postGenerateCommands "/usr/bin/notify-send -t 0 'D (debug) executable ready' 'sdp-tmp'" +} +configuration "sdp-debug-clean" { + name "debug-clean" + targetType "executable" + platforms "posix" + targetName "sdp-debug-clean" + buildOptions "debugMode" "debugInfo" "optimize" + postGenerateCommands "/usr/bin/notify-send -t 0 'D (debug) executable ready' 'sdp-debug-clean'" +} diff --git a/makefile b/makefile index 0814f9f..a6c8b0b 100644 --- a/makefile +++ b/makefile @@ -16,7 +16,7 @@ RDMD_FLAGS=--build-only --compiler= DUB=dub DUB_FLAGS=-v --force --compiler= # SET_D_COMPILER=(one of: DMD LDC or GDC): -SET_D_COMPILER=DMD +SET_D_COMPILER=LDC SET_DC_FLAGS_DEBUG_EXTRA=-debug=dumpdoc DC=$($(SET_D_COMPILER)) DC_FLAGS=$($(shell echo $(SET_D_COMPILER)_FLAGS)) @@ -41,7 +41,7 @@ PRG_SRCDIR=./src PRG_BIN=$(PRG_NAME) PRG_BINDIR=./bin # ORG -ORG_VERSION=20160411 +ORG_VERSION=20160530 EMACSLISP=/usr/share/emacs/site-lisp EMACSLISP_ORG=~/.emacs.d/elpa/org-$($(shell echo $(ORG_VERSION))) EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-$($(shell echo $(ORG_VERSION))) @@ -63,6 +63,31 @@ dub: $(PRG_SRCDIR)/$(PRG_SRC) $(DUB) $(DUB_FLAGS)$(DC) debug_dub: $(PRG_SRCDIR)/$(PRG_SRC) $(DUB) $(DUB_FLAGS)$(DC) $(DUB_FLAGS_DEBUG) +# dmd +dub_dmd_release: expunge skel tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-release +dub_dmd_release_test: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-dmd +dub_dmd_debug: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-debug +dub_dmd_debug_clean: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-debug-clean +dub_dmd_tmp: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-tmp +# ldc2 +dub_ldc_release: expunge skel tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-release +dub_ldc_release_test: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-ldc +dub_ldc_debug: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-debug +dub_ldc_debug_clean: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-debug-clean +dub_ldc_tmp: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-tmp +# test releases +dub_release_test_dmd: tangle dub_dmd_release_test +dub_release_test_ldc: tangle dub_ldc_release_test rdmd: $(PRG_SRCDIR)/$(PRG_SRC) $(RDMD) $(RDMD_FLAGS)$(DC) $(DC_FLAGS) \ $(DC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ @@ -124,11 +149,13 @@ clean: expunge: rm -rf $(PRG_BINDIR); \ - rm -rf $(PRG_SRCDIR); + rm -rf $(PRG_SRCDIR)/$(PRG_NAME); distclean: expunge -distclean_and_init: expunge skel +distclean_and_init: expunge + mkdir -p $(PRG_SRCDIR)/$(PRG_NAME); \ + mkdir -p $(PRG_BINDIR); tangle: skel for f in $(ORGFILELIST); do \ ORGFILES="$$ORGFILES \"$$f\""; \ diff --git a/maker.org b/maker.org index 0bb9519..2cc2ea7 100644 --- a/maker.org +++ b/maker.org @@ -12,11 +12,11 @@ #+FILETAGS: :sdp:rel:makefile: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) -* sdp makefile :makefile: [[./org/sdp.org][sdp.org]] [[./org/][org/]] +* sdp makefile :makefile: ** TODO settings [+2] :settings: -*** alternative D compilers [+1] :compiler: -**** dmd :dmd: +*** alternative D compilers (dmd/ldc2/gdc) [+1] :compiler: +**** [#A] dmd :dmd: #+BEGIN_SRC makefile :tangle makefile DMD=dmd @@ -25,7 +25,7 @@ DMD_FLAGS_RELEASE=-O -release DMD_FLAG_BINOF=-of #+END_SRC -**** ldc2 :ldc: +**** [#A] ldc2 :ldc: #+BEGIN_SRC makefile :tangle makefile LDC=ldc2 @@ -34,7 +34,7 @@ LDC_FLAGS_RELEASE=-O4 -release LDC_FLAG_BINOF=-of= #+END_SRC -**** gdc :gdc: +**** TODO gdc :gdc: #+BEGIN_SRC makefile :tangle makefile GDC=gdc @@ -44,7 +44,7 @@ GDC_FLAGS_RELEASE=-march=native -O3 -pipe -frelease GDC_FLAG_BINOF=-o #+END_SRC -*** build tools :build:tool: +*** build tools (dub/rdmd) [+1] :build:tool: **** rdmd :rdmd: #+BEGIN_SRC makefile :tangle makefile @@ -52,28 +52,28 @@ RDMD=rdmd RDMD_FLAGS=--build-only --compiler= #+END_SRC -**** dub :dub: +**** [#A] dub :dub: #+BEGIN_SRC makefile :tangle makefile DUB=dub DUB_FLAGS=-v --force --compiler= #+END_SRC -*** TODO set/select: ~D compiler~ & ~debug flags~ [+1] [2/2] :select: +*** TODO [#A] set/select: ~D compiler~ & ~debug flags~ [+1] [2/2] :select: - [X] Set D_COMPILER (one of DMD LDC or GDC) - [X] Set debug flags (using DMD standard flag -debug=) -**** TODO [#A] SET compiler: "SET_D_COMPILER=": :compiler:select: +**** TODO SET compiler: "SET_D_COMPILER=": :compiler:select: [[http://wiki.dlang.org/Compilers][D Compilers wiki]] [[http://dlang.org/download.html][D Compilers download]] Set D_COMPILER one of DMD, LDC or GDC e.g.: SET_D_COMPILER=DMD #+BEGIN_SRC makefile :tangle makefile # SET_D_COMPILER=(one of: DMD LDC or GDC): -SET_D_COMPILER=DMD +SET_D_COMPILER=LDC #+END_SRC -**** TODO [#A] SET debug flags: "SET_DC_FLAGS_DEBUG_EXTRA=-debug=": :compiler:flags:debug: +**** TODO SET debug flags: "SET_DC_FLAGS_DEBUG_EXTRA=-debug=": :compiler:flags:debug: Set debug flags using DMD standard flag -debug= e.g.: SET_DC_FLAGS_DEBUG_EXTRA=-debug=headings -debug=bookindex SET_DC_FLAGS_DEBUG_EXTRA=-debug=headings -debug=footnotes -debug=endnotes @@ -180,7 +180,7 @@ PRG_BINDIR=./bin #+BEGIN_SRC makefile :tangle makefile # ORG -ORG_VERSION=20160411 +ORG_VERSION=20160530 EMACSLISP=/usr/share/emacs/site-lisp EMACSLISP_ORG=~/.emacs.d/elpa/org-$($(shell echo $(ORG_VERSION))) EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-$($(shell echo $(ORG_VERSION))) @@ -206,8 +206,9 @@ ORGDIR=$(shell echo `pwd`) - gitsnapshot *** build commands [+1] :build:compile: -**** build rebuild +**** build rebuild :build:rebuild: +***** compilers #+BEGIN_SRC makefile :tangle makefile all: tangle build @@ -222,15 +223,41 @@ makefile_new: make -k tangle_maker #+END_SRC -**** dub build rebuild +***** dub build rebuild :dub: + #+BEGIN_SRC makefile :tangle makefile dub: $(PRG_SRCDIR)/$(PRG_SRC) $(DUB) $(DUB_FLAGS)$(DC) debug_dub: $(PRG_SRCDIR)/$(PRG_SRC) $(DUB) $(DUB_FLAGS)$(DC) $(DUB_FLAGS_DEBUG) +# dmd +dub_dmd_release: expunge skel tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-release +dub_dmd_release_test: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-dmd +dub_dmd_debug: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-debug +dub_dmd_debug_clean: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-debug-clean +dub_dmd_tmp: tangle + $(DUB) $(DUB_FLAGS)dmd --config=sdp-tmp +# ldc2 +dub_ldc_release: expunge skel tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-release +dub_ldc_release_test: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-ldc +dub_ldc_debug: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-debug +dub_ldc_debug_clean: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-debug-clean +dub_ldc_tmp: tangle + $(DUB) $(DUB_FLAGS)ldc2 --config=sdp-tmp +# test releases +dub_release_test_dmd: tangle dub_dmd_release_test +dub_release_test_ldc: tangle dub_ldc_release_test #+END_SRC -**** rdmd build rebuild +***** rdmd build rebuild :rdmd: #+BEGIN_SRC makefile :tangle makefile rdmd: $(PRG_SRCDIR)/$(PRG_SRC) @@ -239,7 +266,9 @@ rdmd: $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_SRCDIR)/$(PRG_NAME)/$(PRG_SRC) #+END_SRC -**** debug +**** debug :debug: + +***** debug #+BEGIN_SRC makefile :tangle makefile debug: $(PRG_SRCDIR)/$(PRG_SRC) @@ -263,7 +292,7 @@ debug_gdc: $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_SRCDIR)/$(PRG_SRC) #+END_SRC -**** debug rdmd +***** debug rdmd #+BEGIN_SRC makefile :tangle makefile debug_rdmd: $(PRG_SRCDIR)/$(PRG_SRC) @@ -287,7 +316,9 @@ debug_rdmd_gdc: $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_SRCDIR)/$(PRG_NAME)/$(PRG_SRC) #+END_SRC -**** release +**** release :release: + +***** release #+BEGIN_SRC makefile :tangle makefile release: distclean tangle $(PRG_SRCDIR)/$(PRG_SRC) @@ -296,7 +327,7 @@ release: distclean tangle $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_SRCDIR)/$(PRG_SRC) #+END_SRC -**** release rdmd +***** release rdmd #+BEGIN_SRC makefile :tangle makefile release_rdmd: distclean tangle $(PRG_SRCDIR)/$(PRG_SRC) @@ -319,11 +350,13 @@ clean: expunge: rm -rf $(PRG_BINDIR); \ - rm -rf $(PRG_SRCDIR); + rm -rf $(PRG_SRCDIR)/$(PRG_NAME); distclean: expunge -distclean_and_init: expunge skel +distclean_and_init: expunge + mkdir -p $(PRG_SRCDIR)/$(PRG_NAME); \ + mkdir -p $(PRG_BINDIR); #+END_SRC *** Org Babel Tangle batch process command :tangle: @@ -387,10 +420,83 @@ gitsnapshot: distclean tangle #+END_SRC * conf misc -** dub.json :dub:description: - +** dub :dub:description: Every DUB package should contain a [[http://code.dlang.org/package-format?lang=json][dub.json]] (or [[http://code.dlang.org/package-format?lang=sdl][dub.sdl]]) +*** dub.sdl :sdl: + +#+BEGIN_SRC sh :tangle dub.sdl +name "sdp" +description "sisu document parser." +homepage "http://sisudoc.org" +authors "Ralph Amissah" +copyright "©2016 Ralph Amissah" +license "AGPL-3+" +targetPath "./bin" +sourcePath "./src" +stringImportPaths "./views" +buildRequirements "disallowDeprecations" +configuration "sdp-release" { + name "release" + targetType "executable" + platforms "posix" + targetName "sdp" + buildOptions "releaseMode" "optimize" "inline" + postGenerateCommands "/usr/bin/notify-send -t 0 'D release executable ready' 'sdp'" +} +configuration "sdp-dmd" { + name "dmd" + targetType "executable" + platforms "posix" + #compiler "dmd" + targetName "sdp-dmd" + buildOptions "releaseMode" "optimize" "inline" + postGenerateCommands "/usr/bin/notify-send -t 0 'D dmd compiled test release executable ready' 'sdp-dmd'" +} +configuration "sdp-ldc" { + name "ldc" + targetType "executable" + platforms "posix" + #compiler "ldc2" + targetName "sdp-ldc" + buildOptions "releaseMode" "optimize" "inline" + postGenerateCommands "/usr/bin/notify-send -t 0 'D ldc2 compiled test release executable ready' 'sdp-ldc'" +} +configuration "sdp-debug" { + name "debuging" + targetType "executable" + platforms "posix" + targetName "sdp-debug" + debugVersions "checkdoc" + debugVersions "summary" + debugVersions "dumpdoc" + buildOptions "debugMode" "debugInfo" "optimize" + postGenerateCommands "/usr/bin/notify-send -t 0 'D (debug) executable ready' 'sdp-debug'" +} +configuration "sdp-tmp" { + name "tmp" + targetType "executable" + platforms "posix" + targetName "sdp-tmp" + debugVersions "tmp" + debugVersions "crap" + buildOptions "debugMode" "debugInfo" "optimize" + postGenerateCommands "/usr/bin/notify-send -t 0 'D (debug) executable ready' 'sdp-tmp'" +} +configuration "sdp-debug-clean" { + name "debug-clean" + targetType "executable" + platforms "posix" + targetName "sdp-debug-clean" + buildOptions "debugMode" "debugInfo" "optimize" + postGenerateCommands "/usr/bin/notify-send -t 0 'D (debug) executable ready' 'sdp-debug-clean'" +} +#+END_SRC + +*** +dub.json+ :json: + +**** +sdp+ +#+BEGIN_SRC json :tangle no #+BEGIN_SRC json :tangle dub.json { "name" : "sdp", @@ -412,12 +518,13 @@ Every DUB package should contain a [[http://code.dlang.org/package-format?lang=j #+BEGIN_SRC sh :tangle .gitignore # git ls-files --others --exclude-from=.git/info/exclude #./.dub/** -.dub/** * !.gitignore !makefile !version.txt -!./dub.json +!dub.json +!dub.sdl +.dub/** !tangle !*.org !*.d @@ -434,7 +541,7 @@ Every DUB package should contain a [[http://code.dlang.org/package-format?lang=j #+END_SRC ** sh script to batch process emacs org babel tangle :shell_script:tangle: - [http://orgmode.org/manual/Batch-execution.html] + [[http://orgmode.org/manual/Batch-execution.html]] creates a shell batch script called "tangle", that will tangle (emacs org babel tangle) org files in ./org/ to create .d source files in ./src/sdp/ (similar functionality is contained within the "makefile" created by this @@ -446,7 +553,7 @@ babel tangle) org files in ./org/ to create .d source files in ./src/sdp/ DIR=`pwd` ORGFILES="" EMACSLISP=/usr/share/emacs/site-lisp -ORG_VERSION=20160411 +ORG_VERSION=20160530 EMACSLISP_ORG=~/.emacs.d/elpa/org-$($(shell echo $(ORG_VERSION))) EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-$($(shell echo $(ORG_VERSION))) # wrap each argument in the code required to call tangle on it @@ -466,6 +573,16 @@ emacs --batch -Q -q \ (kill-buffer)) '($ORGFILES)))" 2>&1 #|grep tangled #+END_SRC +* dub zfunc :zfunc: +** ,dubdmd :dmd: +#+BEGIN_SRC sh :tangle no +time dub --compiler=dmd -v --force +#+END_SRC + +** ,dubldc :ldc: +#+BEGIN_SRC sh :tangle no +time dub --compiler=ldc2 -v --force +#+END_SRC * D build notes :notes: ** compilers :compiler: *** [#A] dmd :dmd: @@ -521,10 +638,58 @@ http://code.dlang.org/docs/commandline Every DUB package should contain a [[http://code.dlang.org/package-format?lang=json][dub.json]] or [[http://code.dlang.org/package-format?lang=sdl][dub.sdl]] #+BEGIN_SRC sh -dub -v --combined --build-mode allAtOnce --compiler ldc2 --build release # --annotate -dub build sdp -v --combined --build-mode allAtOnce --compiler ldc2 +--compiler=dmd +--compiler=ldc2 + +--compiler=dmd -v --force +--compiler=ldc2 -v --force +#+END_SRC + +#+BEGIN_SRC sh +dub -v --force --debug=checkdoc --debug=summary --debug=dumpdoc +dub -v --force --build=release + +dub -v --combined --build-mode allAtOnce --build release # --annotate +dub build sdp -v --combined --build-mode allAtOnce dub describe dub build sdp -v --force --debug=checkdoc --debug=dumpdoc -dub build sdp -v --force --debug=checkdoc --debug=dumpdoc --compiler dmd -dub build sdp -v --force --debug=checkdoc --debug=dumpdoc --compiler ldc2 + +dub -v --force --build=release + +dub -v --force --config=sdp-debug +dub -v --force --config=sdp-release +dub -v --force --config=sdp-release --build=release + +dub --compiler=dmd --force -v --config=sdp-debug +dub --compiler=dmd --force -v --config=sdp-release + +# dmd +,dubdmd --config=sdp-debug-clean +# time ~sdp3/bin/sdp-debug-clean -v --html --no-assert en/autonomy_markup0.sst + +# ldc +# flags +,dubldc --config=sdp-release # sdp +# time ~sdp3/bin/sdp -v --html --no-assert en/autonomy_markup0.sst +,dubldc --config=sdp-debug # sdp-debug +# time ~sdp3/bin/sdp-debug -v --html --no-assert en/autonomy_markup0.sst +,dubldc --config=sdp-tmp # sdp-tmp +# time ~sdp3/bin/sdp-tmp -v --html --no-assert en/autonomy_markup0.sst +,dubldc --config=sdp-debug-clean # sdp-debug-clean +# time ~sdp3/bin/sdp-debug-clean -v --html --no-assert en/autonomy_markup0.sst + +#+END_SRC + +** make (emacs) + +#+BEGIN_SRC sh +make -k dub_dmd_release +make -k dub_dmd_debug +make -k dub_dmd_debug_clean +make -k dub_dmd_tmp + +make -k dub_ldc_release +make -k dub_ldc_debug +make -k dub_ldc_debug_clean +make -k dub_ldc_tmp #+END_SRC diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index d8f2637..3c82dba 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -17,7 +17,7 @@ * document abstraction :abstract:process: Process markup document, create document abstraction. -** pre loop processing :pre: +** 1. pre loop processing :pre: *** imports :imports: [[./ao_defaults.org][ao_defaults]] @@ -159,7 +159,7 @@ scope(exit) { } auto type = flags_type_init; auto dochead_make = parseJSON(header_make_jsonstr).object; -auto dochead_metadata = parseJSON(header_metadata_jsonstr).object; +auto dochead_meta = parseJSON(header_metadata_jsonstr).object; mixin ScreenTxtColors; int tell_lo(string color, int obj_cite_number, in char[] line) { writefln( @@ -226,7 +226,7 @@ auto heading_match_rgx = [ ]; #+END_SRC -** loop: process document body [+6] :loop: +** 2. loop: process document body [+6] :loop: *** loop scope :scope: #+name: abs_in_loop_body_00 @@ -279,11 +279,12 @@ if (type["code"] == TriState.on) { code_block(line, an_object, type); continue; #+END_SRC + **** non code objects (other blocks or regular text) [+4] :non_code: #+name: abs_in_loop_body_00 #+BEGIN_SRC d -} else if (!match(line, rgx.regular_parse_skip)) { +} else if (!matchFirst(line, rgx.regular_parse_skip)) { /+ object other than code block object (includes regular text paragraph) +/ #+END_SRC @@ -292,10 +293,10 @@ if (type["code"] == TriState.on) { #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -if (((match(line, rgx.heading_biblio) +if (((matchFirst(line, rgx.heading_biblio) || (type["heading_biblio"] == State.on))) -&& (!match(line, rgx.heading)) -&& (!match(line, rgx.comment))) { +&& (!matchFirst(line, rgx.heading)) +&& (!matchFirst(line, rgx.comment))) { /+ within block object: biblio +/ biblio_block(line, type, bib_entry, biblio_arr_json); continue; @@ -352,12 +353,12 @@ if (((match(line, rgx.heading_biblio) continue; #+END_SRC -***** not (yet) identified as being within block group [+3] +***** not identified as being within block group (could still be, or not) [+3] #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d } else { -/+ not within a block group +/ + /+ not within a block group +/ #+END_SRC ****** assert @@ -376,8 +377,8 @@ assertions_flag_types_block_status_none_or_closed(type); #+name: abs_in_loop_body_open_block_obj #+BEGIN_SRC d -if (match(line, rgx.block_open)) { - if (match(line, (rgx.block_poem_open))) { +if (matchFirst(line, rgx.block_open)) { + if (matchFirst(line, (rgx.block_poem_open))) { /+ poem to verse exceptions! +/ object_reset(an_object); processing.remove("verse"); @@ -415,8 +416,8 @@ if (match(line, rgx.block_open)) { tell_l("red", line); } assert( - match(line, rgx.book_index) - || match(line, rgx.book_index_open) + matchFirst(line, rgx.book_index) + || matchFirst(line, rgx.book_index_open) || type["book_index"] == State.on ); } @@ -424,8 +425,8 @@ if (match(line, rgx.block_open)) { ******* book index :bookindex: #+name: abs_in_loop_body_not_block_obj #+BEGIN_SRC d - if ((match(line, rgx.book_index)) - || (match(line, rgx.book_index_open)) + if ((matchFirst(line, rgx.book_index)) + || (matchFirst(line, rgx.book_index_open)) || (type["book_index"] == State.on )) { /+ book_index +/ book_index(line, book_idx_tmp, an_object, type); @@ -440,7 +441,7 @@ if (match(line, rgx.block_open)) { ******** matched: comment :comment:match: #+name: abs_in_loop_body_not_block_obj #+BEGIN_SRC d - if (auto m = match(line, rgx.comment)) { + if (auto m = matchFirst(line, rgx.comment)) { /+ matched comment +/ debug(comment) { tell_l("blue", line); @@ -457,8 +458,8 @@ if (match(line, rgx.block_open)) { ******** matched: header make :header: #+name: abs_in_loop_body_not_block_obj #+BEGIN_SRC d - } else if ((match(line, rgx.header_make)) - || (match(line, rgx.header_metadata)) + } else if ((matchFirst(line, rgx.header_make)) + || (matchFirst(line, rgx.header_metadata)) || (type["header_make"] == State.on && (line_occur["header_make"] > State.off)) || (type["header_metadata"] == State.on @@ -489,9 +490,9 @@ if (match(line, rgx.block_open)) { /+ heading make set +/ heading_make_set(line, line_occur, heading_match_rgx, type); } - if (auto m = match(line, rgx.heading)) { + if (matchFirst(line, rgx.heading)) { /+ heading match +/ - heading_match(line, line_occur, an_object, lv, collapsed_lev, type); + heading_match(line, line_occur, an_object, lv, collapsed_lev, type, dochead_meta); } else if (line_occur["para"] == State.off) { /+ para match +/ para_match(line, an_object, indent, bullet, type); @@ -585,9 +586,9 @@ if ((type["header_make"] == State.on) && (line_occur["header_make"] > State.off)) { /+ header_make instructions (current line empty) +/ auto dochead_metadata_and_make = - set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_metadata, dochead_make); + set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_meta, dochead_make); static assert(!isTypeTuple!(dochead_metadata_and_make)); - dochead_metadata = dochead_metadata_and_make[0]; + dochead_meta = dochead_metadata_and_make[0]; dochead_make = dochead_metadata_and_make[1]; header_set_common(line_occur, an_object, type); processing.remove("verse"); @@ -601,9 +602,9 @@ if ((type["header_make"] == State.on) && (line_occur["header_metadata"] > State.off)) { /+ header_metadata (current line empty) +/ auto dochead_metadata_and_make = - set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_metadata, dochead_make); - static assert(!isTypeTuple!(dochead_metadata_and_make)); - dochead_metadata = dochead_metadata_and_make[0]; + set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_meta, dochead_make); + static assert(!isTypeTuple!(dochead_meta)); + dochead_meta = dochead_metadata_and_make[0]; dochead_make = dochead_metadata_and_make[1]; header_set_common(line_occur, an_object, type); type["header_make"] = State.off; @@ -752,7 +753,7 @@ if (((contents_the_objects[$-1].is_a == "para") } #+END_SRC -** post loop processing :post: +** 3. post loop processing :post: *** misc @@ -923,7 +924,7 @@ auto t = tuple( document_the, dochead_make, - dochead_metadata, + dochead_meta, bookindex_unordered_hashes, biblio_ordered ); @@ -977,15 +978,15 @@ auto header_set_common( auto check_obj_cite_number_status(char[] line, ref int[string] type) { if ((!line.empty) && (type["obj_cite_number_status_multi_obj"] == TriState.off)) { /+ not multi-line object, check whether obj_cite_number is on or turned off +/ - if (match(line, rgx.obj_cite_number_block_marks)) { + if (matchFirst(line, rgx.obj_cite_number_block_marks)) { /+ switch off obj_cite_number +/ - if (match(line, rgx.obj_cite_number_off_block)) { + if (matchFirst(line, rgx.obj_cite_number_off_block)) { type["obj_cite_number_status_multi_obj"] = TriState.on; debug(ocnoff) { tell_l("fuchsia", line); } } - if (match(line, rgx.obj_cite_number_off_block_dh)) { + if (matchFirst(line, rgx.obj_cite_number_off_block_dh)) { type["obj_cite_number_status_multi_obj"] = TriState.closing; debug(ocnoff) { tell_l("fuchsia", line); @@ -993,9 +994,9 @@ auto check_obj_cite_number_status(char[] line, ref int[string] type) { } } else { if (type["obj_cite_number_status_multi_obj"] == TriState.off) { - if (match(line, rgx.obj_cite_number_off)) { + if (matchFirst(line, rgx.obj_cite_number_off)) { type["obj_cite_number_status"] = TriState.on; - } else if (match(line, rgx.obj_cite_number_off_dh)) { + } else if (matchFirst(line, rgx.obj_cite_number_off_dh)) { type["obj_cite_number_status"] = TriState.closing; } else { // type["obj_cite_number_status"] = TriState.closing; @@ -1007,7 +1008,7 @@ auto check_obj_cite_number_status(char[] line, ref int[string] type) { } } } else if ((!line.empty) && (type["obj_cite_number_status_multi_obj"] > TriState.off)) { - if (auto m = match(line, rgx.obj_cite_number_off_block_close)) { + if (matchFirst(line, rgx.obj_cite_number_off_block_close)) { type["obj_cite_number_status_multi_obj"] = TriState.off; type["obj_cite_number_status"] = TriState.off; debug(ocnoff) { @@ -1036,7 +1037,7 @@ auto start_block( #+name: abs_functions #+BEGIN_SRC d - if (match(line, rgx.block_curly_code_open)) { + if (matchFirst(line, rgx.block_curly_code_open)) { /+ curly code open +/ debug(code) { // code (curly) open writefln( @@ -1049,7 +1050,7 @@ auto start_block( type["blocks"] = TriState.on; type["code"] = TriState.on; type["curly_code"] = TriState.on; - } else if (match(line, rgx.block_curly_poem_open)) { + } else if (matchFirst(line, rgx.block_curly_poem_open)) { /+ curly poem open +/ debug(poem) { // poem (curly) open writefln( @@ -1065,7 +1066,7 @@ auto start_block( type["verse_new"] = State.on; type["poem"] = TriState.on; type["curly_poem"] = TriState.on; - } else if (match(line, rgx.block_curly_group_open)) { + } else if (matchFirst(line, rgx.block_curly_group_open)) { /+ curly group open +/ debug(group) { // group (curly) open writefln( @@ -1078,7 +1079,7 @@ auto start_block( type["blocks"] = TriState.on; type["group"] = TriState.on; type["curly_group"] = TriState.on; - } else if (match(line, rgx.block_curly_block_open)) { + } else if (matchFirst(line, rgx.block_curly_block_open)) { /+ curly block open +/ debug(block) { // block (curly) open writefln( @@ -1091,7 +1092,7 @@ auto start_block( type["blocks"] = TriState.on; type["block"] = TriState.on; type["curly_block"] = TriState.on; - } else if (match(line, rgx.block_curly_quote_open)) { + } else if (matchFirst(line, rgx.block_curly_quote_open)) { /+ curly quote open +/ debug(quote) { // quote (curly) open writefln( @@ -1104,7 +1105,7 @@ auto start_block( type["blocks"] = TriState.on; type["quote"] = TriState.on; type["curly_quote"] = TriState.on; - } else if (match(line, rgx.block_curly_table_open)) { + } else if (matchFirst(line, rgx.block_curly_table_open)) { /+ curly table open +/ debug(table) { // table (curly) open writefln( @@ -1123,7 +1124,7 @@ auto start_block( #+name: abs_functions #+BEGIN_SRC d - } else if (match(line, rgx.block_tic_code_open)) { + } else if (matchFirst(line, rgx.block_tic_code_open)) { /+ tic code open +/ debug(code) { // code (tic) open writefln( @@ -1136,7 +1137,7 @@ auto start_block( type["blocks"] = TriState.on; type["code"] = TriState.on; type["tic_code"] = TriState.on; - } else if (match(line, rgx.block_tic_poem_open)) { + } else if (matchFirst(line, rgx.block_tic_poem_open)) { /+ tic poem open +/ debug(poem) { // poem (tic) open writefln( @@ -1151,7 +1152,7 @@ auto start_block( type["verse_new"] = State.on; type["poem"] = TriState.on; type["tic_poem"] = TriState.on; - } else if (match(line, rgx.block_tic_group_open)) { + } else if (matchFirst(line, rgx.block_tic_group_open)) { /+ tic group open +/ debug(group) { // group (tic) open writefln( @@ -1164,7 +1165,7 @@ auto start_block( type["blocks"] = TriState.on; type["group"] = TriState.on; type["tic_group"] = TriState.on; - } else if (match(line, rgx.block_tic_block_open)) { + } else if (matchFirst(line, rgx.block_tic_block_open)) { /+ tic block open +/ debug(block) { // block (tic) open writefln( @@ -1177,7 +1178,7 @@ auto start_block( type["blocks"] = TriState.on; type["block"] = TriState.on; type["tic_block"] = TriState.on; - } else if (match(line, rgx.block_tic_quote_open)) { + } else if (matchFirst(line, rgx.block_tic_quote_open)) { /+ tic quote open +/ debug(quote) { // quote (tic) open writefln( @@ -1190,7 +1191,7 @@ auto start_block( type["blocks"] = TriState.on; type["quote"] = TriState.on; type["tic_quote"] = TriState.on; - } else if (match(line, rgx.block_tic_table_open)) { + } else if (matchFirst(line, rgx.block_tic_table_open)) { /+ tic table open +/ debug(table) { // table (tic) open writefln( @@ -1225,7 +1226,7 @@ auto code_block( ref int[string] type ) { if (type["curly_code"] == TriState.on) { - if (auto m = match(line, rgx.block_curly_code_close)) { + if (matchFirst(line, rgx.block_curly_code_close)) { debug(code) { // code (curly) close tell_l("blue", line); } @@ -1236,10 +1237,10 @@ auto code_block( debug(code) { // code (curly) line tell_l("blue", line); } - an_object["obj"] ~= line ~= "\n"; // code (curly) line + an_object["obj"] ~= line ~= "\n"; // code (curly) line } } else if (type["tic_code"] == TriState.on) { - if (auto m = match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(code) { // code (tic) close tell_l("blue", line); } @@ -1250,7 +1251,7 @@ auto code_block( debug(code) { // code (tic) line tell_l("blue", line); } - an_object["obj"] ~= line ~= "\n"; // code (tic) line + an_object["obj"] ~= line ~= "\n"; // code (tic) line } } return 0; @@ -1351,7 +1352,7 @@ auto biblio_block( ref int bib_entry, ref string[] biblio_arr_json ) { - if (match(line, rgx.heading_biblio)) { + if (matchFirst(line, rgx.heading_biblio)) { type["heading_biblio"] = TriState.on; } if (empty(line) && (bib_entry == TriState.off)) { @@ -1366,7 +1367,7 @@ auto biblio_block( line ); } - if (match(line, rgx.biblio_tags)) { + if (matchFirst(line, rgx.biblio_tags)) { auto bt = match(line, rgx.biblio_tags); bib_entry = 0; st=to!string(bt.captures[1]); @@ -1448,7 +1449,7 @@ auto poem_block( string[string] obj_cite_number_poem ) { if (type["curly_poem"] == TriState.on) { - if (auto m = match(line, rgx.block_curly_poem_close)) { + if (matchFirst(line, rgx.block_curly_poem_close)) { an_object["obj"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( @@ -1507,7 +1508,7 @@ auto poem_block( obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); type["verse_new"] = State.off; - } else if (match(line, rgx.line_delimiter_only)) { + } else if (matchFirst(line, rgx.line_delimiter_only)) { verse_line = TriState.off; type["verse_new"] = State.on; } @@ -1548,7 +1549,7 @@ auto poem_block( } } } else if (type["tic_poem"] == TriState.on) { - if (auto m = match(line, rgx.block_tic_close)) { // tic_poem_close + if (auto m = matchFirst(line, rgx.block_tic_close)) { // tic_poem_close an_object["obj"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( @@ -1593,7 +1594,7 @@ auto poem_block( obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); type["verse_new"] = State.off; - } else if (match(line, rgx.line_delimiter_only)) { + } else if (matchFirst(line, rgx.line_delimiter_only)) { type["verse_new"] = State.on; verse_line = TriState.off; } @@ -1649,7 +1650,7 @@ auto group_block( ref int[string] type ) { if (type["curly_group"] == State.on) { - if (match(line, rgx.block_curly_group_close)) { + if (matchFirst(line, rgx.block_curly_group_close)) { debug(group) { // group (curly) close tell_l("blue", line); } @@ -1663,7 +1664,7 @@ auto group_block( an_object["obj"] ~= line ~= "\n"; // build group array (or string) } } else if (type["tic_group"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(group) { // group (tic) close tell_l("blue", line); } @@ -1691,7 +1692,7 @@ auto block_block( ref int[string] type ) { if (type["curly_block"] == TriState.on) { - if (match(line, rgx.block_curly_block_close)) { + if (matchFirst(line, rgx.block_curly_block_close)) { debug(block) { // block (curly) close tell_l("blue", line); } @@ -1705,7 +1706,7 @@ auto block_block( an_object["obj"] ~= line ~= "\n"; // build block array (or string) } } else if (type["tic_block"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(block) { // block (tic) close tell_l("blue", line); } @@ -1729,7 +1730,7 @@ auto block_block( #+BEGIN_SRC d auto quote_block(char[] line, ref string[string] an_object, ref int[string] type) { if (type["curly_quote"] == TriState.on) { - if (match(line, rgx.block_curly_quote_close)) { + if (matchFirst(line, rgx.block_curly_quote_close)) { debug(quote) { // quote (curly) close tell_l("blue", line); } @@ -1743,7 +1744,7 @@ auto quote_block(char[] line, ref string[string] an_object, ref int[string] type an_object["obj"] ~= line ~= "\n"; // build quote array (or string) } } else if (type["tic_quote"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(quote) { // quote (tic) close tell_l("blue", line); } @@ -1767,7 +1768,7 @@ auto quote_block(char[] line, ref string[string] an_object, ref int[string] type #+BEGIN_SRC d auto table_block(char[] line, ref string[string] an_object, ref int[string] type) { if (type["curly_table"] == TriState.on) { - if (match(line, rgx.block_curly_table_close)) { + if (matchFirst(line, rgx.block_curly_table_close)) { debug(table) { // table (curly) close tell_l("blue", line); } @@ -1781,7 +1782,7 @@ auto table_block(char[] line, ref string[string] an_object, ref int[string] type an_object["obj"] ~= line ~= "\n"; // build table array (or string) } } else if (type["tic_table"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(table) { // table (tic) close tell_l("blue", line); } @@ -2083,7 +2084,7 @@ auto header_extract( ref string[string] an_object, ref int[string] type ) { - if (auto m = match(line, rgx.header_make)) { + if (matchFirst(line, rgx.header_make)) { /+ matched header_make +/ debug(header1) { // header tell_l("yellow", line); @@ -2095,7 +2096,7 @@ auto header_extract( type["para"] = State.off; ++line_occur["header_make"]; an_object["obj"] ~= line ~= "\n"; - } else if (auto m = match(line, rgx.header_metadata)) { + } else if (matchFirst(line, rgx.header_metadata)) { /+ matched header_metadata +/ debug(header1) { // header tell_l("yellow", line); @@ -2110,7 +2111,7 @@ auto header_extract( } else if (type["header_make"] == State.on && (line_occur["header_make"] > State.off)) { /+ header_make flag set +/ - if (auto m = match(line, rgx.header_sub)) { + if (matchFirst(line, rgx.header_sub)) { /+ sub-header +/ debug(header1) { tell_l("yellow", line); @@ -2122,7 +2123,7 @@ auto header_extract( } else if (type["header_metadata"] == State.on && (line_occur["header_metadata"] > State.off)) { /+ header_metadata flag set +/ - if (auto m = match(line, rgx.header_sub)) { + if (matchFirst(line, rgx.header_sub)) { /+ sub-header +/ debug(header1) { tell_l("yellow", line); @@ -2246,43 +2247,43 @@ auto heading_make_set( && ((type["para"] == State.off) && (type["heading"] == State.off))) { /+ heading make set +/ - if (match(line, heading_match_rgx["h_B"])) { + if (matchFirst(line, heading_match_rgx["h_B"])) { line = "B~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_C"])) { + if (matchFirst(line, heading_match_rgx["h_C"])) { line = "C~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_D"])) { + if (matchFirst(line, heading_match_rgx["h_D"])) { line = "D~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_1"])) { + if (matchFirst(line, heading_match_rgx["h_1"])) { line = "1~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_2"])) { + if (matchFirst(line, heading_match_rgx["h_2"])) { line = "2~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_3"])) { + if (matchFirst(line, heading_match_rgx["h_3"])) { line = "3~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_4"])) { + if (matchFirst(line, heading_match_rgx["h_4"])) { line = "4~ " ~ line; debug(headingsfound) { writeln(line); @@ -2302,7 +2303,8 @@ auto heading_match( ref string[string] an_object, ref int[string] lv, ref int[string] collapsed_lev, - ref int[string] type + ref int[string] type, + ref JSONValue[string] dochead_meta ) { if (auto m = match(line, rgx.heading)) { /+ heading match +/ @@ -2318,6 +2320,8 @@ auto heading_match( assertions_doc_structure(an_object, lv); // includes most of the logic for collapsed levels switch (an_object["lev"]) { case "A": + an_object["obj"]=replaceFirst(an_object["obj"], rgx.head_value_title, to!string(dochead_meta["title"]["main"])); + an_object["obj"]=replaceFirst(an_object["obj"], rgx.head_value_author, to!string(dochead_meta["creator"]["author"])); collapsed_lev["h0"] = 1; an_object["lev_collapsed_number"] = to!string(collapsed_lev["h0"]); @@ -2451,7 +2455,7 @@ auto para_match( /+ para matches +/ // paragraphs // (fl ag_type["heading"] = true) && - if (auto m = match(line, rgx.para_indent)) { + if (auto m = matchFirst(line, rgx.para_indent)) { debug(paraindent) { // para indent tell_l("blue", line); } @@ -2460,7 +2464,7 @@ auto para_match( indent["first"] = to!string(m.captures[1]); indent["second"] = "0"; bullet = false; - } else if (auto m = match(line, rgx.para_bullet)) { + } else if (matchFirst(line, rgx.para_bullet)) { debug(parabullet) { // para bullet tell_l("blue", line); } @@ -2469,7 +2473,7 @@ auto para_match( indent["first"] = "0"; indent["second"] = "0"; bullet = true; - } else if (auto m = match(line, rgx.para_indent_hang)) { + } else if (auto m = matchFirst(line, rgx.para_indent_hang)) { debug(paraindenthang) { // para indent hang tell_l("blue", line); } @@ -2478,7 +2482,7 @@ auto para_match( indent["first"] = to!string(m.captures[1]); indent["second"] = to!string(m.captures[2]); bullet = false; - } else if (auto m = match(line, rgx.para_bullet_indent)) { + } else if (auto m = matchFirst(line, rgx.para_bullet_indent)) { debug(parabulletindent) { // para bullet indent tell_l("blue", line); } @@ -2537,19 +2541,19 @@ struct ObjAttributes { body { auto rgx = Rgx(); obj_txt["munge"]=obj_txt_in; - if (match(obj_txt_in, rgx.para_bullet)) { + if (matchFirst(obj_txt_in, rgx.para_bullet)) { obj_txt["attrib"] =" \"bullet\": \"true\"," ~ " \"indent_first\": 0," ~ " \"indent_rest\": 0,"; - } else if (auto m = match(obj_txt_in, rgx.para_bullet_indent)) { + } else if (auto m = matchFirst(obj_txt_in, rgx.para_bullet_indent)) { obj_txt["attrib"] =" \"bullet\": \"true\"," ~ " \"indent_first\": " ~ to!string(m.captures[1]) ~ "," ~ " \"indent_rest\": " ~ to!string(m.captures[1]) ~ ","; - } else if (auto m = match(obj_txt_in, rgx.para_indent_hang)) { + } else if (auto m = matchFirst(obj_txt_in, rgx.para_indent_hang)) { obj_txt["attrib"] =" \"bullet\": \"false\"," ~ " \"indent_first\": " ~ to!string(m.captures[1]) ~ "," ~ " \"indent_rest\": " ~ to!string(m.captures[2]) ~ ","; - } else if (auto m = match(obj_txt_in, rgx.para_indent)) { + } else if (auto m = matchFirst(obj_txt_in, rgx.para_indent)) { obj_txt["attrib"] =" \"bullet\": \"false\"," ~ " \"indent_first\": " ~ to!string(m.captures[1]) ~ "," ~ " \"indent_rest\": " ~ to!string(m.captures[1]) ~ ","; @@ -3048,14 +3052,14 @@ struct HeaderDocMetadataMakeJson { string hm, hs; auto header_metadata_and_make_jsonstr( string header, - JSONValue[string] dochead_metadata, + JSONValue[string] dochead_meta, JSONValue[string] dochead_make ) in { } body { scope(exit) { destroy(header); - destroy(dochead_metadata); + destroy(dochead_meta); destroy(dochead_make); } if (auto t = match(header, rgx.head_main)) { @@ -3069,13 +3073,13 @@ struct HeaderDocMetadataMakeJson { if (auto m = match(line, rgx.head_main)) { if (!empty(m.captures[2])) { if (hm == "creator") { - dochead_metadata[hm]["author"].str = + dochead_meta[hm]["author"].str = to!string(m.captures[2]); } else if (hm == "title") { - dochead_metadata[hm]["main"].str = + dochead_meta[hm]["main"].str = to!string(m.captures[2]); } else if (hm == "publisher") { - dochead_metadata[hm]["name"].str = + dochead_meta[hm]["name"].str = to!string(m.captures[2]); } } @@ -3099,12 +3103,12 @@ struct HeaderDocMetadataMakeJson { default: break; } - } else if (dochead_metadata[hm].type() == JSON_TYPE.OBJECT) { + } else if (dochead_meta[hm].type() == JSON_TYPE.OBJECT) { switch (hm) { case "creator": if (match(hs, rgx.subhead_creator)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3116,11 +3120,11 @@ struct HeaderDocMetadataMakeJson { case "title": if (match(hs, rgx.subhead_title)) { if ((hs == "subtitle") - && (dochead_metadata[hm]["sub"].type() == JSON_TYPE.STRING)) { - dochead_metadata[hm]["sub"].str = + && (dochead_meta[hm]["sub"].type() == JSON_TYPE.STRING)) { + dochead_meta[hm]["sub"].str = to!string(s.captures[2]); - } else if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + } else if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3131,8 +3135,8 @@ struct HeaderDocMetadataMakeJson { break; case "rights": if (match(hs, rgx.subhead_rights)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3143,8 +3147,8 @@ struct HeaderDocMetadataMakeJson { break; case "date": if (match(hs, rgx.subhead_date)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3155,8 +3159,8 @@ struct HeaderDocMetadataMakeJson { break; case "original": if (match(hs, rgx.subhead_original)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3167,8 +3171,8 @@ struct HeaderDocMetadataMakeJson { break; case "classify": if (match(hs, rgx.subhead_classify)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3179,8 +3183,8 @@ struct HeaderDocMetadataMakeJson { break; case "identifier": if (match(hs, rgx.subhead_identifier)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3191,8 +3195,8 @@ struct HeaderDocMetadataMakeJson { break; case "notes": if (match(hs, rgx.subhead_notes)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3203,8 +3207,8 @@ struct HeaderDocMetadataMakeJson { break; case "publisher": if (match(hs, rgx.subhead_publisher)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -3217,8 +3221,8 @@ struct HeaderDocMetadataMakeJson { destroy(hm); destroy(hs); // if (match(hs, rgx.subhead_links)) { - // if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - // dochead_metadata[hm][hs].str = to!string(s.captures[2]); + // if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + // dochead_meta[hm][hs].str = to!string(s.captures[2]); // } // } else { // writeln("not a valid header type:", hm, ":", hs); @@ -3237,7 +3241,7 @@ struct HeaderDocMetadataMakeJson { writeln("not a valid header type:", hm); } } - auto t = tuple(dochead_metadata, dochead_make); + auto t = tuple(dochead_meta, dochead_make); static assert(!isTypeTuple!(t)); return t; } diff --git a/org/ao_defaults.org b/org/ao_defaults.org index 9d5eb00..00fce41 100644 --- a/org/ao_defaults.org +++ b/org/ao_defaults.org @@ -349,7 +349,8 @@ template InternalMarkup() { static flag_action = ctRegex!(`^(--[a-z][a-z0-9-]+)$`); static flag_action_str = ctRegex!(` (--[a-z][a-z0-9-]+)`); static src_pth = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[tm])$`); -static src_fn = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[tm])$`); +static src_fn = + ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`); static src_fn_master = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ssm)$`); static src_fn_find_inserts = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[im])$`); // static ssm_fn = ctRegex!(`^[a-zA-Z0-9._-]+[.]ssm$`); @@ -394,6 +395,8 @@ static header_metadata = ctRegex!(`^@([a-z_]+):(?:\s|$)`); static header_sub = ctRegex!(`^[ ]+:([a-z_]+):\s`); static head_main = ctRegex!(`^@([a-z_]+):\s*(.*)`, "m"); static head_sub = ctRegex!(`^[ ]*:([a-z_]+):\s+(.+)`, "m"); +static head_value_title = ctRegex!(`@title`); +static head_value_author = ctRegex!(`@author`); #+END_SRC ** header & paragraph operators :paragraph:operator: #+name: ao_rgx diff --git a/org/ao_output_debugs.org b/org/ao_output_debugs.org index 51054b7..6f6a6c8 100644 --- a/org/ao_output_debugs.org +++ b/org/ao_output_debugs.org @@ -93,19 +93,19 @@ debug(headermakejson) { writefln( "%s\n%s\n%s", "document header, metadata & make instructions:", - dochead, + dochead_meta, pointer_head_main, ); foreach (main_header; pointer_head_main) { switch (main_header) { case "make": foreach (sub_header; pointer_head_sub_make) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } @@ -123,115 +123,115 @@ debug(headermetadatajson) { writefln( "%s\n%s\n%s", "document header, metadata & make instructions:", - dochead, + dochead_meta, pointer_head_main, ); foreach (main_header; pointer_head_main) { switch (main_header) { case "creator": foreach (sub_header; pointer_head_sub_creator) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "title": foreach (sub_header; pointer_head_sub_title) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "rights": foreach (sub_header; pointer_head_sub_rights) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "date": foreach (sub_header; pointer_head_sub_date) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "original": foreach (sub_header; pointer_head_sub_original) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "classify": foreach (sub_header; pointer_head_sub_classify) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "identifier": foreach (sub_header; pointer_head_sub_identifier) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "notes": foreach (sub_header; pointer_head_sub_notes) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "publisher": foreach (sub_header; pointer_head_sub_publisher) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } @@ -458,10 +458,10 @@ template SiSUoutputDebugs() { struct SDPoutputDebugs { auto abstract_doc_source_debugs(S)( auto ref const S contents, - JSONValue[string] docmake, - JSONValue[string] dochead, string[][string][string] bookindex_unordered_hashes, JSONValue[] biblio, + JSONValue[string] dochead_make, + JSONValue[string] dochead_meta, string fn_src, bool[string] opt_action_bool ) { diff --git a/org/ao_read_source_files.org b/org/ao_read_source_files.org index 3609fb5..26f25fb 100644 --- a/org/ao_read_source_files.org +++ b/org/ao_read_source_files.org @@ -106,7 +106,7 @@ final char[][] markupSourceContentRawLineArray(in string fn_src, Regex!(char) rg } #+END_SRC -* inserts :inserts: +* get markup source, master file & inserts :inserts: [[./sdp.org][sdp]] [[./][org/]] ** scan inserts (sub-document) source :scan_insert_src: @@ -130,11 +130,11 @@ auto markup_src_file_path = fn_pth_full.captures[1]; if (type1["curly_code"] == 1) { type1["header_make"] = 0; type1["header_metadata"] = 0; - if (auto m = match(line, rgx.block_curly_code_close)) { + if (matchFirst(line, rgx.block_curly_code_close)) { type1["curly_code"] = 0; } contents_insert ~= line; -} else if (auto m = match(line, rgx.block_curly_code_open)) { +} else if (matchFirst(line, rgx.block_curly_code_open)) { type1["curly_code"] = 1; type1["header_make"] = 0; type1["header_metadata"] = 0; @@ -142,25 +142,25 @@ if (type1["curly_code"] == 1) { } else if (type1["tic_code"] == 1) { type1["header_make"] = 0; type1["header_metadata"] = 0; - if (auto m = match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { type1["tic_code"] = 0; } contents_insert ~= line; -} else if (auto m = match(line, rgx.block_tic_code_open)) { +} else if (matchFirst(line, rgx.block_tic_code_open)) { type1["tic_code"] = 1; type1["header_make"] = 0; type1["header_metadata"] = 0; contents_insert ~= line; } else if ( (type1["header_make"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { type1["header_make"] = 1; type1["header_metadata"] = 0; // cont_dynamic_array ~= "% " ~ line; } else if ( (type1["header_metadata"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { type1["header_metadata"] = 1; type1["header_make"] = 0; @@ -227,11 +227,11 @@ auto markup_src_file_path = fn_pth_full.captures[1]; if (type["curly_code"] == 1) { type["header_make"] = 0; type["header_metadata"] = 0; - if (auto m = match(line, rgx.block_curly_code_close)) { + if (matchFirst(line, rgx.block_curly_code_close)) { type["curly_code"] = 0; } contents ~= line; -} else if (auto m = match(line, rgx.block_curly_code_open)) { +} else if (matchFirst(line, rgx.block_curly_code_open)) { type["curly_code"] = 1; type["header_make"] = 0; type["header_metadata"] = 0; @@ -239,30 +239,30 @@ if (type["curly_code"] == 1) { } else if (type["tic_code"] == 1) { type["header_make"] = 0; type["header_metadata"] = 0; - if (auto m = match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { type["tic_code"] = 0; } contents ~= line; -} else if (auto m = match(line, rgx.block_tic_code_open)) { +} else if (matchFirst(line, rgx.block_tic_code_open)) { type["tic_code"] = 1; type["header_make"] = 0; type["header_metadata"] = 0; contents ~= line; } else if ( (type["header_make"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { contents ~= line; } else if ( (type["header_metadata"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { contents ~= line; -} else if (auto m = match(line, rgx.header_make)) { +} else if (matchFirst(line, rgx.header_make)) { type["header_make"] = 1; type["header_metadata"] = 0; contents ~= line; -} else if (auto m = match(line, rgx.header_metadata)) { +} else if (matchFirst(line, rgx.header_metadata)) { type["header_make"] = 0; type["header_metadata"] = 1; contents ~= line; diff --git a/org/output.org b/org/output.org new file mode 100644 index 0000000..fa16447 --- /dev/null +++ b/org/output.org @@ -0,0 +1,1601 @@ +#+TITLE: sdp output html +#+AUTHOR: Ralph Amissah +#+EMAIL: ralph.amissah@gmail.com +#+STARTUP: indent +#+LANGUAGE: en +#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t +#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc +#+OPTIONS: author:nil email:nil creator:nil timestamp:nil +#+PROPERTY: header-args :padline no :exports code :noweb yes +#+EXPORT_SELECT_TAGS: export +#+EXPORT_EXCLUDE_TAGS: noexport +#+FILETAGS: :sdp:rel:output: +#+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) + +[[./sdp.org][sdp]] [[./][org/]] +* output :output: +** text :text: +** html :html: + +#+name: output_html +#+BEGIN_SRC d +struct SDPoutputHTML { +#+END_SRC + +*** css +#+name: output_html +#+BEGIN_SRC d + auto html_css() { + string css; + css="/* SiSU css default stylesheet */ + body { + color: black; + background: #ffffff; + background-color: #ffffff; + } + a:link { + color: #003399; + text-decoration: none; + } + a:visited { + color: #003399; + text-decoration: none; + } + a:hover { + color: #000000; + background-color: #f9f9aa; + } + a.lnkocn:link { + color: #777777; + text-decoration: none; + } + a:hover img { + background-color: #ffffff; + } + a:active { + color: #003399; + text-decoration: underline; + } + div { + margin-left: 0; + margin-right: 0; + } + div.p { + margin-left: 5%; + margin-right: 1%; + } + + #top_band { + position: absolute; + top: 0; + bottom: 80px; + width: 100%; + } + #top_band_search { + position: absolute; + top: 0px; + right: 0px; + margin-left: 75%; + width: 20%; + } + #column_left { + position: absolute; + top: 80px; + left: 0; + margin-left: 1%; + width: 20%; + } + #column_center { + position: absolute; + top: 80px; + margin-left: 20%; + width: 55%; + } + #column_right { + position: absolute; + top: 80px; + right: 0px; + margin-left: 75%; + width: 25%; + } + #pane_major { + position: absolute; + top: 0px; + left: 0; + margin-left: 0; + width: 80%; + } + #pane_minor { + position: absolute; + top: 0px; + right: 0px; + margin-left: 75%; + width: 20%; + background-color: #aaaaaa; + } + .norm, .bold, .verse, .group, .block, .alt { + line-height: 133%; + margin-left: 0em; + margin-right: 2em; + margin-top: 12px; + margin-bottom: 0px; + padding-left: 0em; + text-indent: 0em; + } + p, h0, h1, h2, h3, h4, h5, h6, h7 { + display: block; + font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman; + font-size: 100%; + font-weight: normal; + line-height: 133%; + text-align: justify; + margin-left: 0em; + margin-right: 2em; + text-indent: 0mm; + margin-top: 0.8em; + margin-bottom: 0.8em; + } + /* indent */ + p.norm { } + p.i1 {padding-left: 1em;} + p.i2 {padding-left: 2em;} + p.i3 {padding-left: 3em;} + p.i4 {padding-left: 4em;} + p.i5 {padding-left: 5em;} + p.i6 {padding-left: 6em;} + p.i7 {padding-left: 7em;} + p.i8 {padding-left: 8em;} + p.i9 {padding-left: 9em;} + /* hanging indent */ + p.h0i0 { + padding-left: 0em; + text-indent: 0em; + } + p.h0i1 { + padding-left: 1em; + text-indent: -1em; + } + p.h0i2 { + padding-left: 2em; + text-indent: -2em; + } + p.h0i3 { + padding-left: 3em; + text-indent: -3em; + } + p.h0i4 { + padding-left: 4em; + text-indent: -4em; + } + p.h0i5 { + padding-left: 5em; + text-indent: -5em; + } + p.h0i6 { + padding-left: 6em; + text-indent: -6em; + } + p.h0i7 { + padding-left: 7em; + text-indent: -7em; + } + p.h0i8 { + padding-left: 8em; + text-indent: -8em; + } + p.h0i9 { + padding-left: 9em; + text-indent: -9em; + } + p.h1i0 { + padding-left: 0em; + text-indent: 1em; + } + p.h1i1 { + padding-left: 1em; + text-indent: 0em; + } + p.h1i2 { + padding-left: 2em; + text-indent: -1em; + } + p.h1i3 { + padding-left: 3em; + text-indent: -2em; + } + p.h1i4 { + padding-left: 4em; + text-indent: -3em; + } + p.h1i5 { + padding-left: 5em; + text-indent: -4em; + } + p.h1i6 { + padding-left: 6em; + text-indent: -5em; + } + p.h1i7 { + padding-left: 7em; + text-indent: -6em; + } + p.h1i8 { + padding-left: 8em; + text-indent: -7em; + } + p.h1i9 { + padding-left: 9em; + text-indent: -8em; + } + p.h2i0 { + padding-left: 0em; + text-indent: 2em; + } + p.h2i1 { + padding-left: 1em; + text-indent: 1em; + } + p.h2i2 { + padding-left: 2em; + text-indent: 0em; + } + p.h2i3 { + padding-left: 3em; + text-indent: -1em; + } + p.h2i4 { + padding-left: 4em; + text-indent: -2em; + } + p.h2i5 { + padding-left: 5em; + text-indent: -3em; + } + p.h2i6 { + padding-left: 6em; + text-indent: -4em; + } + p.h2i7 { + padding-left: 7em; + text-indent: -5em; + } + p.h2i8 { + padding-left: 8em; + text-indent: -6em; + } + p.h2i9 { + padding-left: 9em; + text-indent: -7em; + } + p.h3i0 { + padding-left: 0em; + text-indent: 3em; + } + p.h3i1 { + padding-left: 1em; + text-indent: 2em; + } + p.h3i2 { + padding-left: 2em; + text-indent: 1em; + } + p.h3i3 { + padding-left: 3em; + text-indent: 0em; + } + p.h3i4 { + padding-left: 4em; + text-indent: -1em; + } + p.h3i5 { + padding-left: 5em; + text-indent: -2em; + } + p.h3i6 { + padding-left: 6em; + text-indent: -3em; + } + p.h3i7 { + padding-left: 7em; + text-indent: -4em; + } + p.h3i8 { + padding-left: 8em; + text-indent: -5em; + } + p.h3i9 { + padding-left: 9em; + text-indent: -6em; + } + p.h4i0 { + padding-left: 0em; + text-indent: 4em; + } + p.h4i1 { + padding-left: 1em; + text-indent: 3em; + } + p.h4i2 { + padding-left: 2em; + text-indent: 2em; + } + p.h4i3 { + padding-left: 3em; + text-indent: 1em; + } + p.h4i4 { + padding-left: 4em; + text-indent: 0em; + } + p.h4i5 { + padding-left: 5em; + text-indent: -1em; + } + p.h4i6 { + padding-left: 6em; + text-indent: -2em; + } + p.h4i7 { + padding-left: 7em; + text-indent: -3em; + } + p.h4i8 { + padding-left: 8em; + text-indent: -4em; + } + p.h4i9 { + padding-left: 9em; + text-indent: -5em; + } + p.h5i0 { + padding-left: 0em; + text-indent: 5em; + } + p.h5i1 { + padding-left: 1em; + text-indent: 4em; + } + p.h5i2 { + padding-left: 2em; + text-indent: 3em; + } + p.h5i3 { + padding-left: 3em; + text-indent: 2em; + } + p.h5i4 { + padding-left: 4em; + text-indent: 1em; + } + p.h5i5 { + padding-left: 5em; + text-indent: 0em; + } + p.h5i6 { + padding-left: 6em; + text-indent: -1em; + } + p.h5i7 { + padding-left: 7em; + text-indent: -2em; + } + p.h5i8 { + padding-left: 8em; + text-indent: -3em; + } + p.h5i9 { + padding-left: 9em; + text-indent: -4em; + } + p.h6i0 { + padding-left: 0em; + text-indent: 6em; + } + p.h6i1 { + padding-left: 1em; + text-indent: 5em; + } + p.h6i2 { + padding-left: 2em; + text-indent: 4em; + } + p.h6i3 { + padding-left: 3em; + text-indent: 3em; + } + p.h6i4 { + padding-left: 4em; + text-indent: 2em; + } + p.h6i5 { + padding-left: 5em; + text-indent: 1em; + } + p.h6i6 { + padding-left: 6em; + text-indent: 0em; + } + p.h6i7 { + padding-left: 7em; + text-indent: -1em; + } + p.h6i8 { + padding-left: 8em; + text-indent: -2em; + } + p.h6i9 { + padding-left: 9em; + text-indent: -3em; + } + p.h7i0 { + padding-left: 0em; + text-indent: 7em; + } + p.h7i1 { + padding-left: 1em; + text-indent: 6em; + } + p.h7i2 { + padding-left: 2em; + text-indent: 5em; + } + p.h7i3 { + padding-left: 3em; + text-indent: 4em; + } + p.h7i4 { + padding-left: 4em; + text-indent: 3em; + } + p.h7i5 { + padding-left: 5em; + text-indent: 2em; + } + p.h7i6 { + padding-left: 6em; + text-indent: 1em; + } + p.h7i7 { + padding-left: 7em; + text-indent: 0em; + } + p.h7i8 { + padding-left: 8em; + text-indent: -1em; + } + p.h7i9 { + padding-left: 9em; + text-indent: -2em; + } + p.h8i0 { + padding-left: 0em; + text-indent: 8em; + } + p.h8i1 { + padding-left: 1em; + text-indent: 7em; + } + p.h8i2 { + padding-left: 2em; + text-indent: 6em; + } + p.h8i3 { + padding-left: 3em; + text-indent: 5em; + } + p.h8i4 { + padding-left: 4em; + text-indent: 4em; + } + p.h8i5 { + padding-left: 5em; + text-indent: 3em; + } + p.h8i6 { + padding-left: 6em; + text-indent: 2em; + } + p.h8i7 { + padding-left: 7em; + text-indent: 1em; + } + p.h8i8 { + padding-left: 8em; + text-indent: 0em; + } + p.h8i9 { + padding-left: 9em; + text-indent: -1em; + } + p.h9i0 { + padding-left: 0em; + text-indent: 9em; + } + p.h9i1 { + padding-left: 1em; + text-indent: 8em; + } + p.h9i2 { + padding-left: 2em; + text-indent: 7em; + } + p.h9i3 { + padding-left: 3em; + text-indent: 6em; + } + p.h9i4 { + padding-left: 4em; + text-indent: 5em; + } + p.h9i5 { + padding-left: 5em; + text-indent: 4em; + } + p.h9i6 { + padding-left: 6em; + text-indent: 3em; + } + p.h9i7 { + padding-left: 7em; + text-indent: 2em; + } + p.h9i8 { + padding-left: 8em; + text-indent: 1em; + } + p.h9i9 { + padding-left: 9em; + text-indent: 0em; + } + p.it0 { + margin-left: 0em; + margin-top: 6px; + margin-bottom: 0px; + line-height: 100%; + } + p.it1 { + margin-left: 1em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it2 { + margin-left: 2em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it3 { + margin-left: 3em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it4 { + margin-left: 4em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it5 { + margin-left: 5em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it6 { + margin-left: 6em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it7 { + margin-left: 7em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it8 { + margin-left: 8em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it9 { + margin-left: 9em; + margin-bottom: 0px; + margin-top: 0px; + line-height: 100%; + } + p.block { } + p.group { } + p.alt { } + p.verse { + margin-bottom: 6px; + } + p.code { + font-family: inconsolata, andale mono, courier new, courier, monospace; + font-size: 90%; + text-align: left; + background-color: #eeeeee; + } + p.caption { + text-align: left; + font-size: 80%; + display: inline; + } + p.endnote { + font-size: 96%; + line-height: 120%; + text-align: left; + margin-right: 15mm; + } + p.endnote_indent { + font-size: 96%; + line-height: 120%; + text-align: left; + margin-left: 2em; + margin-right: 15mm; + } + p.center { + text-align: center; + } + p.bold { + font-weight: bold; + } + p.bold_left { + font-weight: bold; + text-align: left; + } + p.centerbold { + text-align: center; + font-weight: bold; + } + p.em { + font-weight: bold; + font-style: normal; + background: #fff3b6; + } + p.small { + font-size: 80%; + margin-top: 0px; + margin-bottom: 0px; + margin-right: 6px; + text-align: left; + } + .tiny, .tiny_left, .tiny_right, .tiny_center { + font-size: 10px; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-right: 6px; + text-align: left; + } + p.tiny { } + p.tiny_left { + margin-left: 0px; + margin-right: 0px; + text-align: left; + } + p.tiny_right { + margin-right: 1em; + text-align: right; + } + p.tiny_center { + margin-left: 0px; + margin-right: 0px; + text-align: center; + } + p.pane, p.pane_title, p.pane_blurb, p.pane_link, p.pane_indent { + font-size: 80%; + margin-top: 0px; + margin-bottom: 0px; + margin-left: 2mm; + margin-right: 4px; + text-align: left; + } + p.pane { } + p.pane_title { + font-weight: bold; + margin-bottom: 0px; + } + p.pane_blurb { + font-size: 10px; + margin-bottom: 0px; + } + p.pane_link { + font-size: 10px; + margin-bottom: 0px; + margin-left: 4mm; + } + p.pane_indent { + font-size: 10px; + margin-bottom: 0px; + margin-left: 4mm; + } + p.concordance_word { + line-height: 150%; + font-weight: bold; + display: inline; + margin-top: 4px; + margin-bottom: 1px; + } + p.concordance_count { + font-size: 80%; + color: #777777; + display: inline; + margin-left: 0em; + } + p.concordance_object { + font-size: 80%; + line-height: 120%; + text-align: left; + margin-left: 3em; + margin-top: 1px; + margin-bottom: 3px; + } + p.book_index_lev1 { + line-height: 100%; + margin-top: 4px; + margin-bottom: 1px; + } + p.book_index_lev2 { + line-height: 100%; + text-align: left; + margin-left: 3em; + margin-top: 1px; + margin-bottom: 3px; + } + p.quickref { + font-size: 10px; + font-style: italic; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-right: 5px; + text-align: left; + } + p.bigref { + font-size: 11px; + font-weight: bold; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-right: 5px; + text-align: center; + } + p.letter { + font-weight: bold; + font-size: 80%; + margin-left: 0em; + margin-top: 2px; + margin-bottom: 2px; + margin-right: 6px; + text-align: left; + color: white; + background: #880000; + } + tt { + font-family: inconsolata, andale mono, courier new, courier, monospace; + background-color: #eeeeee; + } + label.ocn { + width: 2%; + float: right; + top: 0; + font-size: 10px; + margin-top: 0px; + margin-bottom: 5px; + color: #777777; + margin-right: 5px; + text-align: right; + background-color: #ffffff; + } + table { } + tr { } + th,td { + vertical-align: top; + text-align: left; + } + th { + font-weight: bold; + } + p.left,th.left,td.left { + text-align: left; + } + p.small_left,th.small_left,td.small_left { + text-align: left; + font-size: 80%; + } + p.right,th.right,td.right { + text-align: right; + } + #horizontal_links { + background: #eeeeee; + margin-left: 5%; + margin-right: 5%; + } + #horizontal { + margin: 0; + padding: 0 0 0 10px; + border-top: 1px solid #000077; + border-bottom: 1px solid #000077; + } + #horizontal li { + margin: 0 0 0 0; + padding: 0 16px 0 0; + display: inline; + list-style-type: none; + text-align: left; + background: none; + } + #horizontal a { + line-height: 12px; + margin: 0 0 0 0; + text-decoration: none; + color: #000077; + } + #horizontal a.active, #horizontal a:hover { + border-bottom: 2px solid #777777; + padding-bottom: 2px; + color: #000077; + } + #horizontal a:hover { + color: #000077; + } + #document_versions { + position: absolute; + top: 10mm; + right: 2%; + width: 12%; + float: right; + } + #vertical_links { + position: absolute; + top: 10mm; + right: 0px; + width: 20%; + background: #dddddd; + float: right; + } + #vertical { + padding: 0 12px 0px 0px; + margin-left: 2%; + margin-right: 2%; + } + #vertical li { + display: block; + list-style-type: none; + } + #vertical a { + line-height: 12px; + text-decoration: none; + color: #000077; + } + #vertical a.active, #vertical a:hover { + border-bottom: 2px solid #777777; + padding-bottom: 2px; + color: #000077; + } + ul, li { + list-style-type: none; + list-style: none; + padding-left: 20px; + display: block; + font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman; + font-weight: normal; + line-height: 150%; + text-align: left; + text-indent: 0mm; + margin-left: 1em; + margin-right: 2em; + margin-top: 3px; + margin-bottom: 3px; + } + li { + background: url(../image_sys/bullet_09.png) no-repeat 0px 6px; + } + ul { + } + li.bullet { margin-left: 1em; } + li.i1 { margin-left: 2em; } + li.i2 { margin-left: 3em; } + li.i3 { margin-left: 4em; } + li.i4 { margin-left: 5em; } + li.i5 { margin-left: 6em; } + li.i6 { margin-left: 7em; } + li.i7 { margin-left: 8em; } + li.i8 { margin-left: 9em; } + li.i9 { margin-left: 10em; } + li.doc, li.ref, li.refcenter { + margin-top: 0px; + margin-bottom: 0px; + margin-right: 0px; + font-size: 8px; + font-style: normal; + text-align: left; + } + li.doc { + background: url(../image_sys/bullet_09.png) no-repeat 0px 6px; + padding-left: 16px; + margin-left: 10px; + margin-right: 0px; + } + li.ref { + background: none; + padding-left: 0; + margin-left: 0; + color: #777777; + } + li.refcenter { + background: url(../image_sys/bullet_09.png) no-repeat 0px 6px; + padding-left: 20px; + margin-left: 10%; + font-size: 9px; + color: #777777; + text-align: center; + } + li.refbold { + list-style-type: none; + padding-left: 16px; + margin-left: 0; + margin-right: 10mm; + font-weight: bold; + } + h0, h1, h2, h3, h4, h5, h6, h7 { + font-weight: bold; + line-height: 120%; + text-align: left; + margin-top: 20px; + margin-bottom: 10px; + } + h4.norm, h5.norm, h6.norm, h7.norm { + margin-top: 10px; + margin-bottom: 0px; + } + h0.center, h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, h7.center { + text-align: center; + } + h0 { font-size: 125%; } + h1 { font-size: 120%; } + h2 { font-size: 115%; } + h3 { font-size: 110%; } + h4 { font-size: 105%; } + h5 { font-size: 100%; } + h6 { font-size: 100%; } + h7 { font-size: 100%; } + h1.i {margin-left: 2em;} + h2.i {margin-left: 3em;} + h3.i {margin-left: 4em;} + h4.i {margin-left: 5em;} + h5.i {margin-left: 6em;} + h6.i {margin-left: 7em;} + h7.i {margin-left: 8em;} + h8.i {margin-left: 9em;} + h9.i {margin-left: 10em;} + h1.top_band { + display: inline; + text-align: left; + margin-top: 0; + margin-left: 4mm; + text-indent: 0mm; + font-weight: bold; + font-size: 120%; + } + h2.top_band_tiny { + font-size: 10px; + font-weight: normal; + margin-top: 0px; + margin-left: 4mm; + text-indent: 0mm; + margin-bottom: 0px; + color: #777777; + margin-left: 140px; + margin-right: 0px; + text-align: left; + } + p.top_band { + display: inline; + text-align: left; + margin-top: 0; + margin-left: 140px; + text-indent: 0mm; + font-weight: bold; + font-size: 120%; + } + p.top_band_tiny { + font-size: 10px; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-left: 140px; + margin-right: 0px; + text-align: left; + } + p.top_band_image { + float: left; + display: inline; + text-align: left; + margin-top: 0; + margin-left: 1mm; + text-indent: 0mm; + margin-right: 1mm; + } + .banner, .subbanner { + font-weight: bold; + text-align: center; + margin-left: 10mm; + margin-right: 15mm; + margin-top: 20px; + margin-bottom: 10px; + } + h0.banner { + font-size: 125%; + } + h1.banner { + font-size: 120%; + } + h1.subbanner { + font-size: 115%; + } + h2.banner { + font-size: 110%; + } + h3.banner { + color: #990000; + font-size: 105%; + } + h4.banner { + color: #ff0000; + font-size: 100%; + } + h5.banner { + } + h6.banner { + } + h7.banner { + } + .toc { + font-weight: normal; + margin-top: 6px; + margin-bottom: 6px; + } + h0.toc { + margin-left: 1em; + font-size: 120%; + line-height: 150%; + } + h1.toc { + margin-left: 1em; + font-size: 115%; + line-height: 150%; + } + h2.toc { + margin-left: 2em; + font-size: 110%; + line-height: 140%; + } + h3.toc { + margin-left: 3em; + font-size: 105%; + line-height: 120%; + } + h4.toc { + margin-left: 4em; + font-size: 100%; + line-height: 120%; + } + h5.toc { + margin-left: 5em; + font-size: 95%; + line-height: 110%; + } + h6.toc { + margin-left: 6em; + font-size: 90%; + line-height: 110%; + } + h7.toc { + margin-left: 7em; + font-size: 85%; + line-height: 100%; + } + .microtoc { + margin-top: 2px; + margin-bottom: 2px; + } + h0.microtoc { + margin-left: 0mm; + font-size: 120%; + } + h1.microtoc { + margin-left: 0mm; + font-size: 115%; + } + h2.microtoc { + margin-left: 5mm; + font-size: 110%; + } + h3.microtoc { + margin-left: 10mm; + font-size: 105%; + } + h4.microtoc { + margin-left: 15mm; + font-weight: normal; + font-size: 100%; + } + h5.microtoc { + margin-left: 20mm; + font-weight: normal; + font-size: 95%; + } + h6.microtoc { + margin-left: 25mm; + font-weight: normal; + font-size: 90%; + } + h7.microtoc { + margin-left: 30mm; + font-weight: normal; + font-size: 85%; + } + .subtoc { + margin-right: 34%; + font-weight: normal; + } + h5.subtoc { + margin-left: 2em; + font-size: 80%; + margin-top: 2px; + margin-bottom: 2px; + } + h6.subtoc { + margin-left: 3em; + font-size: 75%; + margin-top: 0px; + margin-bottom: 0px; + } + h7.subtoc { + margin-left: 4em; + font-size: 70%; + margin-top: 0px; + margin-bottom: 0px; + } + div.substance { + width: 100%; + background-color: #ffffff; + } + div.ocn { + width: 5%; + float: right; + top: 0; + background-color: #ffffff; + } + div.endnote { + width: 95%; + background-color: #fffffff; + } + div.toc { + position: absolute; + float: left; + margin: 0; + padding: 0; + padding-top: 0.5em; + border: 0; + width: 13em; + background-color: #eeeeee; + margin-right:1em; + } + div.summary { + margin: 0; + padding: 0; + border-left: 13em solid #eeeeee; + padding-left: 1em; + background-color: #eeeeee; + } + div.content, div.main_column { + margin: 0; + padding: 0; + border-left: 13em solid #ffffff; + padding-left: 1em; + padding-right: 1em; + } + div.content0, div.main_column0 { + margin: 0; + padding: 0; + border-left: 0% solid #ffffff; + padding-left: 5%; + } + div.scroll { + margin: 0; + padding: 0; + padding-left: 1em; + padding-right: 1em; + } + div.content:after { + content:' '; + clear:both; + display:block; + height:0; + overflow:hidden + } + div.footer { + clear:left; + padding: 0.5em; + font-size: 80%; + margin: 0; + } + div.toc ul { + list-style: none; + padding: 0; + margin: 0; + } + div.toc li ul a, li ul span.currentlink + { + font-weight: normal; + font-size: 90%; + padding-left: 2em; + background-color: #eeeeee; + } + div.toc a, span.currentlink{ + display:block; + text-decoration: none; + padding-left: 0.5em; + color: #0000aa; + } + hr { + width: 90%; + } + span.currentlink { + text-decoration: none; + background-color: #aaaaf9; + } + div.toc a:visited { + color: #0000aa; + } + div.toc a:hover { + color: #000000; + background-color: #f9f9aa; + } + .minitoc { + font-weight: normal; + margin-top: 2px; + margin-bottom: 2px; + } + h1.minitoc, h2.minitoc, h3.minitoc { + margin-left: 0em; + font-weight: bold; + text-align: left; + font-size: 90%; + margin-top: 4px; + margin-bottom: 4px; + } + h4.minitoc { + margin-left: 0em; + font-size: 90%; + } + h5.minitoc { + margin-left: 1em; + font-size: 85%; + } + h6.minitoc { + margin-left: 2em; + font-size: 85%; + } + h7.minitoc { + margin-left: 3em; + font-size: 80%; + } + h0.minitoc { + margin-left: 0em; + font-size: 90%; + } + h0.c, h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, h7.c, p.c { + text-align: center + } + h1.red, h2.red, h3.red, h4.red, h5.red, h6.red, h7.red { + text-align: center; + color: #ff0000; + margin-left: 5mm; + text-indent: 5mm; + margin-top: 30px; + margin-bottom: 20px; + margin-right: 15mm; + } + h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby, h7.ruby { + text-align: center; + color: #990000; + margin-left: 5mm; + text-indent: 5mm; + margin-top: 30px; + margin-bottom: 20px; + margin-right: 15mm; + }"; + return css; + } + auto css_write() { + auto pth_css= "_sisu/css"; + auto pth_css_fn= pth_css ~ "/html.css"; + try { + mkdirRecurse(pth_css); + auto f = File(pth_css_fn, "w"); + f.writeln(html_css); + // foreach (o; doc) { + // f.writeln(o); + // } + } + catch (ErrnoException ex) { + // Handle error + } + } +#+END_SRC + +*** html +**** html functions +#+name: output_html +#+BEGIN_SRC d + auto html_toc(O)( + auto ref const O obj, + ) { + string o; + o = format(q"◎%s◎", + obj.heading_attrib.lev_markup_number, + obj.obj_cite_number, + obj.object, + obj.heading_attrib.lev_markup_number + ); + return o; + } + auto html_heading(O)( + auto ref const O obj, + ) { + string o; + o = format(q"◎


+
+ + + %s + +
+ ◎", + obj.obj_cite_number, + obj.obj_cite_number, + obj.heading_attrib.lev_markup_number, + obj.obj_cite_number, + obj.obj_cite_number, + obj.object, + obj.heading_attrib.lev_markup_number + ); + return o; + } + auto html_para(O)( + auto ref const O obj, + ) { + string o; + o = format(q"◎
+ +

+ %s +

+
+ ◎", + obj.obj_cite_number, + obj.obj_cite_number, + obj.para_attrib.indent_first, + obj.para_attrib.indent_second, + obj.obj_cite_number, + obj.object + ); + return o; + } +#+END_SRC + +**** html scroll head & tail +#+name: output_html +#+BEGIN_SRC d + auto scroll_head() { + string o; + o = format(q"◎ + + + + + + Title + + + + + + + + + + + + + + + + + + + + +◎"); + return o; + } + auto scroll_tail() { + string o; + o = format(q"◎ + + + + + +◎"); + return o; + } +#+END_SRC + +**** html scroll +#+name: output_html +#+BEGIN_SRC d + auto scroll(C)( + auto ref const C contents, + string[][string][string] bookindex_unordered_hashes, + JSONValue[] biblio, + JSONValue[string] dochead_make, + JSONValue[string] dochead_meta, + string fn_src, + bool[string] opt_action_bool + ) { + mixin ScreenTxtColors; + mixin RgxInit; + auto rgx = Rgx(); + string[] toc; + string[] body_; + string[] doc; + foreach (obj; contents) { + if (obj.use == "content") { + switch (obj.is_a) { + case "heading": + toc ~= html_toc(obj); + body_ ~= html_heading(obj); + break; + case "para": + body_ ~= html_para(obj); + break; + case "verse": + body_ ~= html_para(obj); + // body_ ~= html_verse(obj); + break; + case "group": + body_ ~= html_para(obj); + // body_ ~= html_group(obj); + break; + case "block": + body_ ~= html_para(obj); + // body_ ~= html_block(obj); + break; + case "quote": + body_ ~= html_para(obj); + // body_ ~= html_quote(obj); + break; + case "table": + body_ ~= html_para(obj); + // body_ ~= html_table(obj); + break; + case "code": + body_ ~= html_para(obj); + // body_ ~= html_code(obj); + break; + default: + body_ ~= html_para(obj); + break; + } + } + } + doc = scroll_head ~ toc ~ body_ ~ scroll_tail; + auto m = matchFirst(fn_src, rgx.src_fn); + auto fn = m["fn_base"] ~ ".html"; + auto pth_html = "en/html"; + auto pth_seg = pth_html ~ "/" ~ m["fn_base"]; + auto pth_html_fn = pth_html ~ "/" ~ fn; + // auto pth_css= "_sisu/css"; + // auto pth_css_fn= pth_css ~ "/html.css"; + try { + mkdirRecurse(pth_seg); + auto f = File(pth_html_fn, "w"); + foreach (o; doc) { + f.writeln(o); + } + } + catch (ErrnoException ex) { + // Handle error + } + } +} +#+END_SRC + +** epub :epub: +** pdf :pdf: +** odt :odt: +** sqlite :sqlite: +** pgsql :pgsql: +* tangles :tangle: +** code structure: :output.d: +#+BEGIN_SRC d :tangle ../src/sdp/output_hub.d +/+ + output hub + output_hub.d ++/ +template SiSUoutputHub() { + <> +} +#+END_SRC + +** dump + +template SiSUoutput() { + struct SDPoutput { + auto html(S)( + auto ref const S contents, + JSONValue[string] dochead_make, + JSONValue[string] dochead_meta, + string[][string][string] bookindex_unordered_hashes, + JSONValue[] biblio, + string fn_src, + bool[string] opt_action_bool + ) { + mixin RgxInit; + mixin ScreenTxtColors; + auto rgx = Rgx(); + <> + <> + } + } + } +} + +** head + + + + + + Democratizing Innovation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org/sdp.org b/org/sdp.org index dc56e8e..0b2fc53 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -39,6 +39,34 @@ enum ver = Version(0, 4, 0); [[./ao_defaults.org][ao_defaults]] [[./ao_output_debugs.org][ao_output_debugs]] [[./ao_read_source_files.org][ao_read_source_files]] +[[./output_hub.org][output hub]] + +**** sdp :import:sdp: +***** TODO src/sdp.d + +├── src +│   ├── sdp.d +│   └── sdp +│    ├── ao_abstract_doc_source.d +│    ├── ... +│    └── compile_time_info.d +└── views +   └── version.txt + +#+NAME: sdp_imports_use +#+BEGIN_SRC d +/+ sdp sisu document parser http://sisudoc.org +/ +import + compile_time_info, // sdp/compile_time_info.d + ao_abstract_doc_source, // sdp/ao_abstract_doc_source.d + ao_defaults, // sdp/ao_defaults.d + ao_read_source_files, // sdp/ao_read_source_files.d + ao_output_debugs, // sdp/ao_output_debugs.d + output_hub, // output_hub.d + ao_rgx, // sdp/ao_rgx.d + ao_ansi_colors; // sdp/ao_ansi_colors.d + // std.conv; +#+END_SRC **** std :import:std: #+NAME: sdp_imports @@ -52,6 +80,7 @@ private import std.array, std.container, std.exception, + std.file, std.json, // std.path, std.range, @@ -65,32 +94,6 @@ private import std.conv : to; #+END_SRC -**** sdp :import:sdp: -***** TODO src/sdp.d - -├── src -│   ├── sdp.d -│   └── sdp -│    ├── ao_abstract_doc_source.d -│    ├── ... -│    └── compile_time_info.d -└── views -   └── version.txt - -#+NAME: sdp_imports_use -#+BEGIN_SRC d -/+ sdp sisu document parser +/ -import - compile_time_info, // sdp/compile_time_info.d - ao_abstract_doc_source, // sdp/ao_abstract_doc_source.d - ao_defaults, // sdp/ao_defaults.d - ao_read_source_files, // sdp/ao_read_source_files.d - ao_output_debugs, // sdp/ao_output_debugs.d - ao_rgx, // sdp/ao_rgx.d - ao_ansi_colors; // sdp/ao_ansi_colors.d - // std.conv; -#+END_SRC - **** version.txt :version: #+NAME: sdp_version_mixin @@ -108,9 +111,67 @@ mixin SiSUrgxInitFlags; mixin SiSUmarkupRaw; mixin SiSUdocAbstraction; mixin SiSUoutputDebugs; +mixin SiSUoutputHub; mixin ScreenTxtColors; #+END_SRC +*** sdp output :output: +#+NAME: sdp_args +#+BEGIN_SRC d +struct SDPoutput { + auto hub(S)( + auto ref const S contents, + string[][string][string] bookindex_unordered_hashes, + JSONValue[] biblio, + JSONValue[string] dochead_make, + JSONValue[string] dochead_meta, + string fn_src, + bool[string] opt_action_bool + ) { + mixin ScreenTxtColors; + mixin RgxInit; + mixin SiSUoutputHub; + // mixin SiSUoutput; + auto rgx = Rgx(); + uint return_ = 0; + if (opt_action_bool["source"]) { + writeln("sisupod source"); + } + if (opt_action_bool["sisupod"]) { + writeln("sisupod source"); + } + if (opt_action_bool["text"]) { + writeln("text processing"); + // auto text=SDPoutput_text(); + // text.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); + // // text.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); + } + if (opt_action_bool["html"]) { + auto html=SDPoutputHTML(); + html.css_write; + // html.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); + html.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); + } + if (opt_action_bool["epub"]) { + writeln("epub processing"); + } + if (opt_action_bool["pdf"]) { + writeln("pdf processing"); + } + if (opt_action_bool["odt"]) { + writeln("odt processing"); + } + if (opt_action_bool["sqlite"]) { + writeln("sqlite processing"); + } + if (opt_action_bool["postgresql"]) { + writeln("pgsql processing"); + } + return return_; + } +} +#+END_SRC + *** init :init: #+NAME: sdp_args @@ -118,6 +179,7 @@ mixin ScreenTxtColors; auto raw = MarkupRaw(); auto abs = Abstraction(); auto dbg = SDPoutputDebugs(); +auto output = SDPoutput(); /+ struct DocumentParts { string[string][] contents; @@ -169,17 +231,52 @@ look into using getopt #+BEGIN_SRC d bool[string] opt_action_bool = [ - "assertions" : false, - "html" : false, - "no_obj_cite_number" : false, - "verbose" : false, + "assertions" : false, + "concordance" : false, + "digest" : false, + "docbook" : false, + "epub" : false, + "html" : false, + "manifest" : false, + "no_ocn" : false, + "odt" : false, + "pdf" : false, + "postgresql" : false, + "qrcode" : false, + "sisupod" : false, + "source" : false, + "sqlite" : false, + "text" : false, + "verbose" : false, + "xhtml" : false, + "xml_dom" : false, + "xml_sax" : false, ]; auto helpInfo = getopt(args, std.getopt.config.passThrough, - "assert", "--assert set optional assertions on", &opt_action_bool["assertions"], - "html", "--html process html output", &opt_action_bool["html"], - "no-ocn", "--no-ocn suppress object cite number output", &opt_action_bool["no_obj_cite_number"], - "verbose|v", "--verbose output to terminal", &opt_action_bool["verbose"], + "assert", "--assert set optional assertions on", &opt_action_bool["assertions"], + "concordance", "--concordance file for document", &opt_action_bool["concordance"], + "digest", "--digest hash digest for each object", &opt_action_bool["digest"], + "docbook", "--docbook process docbook output", &opt_action_bool["docbook"], + "epub", "--epub process epub output", &opt_action_bool["epub"], + "html", "--html process html output", &opt_action_bool["html"], + "manifest", "--manifest process manifest output", &opt_action_bool["manifest"], + "no-ocn", "--no-ocn suppress object cite numbers", &opt_action_bool["no_ocn"], + "odf", "--odf process odf:odt output", &opt_action_bool["odt"], + "odt", "--odt process odf:odt output", &opt_action_bool["odt"], + "pdf", "--pdf process pdf output", &opt_action_bool["pdf"], + "pg", "--pg process postgresql output", &opt_action_bool["postgresql"], + "postgresql", "--postgresql process postgresql output", &opt_action_bool["postgresql"], + "qrcode", "--qrcode with document metadata", &opt_action_bool["qrcode"], + "sisupod", "--sisupod sisupod source content bundled", &opt_action_bool["sisupod"], + "source", "--source markup source text content", &opt_action_bool["source"], + "sqlite", "--sqlite process sqlite output", &opt_action_bool["sqlite"], + "text", "--text process text output", &opt_action_bool["text"], + "txt", "--txt process text output", &opt_action_bool["text"], + "verbose|v", "--verbose output to terminal", &opt_action_bool["verbose"], + "xhtml", "--xhtml process xhtml output", &opt_action_bool["xhtml"], + "xml-dom", "--xml-dom process xml dom output", &opt_action_bool["xml_dom"], + "xml-sax", "--xml-sax process xml sax output", &opt_action_bool["xml_sax"], ); if (helpInfo.helpWanted) { defaultGetoptPrinter("Some information about the program.", helpInfo.options); @@ -195,7 +292,7 @@ foreach(arg; args) { } #+END_SRC -** loop each file [+2] :loop:files: +** each file (loop) [+2] :loop:files: *** filename provided [+1] :file:process: **** loop scope :scope: #+NAME: sdp_each_file_do @@ -240,8 +337,7 @@ auto sourcefile_content = #+NAME: sdp_each_file_do #+BEGIN_SRC d /+ ↓ porcess document, return abstraction as tuple +/ -auto t = - abs.abstract_doc_source(sourcefile_content); +auto t = abs.abstract_doc_source(sourcefile_content); static assert(!isTypeTuple!(t)); auto doc_ao_contents = t[0]; // contents ~ endnotes ~ bookindex; // static assert(!isIterable!(doc_ao_contents)); @@ -260,16 +356,32 @@ auto doc_ao_biblio = t[4]; debug(checkdoc) { // checkbook & dumpdoc dbg.abstract_doc_source_debugs( doc_ao_contents, - doc_ao_make_json, - doc_ao_metadata_json, doc_ao_bookindex_unordered_hashes, doc_ao_biblio, + doc_ao_make_json, + doc_ao_metadata_json, fn_src, opt_action_bool ); } #+END_SRC +**** TODO process outputs :outputs: +***** [#A] html :html: +#+NAME: sdp_each_file_do +#+BEGIN_SRC d +/+ ↓ output hub +/ +output.hub( + doc_ao_contents, + doc_ao_bookindex_unordered_hashes, + doc_ao_biblio, + doc_ao_make_json, + doc_ao_metadata_json, + fn_src, + opt_action_bool +); +#+END_SRC + **** on exit :scope:exit: #+NAME: sdp_each_file_do #+BEGIN_SRC d @@ -304,31 +416,13 @@ break; ** sdp :sdp.d: *** TODO src/sdp.d -├── src -│   ├── sdp.d -│   └── sdp -│    ├── ao_abstract_doc_source.d -│    ├── ... -│    └── compile_time_info.d -├── views -│   └── version.txt - -├── src -│   ├── sdp -│   │   ├── ao_abstract_doc_source.d -│   │   ├── ... -│   │   └── compile_time_info.d -│   └── sdp.d -├── views -│   └── version.txt - #+BEGIN_SRC d :tangle ../src/sdp.d :shebang #!/usr/bin/env rdmd /+ sdp sdp.d +/ -<> <> +<> <> mixin CompileTimeInfo; mixin RgxInit; @@ -346,8 +440,29 @@ void main(string[] args) { } #+END_SRC +├── src +│   ├── sdp.d +│   └── sdp +│    ├── ao_abstract_doc_source.d +│    ├── ... +│    └── compile_time_info.d +├── views +│   └── version.txt + +├── src +│   ├── sdp +│   │   ├── ao_abstract_doc_source.d +│   │   ├── ... +│   │   └── compile_time_info.d +│   └── sdp.d +├── views +│   └── version.txt + * TODO work on -- figure out best program dir structure, issue with rdmd +** program dir structure +figure out best program dir structure for dub and compilers, issue with rdmd + +** sisu file structure |---------------------+------------------------------------------+------------------------+--------| | header | sisu /header markup/ | markup | | diff --git a/src/sdp.d b/src/sdp.d index 6b9ffcd..624b239 100755 --- a/src/sdp.d +++ b/src/sdp.d @@ -3,6 +3,17 @@ sdp sdp.d +/ +/+ sdp sisu document parser http://sisudoc.org +/ +import + compile_time_info, // sdp/compile_time_info.d + ao_abstract_doc_source, // sdp/ao_abstract_doc_source.d + ao_defaults, // sdp/ao_defaults.d + ao_read_source_files, // sdp/ao_read_source_files.d + ao_output_debugs, // sdp/ao_output_debugs.d + output_hub, // output_hub.d + ao_rgx, // sdp/ao_rgx.d + ao_ansi_colors; // sdp/ao_ansi_colors.d + // std.conv; /+ sdp sisu document parser +/ private import std.getopt, @@ -12,6 +23,7 @@ private import std.array, std.container, std.exception, + std.file, std.json, // std.path, std.range, @@ -23,16 +35,6 @@ private import std.utf, // std.variant, std.conv : to; -/+ sdp sisu document parser +/ -import - compile_time_info, // sdp/compile_time_info.d - ao_abstract_doc_source, // sdp/ao_abstract_doc_source.d - ao_defaults, // sdp/ao_defaults.d - ao_read_source_files, // sdp/ao_read_source_files.d - ao_output_debugs, // sdp/ao_output_debugs.d - ao_rgx, // sdp/ao_rgx.d - ao_ansi_colors; // sdp/ao_ansi_colors.d - // std.conv; mixin(import("version.txt")); mixin CompileTimeInfo; mixin RgxInit; @@ -44,10 +46,64 @@ void main(string[] args) { mixin SiSUmarkupRaw; mixin SiSUdocAbstraction; mixin SiSUoutputDebugs; + mixin SiSUoutputHub; mixin ScreenTxtColors; + struct SDPoutput { + auto hub(S)( + auto ref const S contents, + string[][string][string] bookindex_unordered_hashes, + JSONValue[] biblio, + JSONValue[string] dochead_make, + JSONValue[string] dochead_meta, + string fn_src, + bool[string] opt_action_bool + ) { + mixin ScreenTxtColors; + mixin RgxInit; + mixin SiSUoutputHub; + // mixin SiSUoutput; + auto rgx = Rgx(); + uint return_ = 0; + if (opt_action_bool["source"]) { + writeln("sisupod source"); + } + if (opt_action_bool["sisupod"]) { + writeln("sisupod source"); + } + if (opt_action_bool["text"]) { + writeln("text processing"); + // auto text=SDPoutput_text(); + // text.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); + // // text.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); + } + if (opt_action_bool["html"]) { + auto html=SDPoutputHTML(); + html.css_write; + // html.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); + html.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); + } + if (opt_action_bool["epub"]) { + writeln("epub processing"); + } + if (opt_action_bool["pdf"]) { + writeln("pdf processing"); + } + if (opt_action_bool["odt"]) { + writeln("odt processing"); + } + if (opt_action_bool["sqlite"]) { + writeln("sqlite processing"); + } + if (opt_action_bool["postgresql"]) { + writeln("pgsql processing"); + } + return return_; + } + } auto raw = MarkupRaw(); auto abs = Abstraction(); auto dbg = SDPoutputDebugs(); + auto output = SDPoutput(); /+ struct DocumentParts { string[string][] contents; @@ -83,17 +139,52 @@ void main(string[] args) { } bool[string] opt_action_bool = [ - "assertions" : false, - "html" : false, - "no_obj_cite_number" : false, - "verbose" : false, + "assertions" : false, + "concordance" : false, + "digest" : false, + "docbook" : false, + "epub" : false, + "html" : false, + "manifest" : false, + "no_ocn" : false, + "odt" : false, + "pdf" : false, + "postgresql" : false, + "qrcode" : false, + "sisupod" : false, + "source" : false, + "sqlite" : false, + "text" : false, + "verbose" : false, + "xhtml" : false, + "xml_dom" : false, + "xml_sax" : false, ]; auto helpInfo = getopt(args, std.getopt.config.passThrough, - "assert", "--assert set optional assertions on", &opt_action_bool["assertions"], - "html", "--html process html output", &opt_action_bool["html"], - "no-ocn", "--no-ocn suppress object cite number output", &opt_action_bool["no_obj_cite_number"], - "verbose|v", "--verbose output to terminal", &opt_action_bool["verbose"], + "assert", "--assert set optional assertions on", &opt_action_bool["assertions"], + "concordance", "--concordance file for document", &opt_action_bool["concordance"], + "digest", "--digest hash digest for each object", &opt_action_bool["digest"], + "docbook", "--docbook process docbook output", &opt_action_bool["docbook"], + "epub", "--epub process epub output", &opt_action_bool["epub"], + "html", "--html process html output", &opt_action_bool["html"], + "manifest", "--manifest process manifest output", &opt_action_bool["manifest"], + "no-ocn", "--no-ocn suppress object cite numbers", &opt_action_bool["no_ocn"], + "odf", "--odf process odf:odt output", &opt_action_bool["odt"], + "odt", "--odt process odf:odt output", &opt_action_bool["odt"], + "pdf", "--pdf process pdf output", &opt_action_bool["pdf"], + "pg", "--pg process postgresql output", &opt_action_bool["postgresql"], + "postgresql", "--postgresql process postgresql output", &opt_action_bool["postgresql"], + "qrcode", "--qrcode with document metadata", &opt_action_bool["qrcode"], + "sisupod", "--sisupod sisupod source content bundled", &opt_action_bool["sisupod"], + "source", "--source markup source text content", &opt_action_bool["source"], + "sqlite", "--sqlite process sqlite output", &opt_action_bool["sqlite"], + "text", "--text process text output", &opt_action_bool["text"], + "txt", "--txt process text output", &opt_action_bool["text"], + "verbose|v", "--verbose output to terminal", &opt_action_bool["verbose"], + "xhtml", "--xhtml process xhtml output", &opt_action_bool["xhtml"], + "xml-dom", "--xml-dom process xml dom output", &opt_action_bool["xml_dom"], + "xml-sax", "--xml-sax process xml sax output", &opt_action_bool["xml_sax"], ); if (helpInfo.helpWanted) { defaultGetoptPrinter("Some information about the program.", helpInfo.options); @@ -138,8 +229,7 @@ void main(string[] args) { auto sourcefile_content = raw.sourceContent(fn_src); /+ ↓ porcess document, return abstraction as tuple +/ - auto t = - abs.abstract_doc_source(sourcefile_content); + auto t = abs.abstract_doc_source(sourcefile_content); static assert(!isTypeTuple!(t)); auto doc_ao_contents = t[0]; // contents ~ endnotes ~ bookindex; // static assert(!isIterable!(doc_ao_contents)); @@ -152,14 +242,24 @@ void main(string[] args) { debug(checkdoc) { // checkbook & dumpdoc dbg.abstract_doc_source_debugs( doc_ao_contents, - doc_ao_make_json, - doc_ao_metadata_json, doc_ao_bookindex_unordered_hashes, doc_ao_biblio, + doc_ao_make_json, + doc_ao_metadata_json, fn_src, opt_action_bool ); } + /+ ↓ output hub +/ + output.hub( + doc_ao_contents, + doc_ao_bookindex_unordered_hashes, + doc_ao_biblio, + doc_ao_make_json, + doc_ao_metadata_json, + fn_src, + opt_action_bool + ); scope(exit) { debug(checkdoc) { writefln( diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index c1566d2..7539755 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -136,7 +136,7 @@ template SiSUdocAbstraction() { } auto type = flags_type_init; auto dochead_make = parseJSON(header_make_jsonstr).object; - auto dochead_metadata = parseJSON(header_metadata_jsonstr).object; + auto dochead_meta = parseJSON(header_metadata_jsonstr).object; mixin ScreenTxtColors; int tell_lo(string color, int obj_cite_number, in char[] line) { writefln( @@ -242,12 +242,12 @@ template SiSUdocAbstraction() { /+ block object: code +/ code_block(line, an_object, type); continue; - } else if (!match(line, rgx.regular_parse_skip)) { + } else if (!matchFirst(line, rgx.regular_parse_skip)) { /+ object other than code block object (includes regular text paragraph) +/ - if (((match(line, rgx.heading_biblio) + if (((matchFirst(line, rgx.heading_biblio) || (type["heading_biblio"] == State.on))) - && (!match(line, rgx.heading)) - && (!match(line, rgx.comment))) { + && (!matchFirst(line, rgx.heading)) + && (!matchFirst(line, rgx.comment))) { /+ within block object: biblio +/ biblio_block(line, type, bib_entry, biblio_arr_json); continue; @@ -273,15 +273,15 @@ template SiSUdocAbstraction() { table_block(line, an_object, type); continue; } else { - /+ not within a block group +/ + /+ not within a block group +/ assert( (type["blocks"] == TriState.off) || (type["blocks"] == TriState.closing), "block status: none or closed" ); assertions_flag_types_block_status_none_or_closed(type); - if (match(line, rgx.block_open)) { - if (match(line, (rgx.block_poem_open))) { + if (matchFirst(line, rgx.block_open)) { + if (matchFirst(line, (rgx.block_poem_open))) { /+ poem to verse exceptions! +/ object_reset(an_object); processing.remove("verse"); @@ -308,19 +308,19 @@ template SiSUdocAbstraction() { tell_l("red", line); } assert( - match(line, rgx.book_index) - || match(line, rgx.book_index_open) + matchFirst(line, rgx.book_index) + || matchFirst(line, rgx.book_index_open) || type["book_index"] == State.on ); } - if ((match(line, rgx.book_index)) - || (match(line, rgx.book_index_open)) + if ((matchFirst(line, rgx.book_index)) + || (matchFirst(line, rgx.book_index_open)) || (type["book_index"] == State.on )) { /+ book_index +/ book_index(line, book_idx_tmp, an_object, type); } else { /+ not book_index +/ - if (auto m = match(line, rgx.comment)) { + if (auto m = matchFirst(line, rgx.comment)) { /+ matched comment +/ debug(comment) { tell_l("blue", line); @@ -333,8 +333,8 @@ template SiSUdocAbstraction() { type["header_make"] = State.off; type["header_metadata"] = State.off; ++counter; - } else if ((match(line, rgx.header_make)) - || (match(line, rgx.header_metadata)) + } else if ((matchFirst(line, rgx.header_make)) + || (matchFirst(line, rgx.header_metadata)) || (type["header_make"] == State.on && (line_occur["header_make"] > State.off)) || (type["header_metadata"] == State.on @@ -360,9 +360,9 @@ template SiSUdocAbstraction() { /+ heading make set +/ heading_make_set(line, line_occur, heading_match_rgx, type); } - if (auto m = match(line, rgx.heading)) { + if (matchFirst(line, rgx.heading)) { /+ heading match +/ - heading_match(line, line_occur, an_object, lv, collapsed_lev, type); + heading_match(line, line_occur, an_object, lv, collapsed_lev, type, dochead_meta); } else if (line_occur["para"] == State.off) { /+ para match +/ para_match(line, an_object, indent, bullet, type); @@ -417,9 +417,9 @@ template SiSUdocAbstraction() { && (line_occur["header_make"] > State.off)) { /+ header_make instructions (current line empty) +/ auto dochead_metadata_and_make = - set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_metadata, dochead_make); + set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_meta, dochead_make); static assert(!isTypeTuple!(dochead_metadata_and_make)); - dochead_metadata = dochead_metadata_and_make[0]; + dochead_meta = dochead_metadata_and_make[0]; dochead_make = dochead_metadata_and_make[1]; header_set_common(line_occur, an_object, type); processing.remove("verse"); @@ -427,9 +427,9 @@ template SiSUdocAbstraction() { && (line_occur["header_metadata"] > State.off)) { /+ header_metadata (current line empty) +/ auto dochead_metadata_and_make = - set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_metadata, dochead_make); - static assert(!isTypeTuple!(dochead_metadata_and_make)); - dochead_metadata = dochead_metadata_and_make[0]; + set_header.header_metadata_and_make_jsonstr(strip(an_object["obj"]), dochead_meta, dochead_make); + static assert(!isTypeTuple!(dochead_meta)); + dochead_meta = dochead_metadata_and_make[0]; dochead_make = dochead_metadata_and_make[1]; header_set_common(line_occur, an_object, type); type["header_make"] = State.off; @@ -684,7 +684,7 @@ template SiSUdocAbstraction() { tuple( document_the, dochead_make, - dochead_metadata, + dochead_meta, bookindex_unordered_hashes, biblio_ordered ); @@ -721,15 +721,15 @@ template SiSUdocAbstraction() { auto check_obj_cite_number_status(char[] line, ref int[string] type) { if ((!line.empty) && (type["obj_cite_number_status_multi_obj"] == TriState.off)) { /+ not multi-line object, check whether obj_cite_number is on or turned off +/ - if (match(line, rgx.obj_cite_number_block_marks)) { + if (matchFirst(line, rgx.obj_cite_number_block_marks)) { /+ switch off obj_cite_number +/ - if (match(line, rgx.obj_cite_number_off_block)) { + if (matchFirst(line, rgx.obj_cite_number_off_block)) { type["obj_cite_number_status_multi_obj"] = TriState.on; debug(ocnoff) { tell_l("fuchsia", line); } } - if (match(line, rgx.obj_cite_number_off_block_dh)) { + if (matchFirst(line, rgx.obj_cite_number_off_block_dh)) { type["obj_cite_number_status_multi_obj"] = TriState.closing; debug(ocnoff) { tell_l("fuchsia", line); @@ -737,9 +737,9 @@ template SiSUdocAbstraction() { } } else { if (type["obj_cite_number_status_multi_obj"] == TriState.off) { - if (match(line, rgx.obj_cite_number_off)) { + if (matchFirst(line, rgx.obj_cite_number_off)) { type["obj_cite_number_status"] = TriState.on; - } else if (match(line, rgx.obj_cite_number_off_dh)) { + } else if (matchFirst(line, rgx.obj_cite_number_off_dh)) { type["obj_cite_number_status"] = TriState.closing; } else { // type["obj_cite_number_status"] = TriState.closing; @@ -751,7 +751,7 @@ template SiSUdocAbstraction() { } } } else if ((!line.empty) && (type["obj_cite_number_status_multi_obj"] > TriState.off)) { - if (auto m = match(line, rgx.obj_cite_number_off_block_close)) { + if (matchFirst(line, rgx.obj_cite_number_off_block_close)) { type["obj_cite_number_status_multi_obj"] = TriState.off; type["obj_cite_number_status"] = TriState.off; debug(ocnoff) { @@ -766,7 +766,7 @@ template SiSUdocAbstraction() { ref int[string] type, string[string] obj_cite_number_poem ) { - if (match(line, rgx.block_curly_code_open)) { + if (matchFirst(line, rgx.block_curly_code_open)) { /+ curly code open +/ debug(code) { // code (curly) open writefln( @@ -779,7 +779,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["code"] = TriState.on; type["curly_code"] = TriState.on; - } else if (match(line, rgx.block_curly_poem_open)) { + } else if (matchFirst(line, rgx.block_curly_poem_open)) { /+ curly poem open +/ debug(poem) { // poem (curly) open writefln( @@ -795,7 +795,7 @@ template SiSUdocAbstraction() { type["verse_new"] = State.on; type["poem"] = TriState.on; type["curly_poem"] = TriState.on; - } else if (match(line, rgx.block_curly_group_open)) { + } else if (matchFirst(line, rgx.block_curly_group_open)) { /+ curly group open +/ debug(group) { // group (curly) open writefln( @@ -808,7 +808,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["group"] = TriState.on; type["curly_group"] = TriState.on; - } else if (match(line, rgx.block_curly_block_open)) { + } else if (matchFirst(line, rgx.block_curly_block_open)) { /+ curly block open +/ debug(block) { // block (curly) open writefln( @@ -821,7 +821,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["block"] = TriState.on; type["curly_block"] = TriState.on; - } else if (match(line, rgx.block_curly_quote_open)) { + } else if (matchFirst(line, rgx.block_curly_quote_open)) { /+ curly quote open +/ debug(quote) { // quote (curly) open writefln( @@ -834,7 +834,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["quote"] = TriState.on; type["curly_quote"] = TriState.on; - } else if (match(line, rgx.block_curly_table_open)) { + } else if (matchFirst(line, rgx.block_curly_table_open)) { /+ curly table open +/ debug(table) { // table (curly) open writefln( @@ -847,7 +847,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["table"] = TriState.on; type["curly_table"] = TriState.on; - } else if (match(line, rgx.block_tic_code_open)) { + } else if (matchFirst(line, rgx.block_tic_code_open)) { /+ tic code open +/ debug(code) { // code (tic) open writefln( @@ -860,7 +860,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["code"] = TriState.on; type["tic_code"] = TriState.on; - } else if (match(line, rgx.block_tic_poem_open)) { + } else if (matchFirst(line, rgx.block_tic_poem_open)) { /+ tic poem open +/ debug(poem) { // poem (tic) open writefln( @@ -875,7 +875,7 @@ template SiSUdocAbstraction() { type["verse_new"] = State.on; type["poem"] = TriState.on; type["tic_poem"] = TriState.on; - } else if (match(line, rgx.block_tic_group_open)) { + } else if (matchFirst(line, rgx.block_tic_group_open)) { /+ tic group open +/ debug(group) { // group (tic) open writefln( @@ -888,7 +888,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["group"] = TriState.on; type["tic_group"] = TriState.on; - } else if (match(line, rgx.block_tic_block_open)) { + } else if (matchFirst(line, rgx.block_tic_block_open)) { /+ tic block open +/ debug(block) { // block (tic) open writefln( @@ -901,7 +901,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["block"] = TriState.on; type["tic_block"] = TriState.on; - } else if (match(line, rgx.block_tic_quote_open)) { + } else if (matchFirst(line, rgx.block_tic_quote_open)) { /+ tic quote open +/ debug(quote) { // quote (tic) open writefln( @@ -914,7 +914,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["quote"] = TriState.on; type["tic_quote"] = TriState.on; - } else if (match(line, rgx.block_tic_table_open)) { + } else if (matchFirst(line, rgx.block_tic_table_open)) { /+ tic table open +/ debug(table) { // table (tic) open writefln( @@ -936,7 +936,7 @@ template SiSUdocAbstraction() { ref int[string] type ) { if (type["curly_code"] == TriState.on) { - if (auto m = match(line, rgx.block_curly_code_close)) { + if (matchFirst(line, rgx.block_curly_code_close)) { debug(code) { // code (curly) close tell_l("blue", line); } @@ -947,10 +947,10 @@ template SiSUdocAbstraction() { debug(code) { // code (curly) line tell_l("blue", line); } - an_object["obj"] ~= line ~= "\n"; // code (curly) line + an_object["obj"] ~= line ~= "\n"; // code (curly) line } } else if (type["tic_code"] == TriState.on) { - if (auto m = match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(code) { // code (tic) close tell_l("blue", line); } @@ -961,7 +961,7 @@ template SiSUdocAbstraction() { debug(code) { // code (tic) line tell_l("blue", line); } - an_object["obj"] ~= line ~= "\n"; // code (tic) line + an_object["obj"] ~= line ~= "\n"; // code (tic) line } } return 0; @@ -991,7 +991,7 @@ template SiSUdocAbstraction() { ref int bib_entry, ref string[] biblio_arr_json ) { - if (match(line, rgx.heading_biblio)) { + if (matchFirst(line, rgx.heading_biblio)) { type["heading_biblio"] = TriState.on; } if (empty(line) && (bib_entry == TriState.off)) { @@ -1006,7 +1006,7 @@ template SiSUdocAbstraction() { line ); } - if (match(line, rgx.biblio_tags)) { + if (matchFirst(line, rgx.biblio_tags)) { auto bt = match(line, rgx.biblio_tags); bib_entry = 0; st=to!string(bt.captures[1]); @@ -1081,7 +1081,7 @@ template SiSUdocAbstraction() { string[string] obj_cite_number_poem ) { if (type["curly_poem"] == TriState.on) { - if (auto m = match(line, rgx.block_curly_poem_close)) { + if (matchFirst(line, rgx.block_curly_poem_close)) { an_object["obj"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( @@ -1140,7 +1140,7 @@ template SiSUdocAbstraction() { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); type["verse_new"] = State.off; - } else if (match(line, rgx.line_delimiter_only)) { + } else if (matchFirst(line, rgx.line_delimiter_only)) { verse_line = TriState.off; type["verse_new"] = State.on; } @@ -1181,7 +1181,7 @@ template SiSUdocAbstraction() { } } } else if (type["tic_poem"] == TriState.on) { - if (auto m = match(line, rgx.block_tic_close)) { // tic_poem_close + if (auto m = matchFirst(line, rgx.block_tic_close)) { // tic_poem_close an_object["obj"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( @@ -1226,7 +1226,7 @@ template SiSUdocAbstraction() { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); type["verse_new"] = State.off; - } else if (match(line, rgx.line_delimiter_only)) { + } else if (matchFirst(line, rgx.line_delimiter_only)) { type["verse_new"] = State.on; verse_line = TriState.off; } @@ -1276,7 +1276,7 @@ template SiSUdocAbstraction() { ref int[string] type ) { if (type["curly_group"] == State.on) { - if (match(line, rgx.block_curly_group_close)) { + if (matchFirst(line, rgx.block_curly_group_close)) { debug(group) { // group (curly) close tell_l("blue", line); } @@ -1290,7 +1290,7 @@ template SiSUdocAbstraction() { an_object["obj"] ~= line ~= "\n"; // build group array (or string) } } else if (type["tic_group"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(group) { // group (tic) close tell_l("blue", line); } @@ -1312,7 +1312,7 @@ template SiSUdocAbstraction() { ref int[string] type ) { if (type["curly_block"] == TriState.on) { - if (match(line, rgx.block_curly_block_close)) { + if (matchFirst(line, rgx.block_curly_block_close)) { debug(block) { // block (curly) close tell_l("blue", line); } @@ -1326,7 +1326,7 @@ template SiSUdocAbstraction() { an_object["obj"] ~= line ~= "\n"; // build block array (or string) } } else if (type["tic_block"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(block) { // block (tic) close tell_l("blue", line); } @@ -1344,7 +1344,7 @@ template SiSUdocAbstraction() { } auto quote_block(char[] line, ref string[string] an_object, ref int[string] type) { if (type["curly_quote"] == TriState.on) { - if (match(line, rgx.block_curly_quote_close)) { + if (matchFirst(line, rgx.block_curly_quote_close)) { debug(quote) { // quote (curly) close tell_l("blue", line); } @@ -1358,7 +1358,7 @@ template SiSUdocAbstraction() { an_object["obj"] ~= line ~= "\n"; // build quote array (or string) } } else if (type["tic_quote"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(quote) { // quote (tic) close tell_l("blue", line); } @@ -1376,7 +1376,7 @@ template SiSUdocAbstraction() { } auto table_block(char[] line, ref string[string] an_object, ref int[string] type) { if (type["curly_table"] == TriState.on) { - if (match(line, rgx.block_curly_table_close)) { + if (matchFirst(line, rgx.block_curly_table_close)) { debug(table) { // table (curly) close tell_l("blue", line); } @@ -1390,7 +1390,7 @@ template SiSUdocAbstraction() { an_object["obj"] ~= line ~= "\n"; // build table array (or string) } } else if (type["tic_table"] == TriState.on) { - if (match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { debug(table) { // table (tic) close tell_l("blue", line); } @@ -1674,7 +1674,7 @@ template SiSUdocAbstraction() { ref string[string] an_object, ref int[string] type ) { - if (auto m = match(line, rgx.header_make)) { + if (matchFirst(line, rgx.header_make)) { /+ matched header_make +/ debug(header1) { // header tell_l("yellow", line); @@ -1686,7 +1686,7 @@ template SiSUdocAbstraction() { type["para"] = State.off; ++line_occur["header_make"]; an_object["obj"] ~= line ~= "\n"; - } else if (auto m = match(line, rgx.header_metadata)) { + } else if (matchFirst(line, rgx.header_metadata)) { /+ matched header_metadata +/ debug(header1) { // header tell_l("yellow", line); @@ -1701,7 +1701,7 @@ template SiSUdocAbstraction() { } else if (type["header_make"] == State.on && (line_occur["header_make"] > State.off)) { /+ header_make flag set +/ - if (auto m = match(line, rgx.header_sub)) { + if (matchFirst(line, rgx.header_sub)) { /+ sub-header +/ debug(header1) { tell_l("yellow", line); @@ -1713,7 +1713,7 @@ template SiSUdocAbstraction() { } else if (type["header_metadata"] == State.on && (line_occur["header_metadata"] > State.off)) { /+ header_metadata flag set +/ - if (auto m = match(line, rgx.header_sub)) { + if (matchFirst(line, rgx.header_sub)) { /+ sub-header +/ debug(header1) { tell_l("yellow", line); @@ -1824,43 +1824,43 @@ template SiSUdocAbstraction() { && ((type["para"] == State.off) && (type["heading"] == State.off))) { /+ heading make set +/ - if (match(line, heading_match_rgx["h_B"])) { + if (matchFirst(line, heading_match_rgx["h_B"])) { line = "B~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_C"])) { + if (matchFirst(line, heading_match_rgx["h_C"])) { line = "C~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_D"])) { + if (matchFirst(line, heading_match_rgx["h_D"])) { line = "D~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_1"])) { + if (matchFirst(line, heading_match_rgx["h_1"])) { line = "1~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_2"])) { + if (matchFirst(line, heading_match_rgx["h_2"])) { line = "2~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_3"])) { + if (matchFirst(line, heading_match_rgx["h_3"])) { line = "3~ " ~ line; debug(headingsfound) { writeln(line); } } - if (match(line, heading_match_rgx["h_4"])) { + if (matchFirst(line, heading_match_rgx["h_4"])) { line = "4~ " ~ line; debug(headingsfound) { writeln(line); @@ -1874,7 +1874,8 @@ template SiSUdocAbstraction() { ref string[string] an_object, ref int[string] lv, ref int[string] collapsed_lev, - ref int[string] type + ref int[string] type, + ref JSONValue[string] dochead_meta ) { if (auto m = match(line, rgx.heading)) { /+ heading match +/ @@ -1890,6 +1891,8 @@ template SiSUdocAbstraction() { assertions_doc_structure(an_object, lv); // includes most of the logic for collapsed levels switch (an_object["lev"]) { case "A": + an_object["obj"]=replaceFirst(an_object["obj"], rgx.head_value_title, to!string(dochead_meta["title"]["main"])); + an_object["obj"]=replaceFirst(an_object["obj"], rgx.head_value_author, to!string(dochead_meta["creator"]["author"])); collapsed_lev["h0"] = 1; an_object["lev_collapsed_number"] = to!string(collapsed_lev["h0"]); @@ -2017,7 +2020,7 @@ template SiSUdocAbstraction() { /+ para matches +/ // paragraphs // (fl ag_type["heading"] = true) && - if (auto m = match(line, rgx.para_indent)) { + if (auto m = matchFirst(line, rgx.para_indent)) { debug(paraindent) { // para indent tell_l("blue", line); } @@ -2026,7 +2029,7 @@ template SiSUdocAbstraction() { indent["first"] = to!string(m.captures[1]); indent["second"] = "0"; bullet = false; - } else if (auto m = match(line, rgx.para_bullet)) { + } else if (matchFirst(line, rgx.para_bullet)) { debug(parabullet) { // para bullet tell_l("blue", line); } @@ -2035,7 +2038,7 @@ template SiSUdocAbstraction() { indent["first"] = "0"; indent["second"] = "0"; bullet = true; - } else if (auto m = match(line, rgx.para_indent_hang)) { + } else if (auto m = matchFirst(line, rgx.para_indent_hang)) { debug(paraindenthang) { // para indent hang tell_l("blue", line); } @@ -2044,7 +2047,7 @@ template SiSUdocAbstraction() { indent["first"] = to!string(m.captures[1]); indent["second"] = to!string(m.captures[2]); bullet = false; - } else if (auto m = match(line, rgx.para_bullet_indent)) { + } else if (auto m = matchFirst(line, rgx.para_bullet_indent)) { debug(parabulletindent) { // para bullet indent tell_l("blue", line); } @@ -2092,19 +2095,19 @@ template SiSUdocAbstraction() { body { auto rgx = Rgx(); obj_txt["munge"]=obj_txt_in; - if (match(obj_txt_in, rgx.para_bullet)) { + if (matchFirst(obj_txt_in, rgx.para_bullet)) { obj_txt["attrib"] =" \"bullet\": \"true\"," ~ " \"indent_first\": 0," ~ " \"indent_rest\": 0,"; - } else if (auto m = match(obj_txt_in, rgx.para_bullet_indent)) { + } else if (auto m = matchFirst(obj_txt_in, rgx.para_bullet_indent)) { obj_txt["attrib"] =" \"bullet\": \"true\"," ~ " \"indent_first\": " ~ to!string(m.captures[1]) ~ "," ~ " \"indent_rest\": " ~ to!string(m.captures[1]) ~ ","; - } else if (auto m = match(obj_txt_in, rgx.para_indent_hang)) { + } else if (auto m = matchFirst(obj_txt_in, rgx.para_indent_hang)) { obj_txt["attrib"] =" \"bullet\": \"false\"," ~ " \"indent_first\": " ~ to!string(m.captures[1]) ~ "," ~ " \"indent_rest\": " ~ to!string(m.captures[2]) ~ ","; - } else if (auto m = match(obj_txt_in, rgx.para_indent)) { + } else if (auto m = matchFirst(obj_txt_in, rgx.para_indent)) { obj_txt["attrib"] =" \"bullet\": \"false\"," ~ " \"indent_first\": " ~ to!string(m.captures[1]) ~ "," ~ " \"indent_rest\": " ~ to!string(m.captures[1]) ~ ","; @@ -2578,14 +2581,14 @@ template SiSUdocAbstraction() { string hm, hs; auto header_metadata_and_make_jsonstr( string header, - JSONValue[string] dochead_metadata, + JSONValue[string] dochead_meta, JSONValue[string] dochead_make ) in { } body { scope(exit) { destroy(header); - destroy(dochead_metadata); + destroy(dochead_meta); destroy(dochead_make); } if (auto t = match(header, rgx.head_main)) { @@ -2599,13 +2602,13 @@ template SiSUdocAbstraction() { if (auto m = match(line, rgx.head_main)) { if (!empty(m.captures[2])) { if (hm == "creator") { - dochead_metadata[hm]["author"].str = + dochead_meta[hm]["author"].str = to!string(m.captures[2]); } else if (hm == "title") { - dochead_metadata[hm]["main"].str = + dochead_meta[hm]["main"].str = to!string(m.captures[2]); } else if (hm == "publisher") { - dochead_metadata[hm]["name"].str = + dochead_meta[hm]["name"].str = to!string(m.captures[2]); } } @@ -2629,12 +2632,12 @@ template SiSUdocAbstraction() { default: break; } - } else if (dochead_metadata[hm].type() == JSON_TYPE.OBJECT) { + } else if (dochead_meta[hm].type() == JSON_TYPE.OBJECT) { switch (hm) { case "creator": if (match(hs, rgx.subhead_creator)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2646,11 +2649,11 @@ template SiSUdocAbstraction() { case "title": if (match(hs, rgx.subhead_title)) { if ((hs == "subtitle") - && (dochead_metadata[hm]["sub"].type() == JSON_TYPE.STRING)) { - dochead_metadata[hm]["sub"].str = + && (dochead_meta[hm]["sub"].type() == JSON_TYPE.STRING)) { + dochead_meta[hm]["sub"].str = to!string(s.captures[2]); - } else if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + } else if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2661,8 +2664,8 @@ template SiSUdocAbstraction() { break; case "rights": if (match(hs, rgx.subhead_rights)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2673,8 +2676,8 @@ template SiSUdocAbstraction() { break; case "date": if (match(hs, rgx.subhead_date)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2685,8 +2688,8 @@ template SiSUdocAbstraction() { break; case "original": if (match(hs, rgx.subhead_original)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2697,8 +2700,8 @@ template SiSUdocAbstraction() { break; case "classify": if (match(hs, rgx.subhead_classify)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2709,8 +2712,8 @@ template SiSUdocAbstraction() { break; case "identifier": if (match(hs, rgx.subhead_identifier)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2721,8 +2724,8 @@ template SiSUdocAbstraction() { break; case "notes": if (match(hs, rgx.subhead_notes)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2733,8 +2736,8 @@ template SiSUdocAbstraction() { break; case "publisher": if (match(hs, rgx.subhead_publisher)) { - if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - dochead_metadata[hm][hs].str = + if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + dochead_meta[hm][hs].str = to!string(s.captures[2]); } } else { @@ -2747,8 +2750,8 @@ template SiSUdocAbstraction() { destroy(hm); destroy(hs); // if (match(hs, rgx.subhead_links)) { - // if (dochead_metadata[hm][hs].type() == JSON_TYPE.STRING) { - // dochead_metadata[hm][hs].str = to!string(s.captures[2]); + // if (dochead_meta[hm][hs].type() == JSON_TYPE.STRING) { + // dochead_meta[hm][hs].str = to!string(s.captures[2]); // } // } else { // writeln("not a valid header type:", hm, ":", hs); @@ -2767,7 +2770,7 @@ template SiSUdocAbstraction() { writeln("not a valid header type:", hm); } } - auto t = tuple(dochead_metadata, dochead_make); + auto t = tuple(dochead_meta, dochead_make); static assert(!isTypeTuple!(t)); return t; } diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d index 8c655e8..3c97640 100644 --- a/src/sdp/ao_output_debugs.d +++ b/src/sdp/ao_output_debugs.d @@ -6,10 +6,10 @@ template SiSUoutputDebugs() { struct SDPoutputDebugs { auto abstract_doc_source_debugs(S)( auto ref const S contents, - JSONValue[string] docmake, - JSONValue[string] dochead, string[][string][string] bookindex_unordered_hashes, JSONValue[] biblio, + JSONValue[string] dochead_make, + JSONValue[string] dochead_meta, string fn_src, bool[string] opt_action_bool ) { @@ -80,19 +80,19 @@ template SiSUoutputDebugs() { writefln( "%s\n%s\n%s", "document header, metadata & make instructions:", - dochead, + dochead_meta, pointer_head_main, ); foreach (main_header; pointer_head_main) { switch (main_header) { case "make": foreach (sub_header; pointer_head_sub_make) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } @@ -106,115 +106,115 @@ template SiSUoutputDebugs() { writefln( "%s\n%s\n%s", "document header, metadata & make instructions:", - dochead, + dochead_meta, pointer_head_main, ); foreach (main_header; pointer_head_main) { switch (main_header) { case "creator": foreach (sub_header; pointer_head_sub_creator) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "title": foreach (sub_header; pointer_head_sub_title) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "rights": foreach (sub_header; pointer_head_sub_rights) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "date": foreach (sub_header; pointer_head_sub_date) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "original": foreach (sub_header; pointer_head_sub_original) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "classify": foreach (sub_header; pointer_head_sub_classify) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "identifier": foreach (sub_header; pointer_head_sub_identifier) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "notes": foreach (sub_header; pointer_head_sub_notes) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } break; case "publisher": foreach (sub_header; pointer_head_sub_publisher) { - if (to!string(dochead[main_header][sub_header]).length > 2) { + if (to!string(dochead_meta[main_header][sub_header]).length > 2) { writefln( "%s:%s: %s", main_header, sub_header, - dochead[main_header][sub_header] + dochead_meta[main_header][sub_header] ); } } diff --git a/src/sdp/ao_read_source_files.d b/src/sdp/ao_read_source_files.d index a5ca084..9bfaa05 100644 --- a/src/sdp/ao_read_source_files.d +++ b/src/sdp/ao_read_source_files.d @@ -103,11 +103,11 @@ template SiSUmarkupRaw() { if (type1["curly_code"] == 1) { type1["header_make"] = 0; type1["header_metadata"] = 0; - if (auto m = match(line, rgx.block_curly_code_close)) { + if (matchFirst(line, rgx.block_curly_code_close)) { type1["curly_code"] = 0; } contents_insert ~= line; - } else if (auto m = match(line, rgx.block_curly_code_open)) { + } else if (matchFirst(line, rgx.block_curly_code_open)) { type1["curly_code"] = 1; type1["header_make"] = 0; type1["header_metadata"] = 0; @@ -115,25 +115,25 @@ template SiSUmarkupRaw() { } else if (type1["tic_code"] == 1) { type1["header_make"] = 0; type1["header_metadata"] = 0; - if (auto m = match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { type1["tic_code"] = 0; } contents_insert ~= line; - } else if (auto m = match(line, rgx.block_tic_code_open)) { + } else if (matchFirst(line, rgx.block_tic_code_open)) { type1["tic_code"] = 1; type1["header_make"] = 0; type1["header_metadata"] = 0; contents_insert ~= line; } else if ( (type1["header_make"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { type1["header_make"] = 1; type1["header_metadata"] = 0; // cont_dynamic_array ~= "% " ~ line; } else if ( (type1["header_metadata"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { type1["header_metadata"] = 1; type1["header_make"] = 0; @@ -193,11 +193,11 @@ template SiSUmarkupRaw() { if (type["curly_code"] == 1) { type["header_make"] = 0; type["header_metadata"] = 0; - if (auto m = match(line, rgx.block_curly_code_close)) { + if (matchFirst(line, rgx.block_curly_code_close)) { type["curly_code"] = 0; } contents ~= line; - } else if (auto m = match(line, rgx.block_curly_code_open)) { + } else if (matchFirst(line, rgx.block_curly_code_open)) { type["curly_code"] = 1; type["header_make"] = 0; type["header_metadata"] = 0; @@ -205,30 +205,30 @@ template SiSUmarkupRaw() { } else if (type["tic_code"] == 1) { type["header_make"] = 0; type["header_metadata"] = 0; - if (auto m = match(line, rgx.block_tic_close)) { + if (matchFirst(line, rgx.block_tic_close)) { type["tic_code"] = 0; } contents ~= line; - } else if (auto m = match(line, rgx.block_tic_code_open)) { + } else if (matchFirst(line, rgx.block_tic_code_open)) { type["tic_code"] = 1; type["header_make"] = 0; type["header_metadata"] = 0; contents ~= line; } else if ( (type["header_make"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { contents ~= line; } else if ( (type["header_metadata"] == 1) - && match(line, rgx.header_sub) + && matchFirst(line, rgx.header_sub) ) { contents ~= line; - } else if (auto m = match(line, rgx.header_make)) { + } else if (matchFirst(line, rgx.header_make)) { type["header_make"] = 1; type["header_metadata"] = 0; contents ~= line; - } else if (auto m = match(line, rgx.header_metadata)) { + } else if (matchFirst(line, rgx.header_metadata)) { type["header_make"] = 0; type["header_metadata"] = 1; contents ~= line; diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d index e675ca1..073148e 100644 --- a/src/sdp/ao_rgx.d +++ b/src/sdp/ao_rgx.d @@ -8,7 +8,8 @@ template RgxInit() { static flag_action = ctRegex!(`^(--[a-z][a-z0-9-]+)$`); static flag_action_str = ctRegex!(` (--[a-z][a-z0-9-]+)`); static src_pth = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[tm])$`); - static src_fn = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[tm])$`); + static src_fn = + ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`); static src_fn_master = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ssm)$`); static src_fn_find_inserts = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[im])$`); // static ssm_fn = ctRegex!(`^[a-zA-Z0-9._-]+[.]ssm$`); @@ -41,6 +42,8 @@ template RgxInit() { static header_sub = ctRegex!(`^[ ]+:([a-z_]+):\s`); static head_main = ctRegex!(`^@([a-z_]+):\s*(.*)`, "m"); static head_sub = ctRegex!(`^[ ]*:([a-z_]+):\s+(.+)`, "m"); + static head_value_title = ctRegex!(`@title`); + static head_value_author = ctRegex!(`@author`); /+ heading & paragraph operators +/ static heading = ctRegex!(`^:?([A-D1-4])[~]([a-z0-9_.-]*[?]?) `); static heading_marker = ctRegex!(`^:?([A-D1-4])[~]`); diff --git a/src/sdp/output_hub.d b/src/sdp/output_hub.d new file mode 100644 index 0000000..5912e7e --- /dev/null +++ b/src/sdp/output_hub.d @@ -0,0 +1,1484 @@ +/+ + output hub + output_hub.d ++/ +template SiSUoutputHub() { + struct SDPoutputHTML { + auto html_css() { + string css; + css="/* SiSU css default stylesheet */ + body { + color: black; + background: #ffffff; + background-color: #ffffff; + } + a:link { + color: #003399; + text-decoration: none; + } + a:visited { + color: #003399; + text-decoration: none; + } + a:hover { + color: #000000; + background-color: #f9f9aa; + } + a.lnkocn:link { + color: #777777; + text-decoration: none; + } + a:hover img { + background-color: #ffffff; + } + a:active { + color: #003399; + text-decoration: underline; + } + div { + margin-left: 0; + margin-right: 0; + } + div.p { + margin-left: 5%; + margin-right: 1%; + } + + #top_band { + position: absolute; + top: 0; + bottom: 80px; + width: 100%; + } + #top_band_search { + position: absolute; + top: 0px; + right: 0px; + margin-left: 75%; + width: 20%; + } + #column_left { + position: absolute; + top: 80px; + left: 0; + margin-left: 1%; + width: 20%; + } + #column_center { + position: absolute; + top: 80px; + margin-left: 20%; + width: 55%; + } + #column_right { + position: absolute; + top: 80px; + right: 0px; + margin-left: 75%; + width: 25%; + } + #pane_major { + position: absolute; + top: 0px; + left: 0; + margin-left: 0; + width: 80%; + } + #pane_minor { + position: absolute; + top: 0px; + right: 0px; + margin-left: 75%; + width: 20%; + background-color: #aaaaaa; + } + .norm, .bold, .verse, .group, .block, .alt { + line-height: 133%; + margin-left: 0em; + margin-right: 2em; + margin-top: 12px; + margin-bottom: 0px; + padding-left: 0em; + text-indent: 0em; + } + p, h0, h1, h2, h3, h4, h5, h6, h7 { + display: block; + font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman; + font-size: 100%; + font-weight: normal; + line-height: 133%; + text-align: justify; + margin-left: 0em; + margin-right: 2em; + text-indent: 0mm; + margin-top: 0.8em; + margin-bottom: 0.8em; + } + /* indent */ + p.norm { } + p.i1 {padding-left: 1em;} + p.i2 {padding-left: 2em;} + p.i3 {padding-left: 3em;} + p.i4 {padding-left: 4em;} + p.i5 {padding-left: 5em;} + p.i6 {padding-left: 6em;} + p.i7 {padding-left: 7em;} + p.i8 {padding-left: 8em;} + p.i9 {padding-left: 9em;} + /* hanging indent */ + p.h0i0 { + padding-left: 0em; + text-indent: 0em; + } + p.h0i1 { + padding-left: 1em; + text-indent: -1em; + } + p.h0i2 { + padding-left: 2em; + text-indent: -2em; + } + p.h0i3 { + padding-left: 3em; + text-indent: -3em; + } + p.h0i4 { + padding-left: 4em; + text-indent: -4em; + } + p.h0i5 { + padding-left: 5em; + text-indent: -5em; + } + p.h0i6 { + padding-left: 6em; + text-indent: -6em; + } + p.h0i7 { + padding-left: 7em; + text-indent: -7em; + } + p.h0i8 { + padding-left: 8em; + text-indent: -8em; + } + p.h0i9 { + padding-left: 9em; + text-indent: -9em; + } + p.h1i0 { + padding-left: 0em; + text-indent: 1em; + } + p.h1i1 { + padding-left: 1em; + text-indent: 0em; + } + p.h1i2 { + padding-left: 2em; + text-indent: -1em; + } + p.h1i3 { + padding-left: 3em; + text-indent: -2em; + } + p.h1i4 { + padding-left: 4em; + text-indent: -3em; + } + p.h1i5 { + padding-left: 5em; + text-indent: -4em; + } + p.h1i6 { + padding-left: 6em; + text-indent: -5em; + } + p.h1i7 { + padding-left: 7em; + text-indent: -6em; + } + p.h1i8 { + padding-left: 8em; + text-indent: -7em; + } + p.h1i9 { + padding-left: 9em; + text-indent: -8em; + } + p.h2i0 { + padding-left: 0em; + text-indent: 2em; + } + p.h2i1 { + padding-left: 1em; + text-indent: 1em; + } + p.h2i2 { + padding-left: 2em; + text-indent: 0em; + } + p.h2i3 { + padding-left: 3em; + text-indent: -1em; + } + p.h2i4 { + padding-left: 4em; + text-indent: -2em; + } + p.h2i5 { + padding-left: 5em; + text-indent: -3em; + } + p.h2i6 { + padding-left: 6em; + text-indent: -4em; + } + p.h2i7 { + padding-left: 7em; + text-indent: -5em; + } + p.h2i8 { + padding-left: 8em; + text-indent: -6em; + } + p.h2i9 { + padding-left: 9em; + text-indent: -7em; + } + p.h3i0 { + padding-left: 0em; + text-indent: 3em; + } + p.h3i1 { + padding-left: 1em; + text-indent: 2em; + } + p.h3i2 { + padding-left: 2em; + text-indent: 1em; + } + p.h3i3 { + padding-left: 3em; + text-indent: 0em; + } + p.h3i4 { + padding-left: 4em; + text-indent: -1em; + } + p.h3i5 { + padding-left: 5em; + text-indent: -2em; + } + p.h3i6 { + padding-left: 6em; + text-indent: -3em; + } + p.h3i7 { + padding-left: 7em; + text-indent: -4em; + } + p.h3i8 { + padding-left: 8em; + text-indent: -5em; + } + p.h3i9 { + padding-left: 9em; + text-indent: -6em; + } + p.h4i0 { + padding-left: 0em; + text-indent: 4em; + } + p.h4i1 { + padding-left: 1em; + text-indent: 3em; + } + p.h4i2 { + padding-left: 2em; + text-indent: 2em; + } + p.h4i3 { + padding-left: 3em; + text-indent: 1em; + } + p.h4i4 { + padding-left: 4em; + text-indent: 0em; + } + p.h4i5 { + padding-left: 5em; + text-indent: -1em; + } + p.h4i6 { + padding-left: 6em; + text-indent: -2em; + } + p.h4i7 { + padding-left: 7em; + text-indent: -3em; + } + p.h4i8 { + padding-left: 8em; + text-indent: -4em; + } + p.h4i9 { + padding-left: 9em; + text-indent: -5em; + } + p.h5i0 { + padding-left: 0em; + text-indent: 5em; + } + p.h5i1 { + padding-left: 1em; + text-indent: 4em; + } + p.h5i2 { + padding-left: 2em; + text-indent: 3em; + } + p.h5i3 { + padding-left: 3em; + text-indent: 2em; + } + p.h5i4 { + padding-left: 4em; + text-indent: 1em; + } + p.h5i5 { + padding-left: 5em; + text-indent: 0em; + } + p.h5i6 { + padding-left: 6em; + text-indent: -1em; + } + p.h5i7 { + padding-left: 7em; + text-indent: -2em; + } + p.h5i8 { + padding-left: 8em; + text-indent: -3em; + } + p.h5i9 { + padding-left: 9em; + text-indent: -4em; + } + p.h6i0 { + padding-left: 0em; + text-indent: 6em; + } + p.h6i1 { + padding-left: 1em; + text-indent: 5em; + } + p.h6i2 { + padding-left: 2em; + text-indent: 4em; + } + p.h6i3 { + padding-left: 3em; + text-indent: 3em; + } + p.h6i4 { + padding-left: 4em; + text-indent: 2em; + } + p.h6i5 { + padding-left: 5em; + text-indent: 1em; + } + p.h6i6 { + padding-left: 6em; + text-indent: 0em; + } + p.h6i7 { + padding-left: 7em; + text-indent: -1em; + } + p.h6i8 { + padding-left: 8em; + text-indent: -2em; + } + p.h6i9 { + padding-left: 9em; + text-indent: -3em; + } + p.h7i0 { + padding-left: 0em; + text-indent: 7em; + } + p.h7i1 { + padding-left: 1em; + text-indent: 6em; + } + p.h7i2 { + padding-left: 2em; + text-indent: 5em; + } + p.h7i3 { + padding-left: 3em; + text-indent: 4em; + } + p.h7i4 { + padding-left: 4em; + text-indent: 3em; + } + p.h7i5 { + padding-left: 5em; + text-indent: 2em; + } + p.h7i6 { + padding-left: 6em; + text-indent: 1em; + } + p.h7i7 { + padding-left: 7em; + text-indent: 0em; + } + p.h7i8 { + padding-left: 8em; + text-indent: -1em; + } + p.h7i9 { + padding-left: 9em; + text-indent: -2em; + } + p.h8i0 { + padding-left: 0em; + text-indent: 8em; + } + p.h8i1 { + padding-left: 1em; + text-indent: 7em; + } + p.h8i2 { + padding-left: 2em; + text-indent: 6em; + } + p.h8i3 { + padding-left: 3em; + text-indent: 5em; + } + p.h8i4 { + padding-left: 4em; + text-indent: 4em; + } + p.h8i5 { + padding-left: 5em; + text-indent: 3em; + } + p.h8i6 { + padding-left: 6em; + text-indent: 2em; + } + p.h8i7 { + padding-left: 7em; + text-indent: 1em; + } + p.h8i8 { + padding-left: 8em; + text-indent: 0em; + } + p.h8i9 { + padding-left: 9em; + text-indent: -1em; + } + p.h9i0 { + padding-left: 0em; + text-indent: 9em; + } + p.h9i1 { + padding-left: 1em; + text-indent: 8em; + } + p.h9i2 { + padding-left: 2em; + text-indent: 7em; + } + p.h9i3 { + padding-left: 3em; + text-indent: 6em; + } + p.h9i4 { + padding-left: 4em; + text-indent: 5em; + } + p.h9i5 { + padding-left: 5em; + text-indent: 4em; + } + p.h9i6 { + padding-left: 6em; + text-indent: 3em; + } + p.h9i7 { + padding-left: 7em; + text-indent: 2em; + } + p.h9i8 { + padding-left: 8em; + text-indent: 1em; + } + p.h9i9 { + padding-left: 9em; + text-indent: 0em; + } + p.it0 { + margin-left: 0em; + margin-top: 6px; + margin-bottom: 0px; + line-height: 100%; + } + p.it1 { + margin-left: 1em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it2 { + margin-left: 2em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it3 { + margin-left: 3em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it4 { + margin-left: 4em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it5 { + margin-left: 5em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it6 { + margin-left: 6em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it7 { + margin-left: 7em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it8 { + margin-left: 8em; + margin-top: 0px; + margin-bottom: 0px; + line-height: 100%; + } + p.it9 { + margin-left: 9em; + margin-bottom: 0px; + margin-top: 0px; + line-height: 100%; + } + p.block { } + p.group { } + p.alt { } + p.verse { + margin-bottom: 6px; + } + p.code { + font-family: inconsolata, andale mono, courier new, courier, monospace; + font-size: 90%; + text-align: left; + background-color: #eeeeee; + } + p.caption { + text-align: left; + font-size: 80%; + display: inline; + } + p.endnote { + font-size: 96%; + line-height: 120%; + text-align: left; + margin-right: 15mm; + } + p.endnote_indent { + font-size: 96%; + line-height: 120%; + text-align: left; + margin-left: 2em; + margin-right: 15mm; + } + p.center { + text-align: center; + } + p.bold { + font-weight: bold; + } + p.bold_left { + font-weight: bold; + text-align: left; + } + p.centerbold { + text-align: center; + font-weight: bold; + } + p.em { + font-weight: bold; + font-style: normal; + background: #fff3b6; + } + p.small { + font-size: 80%; + margin-top: 0px; + margin-bottom: 0px; + margin-right: 6px; + text-align: left; + } + .tiny, .tiny_left, .tiny_right, .tiny_center { + font-size: 10px; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-right: 6px; + text-align: left; + } + p.tiny { } + p.tiny_left { + margin-left: 0px; + margin-right: 0px; + text-align: left; + } + p.tiny_right { + margin-right: 1em; + text-align: right; + } + p.tiny_center { + margin-left: 0px; + margin-right: 0px; + text-align: center; + } + p.pane, p.pane_title, p.pane_blurb, p.pane_link, p.pane_indent { + font-size: 80%; + margin-top: 0px; + margin-bottom: 0px; + margin-left: 2mm; + margin-right: 4px; + text-align: left; + } + p.pane { } + p.pane_title { + font-weight: bold; + margin-bottom: 0px; + } + p.pane_blurb { + font-size: 10px; + margin-bottom: 0px; + } + p.pane_link { + font-size: 10px; + margin-bottom: 0px; + margin-left: 4mm; + } + p.pane_indent { + font-size: 10px; + margin-bottom: 0px; + margin-left: 4mm; + } + p.concordance_word { + line-height: 150%; + font-weight: bold; + display: inline; + margin-top: 4px; + margin-bottom: 1px; + } + p.concordance_count { + font-size: 80%; + color: #777777; + display: inline; + margin-left: 0em; + } + p.concordance_object { + font-size: 80%; + line-height: 120%; + text-align: left; + margin-left: 3em; + margin-top: 1px; + margin-bottom: 3px; + } + p.book_index_lev1 { + line-height: 100%; + margin-top: 4px; + margin-bottom: 1px; + } + p.book_index_lev2 { + line-height: 100%; + text-align: left; + margin-left: 3em; + margin-top: 1px; + margin-bottom: 3px; + } + p.quickref { + font-size: 10px; + font-style: italic; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-right: 5px; + text-align: left; + } + p.bigref { + font-size: 11px; + font-weight: bold; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-right: 5px; + text-align: center; + } + p.letter { + font-weight: bold; + font-size: 80%; + margin-left: 0em; + margin-top: 2px; + margin-bottom: 2px; + margin-right: 6px; + text-align: left; + color: white; + background: #880000; + } + tt { + font-family: inconsolata, andale mono, courier new, courier, monospace; + background-color: #eeeeee; + } + label.ocn { + width: 2%; + float: right; + top: 0; + font-size: 10px; + margin-top: 0px; + margin-bottom: 5px; + color: #777777; + margin-right: 5px; + text-align: right; + background-color: #ffffff; + } + table { } + tr { } + th,td { + vertical-align: top; + text-align: left; + } + th { + font-weight: bold; + } + p.left,th.left,td.left { + text-align: left; + } + p.small_left,th.small_left,td.small_left { + text-align: left; + font-size: 80%; + } + p.right,th.right,td.right { + text-align: right; + } + #horizontal_links { + background: #eeeeee; + margin-left: 5%; + margin-right: 5%; + } + #horizontal { + margin: 0; + padding: 0 0 0 10px; + border-top: 1px solid #000077; + border-bottom: 1px solid #000077; + } + #horizontal li { + margin: 0 0 0 0; + padding: 0 16px 0 0; + display: inline; + list-style-type: none; + text-align: left; + background: none; + } + #horizontal a { + line-height: 12px; + margin: 0 0 0 0; + text-decoration: none; + color: #000077; + } + #horizontal a.active, #horizontal a:hover { + border-bottom: 2px solid #777777; + padding-bottom: 2px; + color: #000077; + } + #horizontal a:hover { + color: #000077; + } + #document_versions { + position: absolute; + top: 10mm; + right: 2%; + width: 12%; + float: right; + } + #vertical_links { + position: absolute; + top: 10mm; + right: 0px; + width: 20%; + background: #dddddd; + float: right; + } + #vertical { + padding: 0 12px 0px 0px; + margin-left: 2%; + margin-right: 2%; + } + #vertical li { + display: block; + list-style-type: none; + } + #vertical a { + line-height: 12px; + text-decoration: none; + color: #000077; + } + #vertical a.active, #vertical a:hover { + border-bottom: 2px solid #777777; + padding-bottom: 2px; + color: #000077; + } + ul, li { + list-style-type: none; + list-style: none; + padding-left: 20px; + display: block; + font-family: verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman; + font-weight: normal; + line-height: 150%; + text-align: left; + text-indent: 0mm; + margin-left: 1em; + margin-right: 2em; + margin-top: 3px; + margin-bottom: 3px; + } + li { + background: url(../image_sys/bullet_09.png) no-repeat 0px 6px; + } + ul { + } + li.bullet { margin-left: 1em; } + li.i1 { margin-left: 2em; } + li.i2 { margin-left: 3em; } + li.i3 { margin-left: 4em; } + li.i4 { margin-left: 5em; } + li.i5 { margin-left: 6em; } + li.i6 { margin-left: 7em; } + li.i7 { margin-left: 8em; } + li.i8 { margin-left: 9em; } + li.i9 { margin-left: 10em; } + li.doc, li.ref, li.refcenter { + margin-top: 0px; + margin-bottom: 0px; + margin-right: 0px; + font-size: 8px; + font-style: normal; + text-align: left; + } + li.doc { + background: url(../image_sys/bullet_09.png) no-repeat 0px 6px; + padding-left: 16px; + margin-left: 10px; + margin-right: 0px; + } + li.ref { + background: none; + padding-left: 0; + margin-left: 0; + color: #777777; + } + li.refcenter { + background: url(../image_sys/bullet_09.png) no-repeat 0px 6px; + padding-left: 20px; + margin-left: 10%; + font-size: 9px; + color: #777777; + text-align: center; + } + li.refbold { + list-style-type: none; + padding-left: 16px; + margin-left: 0; + margin-right: 10mm; + font-weight: bold; + } + h0, h1, h2, h3, h4, h5, h6, h7 { + font-weight: bold; + line-height: 120%; + text-align: left; + margin-top: 20px; + margin-bottom: 10px; + } + h4.norm, h5.norm, h6.norm, h7.norm { + margin-top: 10px; + margin-bottom: 0px; + } + h0.center, h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, h7.center { + text-align: center; + } + h0 { font-size: 125%; } + h1 { font-size: 120%; } + h2 { font-size: 115%; } + h3 { font-size: 110%; } + h4 { font-size: 105%; } + h5 { font-size: 100%; } + h6 { font-size: 100%; } + h7 { font-size: 100%; } + h1.i {margin-left: 2em;} + h2.i {margin-left: 3em;} + h3.i {margin-left: 4em;} + h4.i {margin-left: 5em;} + h5.i {margin-left: 6em;} + h6.i {margin-left: 7em;} + h7.i {margin-left: 8em;} + h8.i {margin-left: 9em;} + h9.i {margin-left: 10em;} + h1.top_band { + display: inline; + text-align: left; + margin-top: 0; + margin-left: 4mm; + text-indent: 0mm; + font-weight: bold; + font-size: 120%; + } + h2.top_band_tiny { + font-size: 10px; + font-weight: normal; + margin-top: 0px; + margin-left: 4mm; + text-indent: 0mm; + margin-bottom: 0px; + color: #777777; + margin-left: 140px; + margin-right: 0px; + text-align: left; + } + p.top_band { + display: inline; + text-align: left; + margin-top: 0; + margin-left: 140px; + text-indent: 0mm; + font-weight: bold; + font-size: 120%; + } + p.top_band_tiny { + font-size: 10px; + margin-top: 0px; + margin-bottom: 0px; + color: #777777; + margin-left: 140px; + margin-right: 0px; + text-align: left; + } + p.top_band_image { + float: left; + display: inline; + text-align: left; + margin-top: 0; + margin-left: 1mm; + text-indent: 0mm; + margin-right: 1mm; + } + .banner, .subbanner { + font-weight: bold; + text-align: center; + margin-left: 10mm; + margin-right: 15mm; + margin-top: 20px; + margin-bottom: 10px; + } + h0.banner { + font-size: 125%; + } + h1.banner { + font-size: 120%; + } + h1.subbanner { + font-size: 115%; + } + h2.banner { + font-size: 110%; + } + h3.banner { + color: #990000; + font-size: 105%; + } + h4.banner { + color: #ff0000; + font-size: 100%; + } + h5.banner { + } + h6.banner { + } + h7.banner { + } + .toc { + font-weight: normal; + margin-top: 6px; + margin-bottom: 6px; + } + h0.toc { + margin-left: 1em; + font-size: 120%; + line-height: 150%; + } + h1.toc { + margin-left: 1em; + font-size: 115%; + line-height: 150%; + } + h2.toc { + margin-left: 2em; + font-size: 110%; + line-height: 140%; + } + h3.toc { + margin-left: 3em; + font-size: 105%; + line-height: 120%; + } + h4.toc { + margin-left: 4em; + font-size: 100%; + line-height: 120%; + } + h5.toc { + margin-left: 5em; + font-size: 95%; + line-height: 110%; + } + h6.toc { + margin-left: 6em; + font-size: 90%; + line-height: 110%; + } + h7.toc { + margin-left: 7em; + font-size: 85%; + line-height: 100%; + } + .microtoc { + margin-top: 2px; + margin-bottom: 2px; + } + h0.microtoc { + margin-left: 0mm; + font-size: 120%; + } + h1.microtoc { + margin-left: 0mm; + font-size: 115%; + } + h2.microtoc { + margin-left: 5mm; + font-size: 110%; + } + h3.microtoc { + margin-left: 10mm; + font-size: 105%; + } + h4.microtoc { + margin-left: 15mm; + font-weight: normal; + font-size: 100%; + } + h5.microtoc { + margin-left: 20mm; + font-weight: normal; + font-size: 95%; + } + h6.microtoc { + margin-left: 25mm; + font-weight: normal; + font-size: 90%; + } + h7.microtoc { + margin-left: 30mm; + font-weight: normal; + font-size: 85%; + } + .subtoc { + margin-right: 34%; + font-weight: normal; + } + h5.subtoc { + margin-left: 2em; + font-size: 80%; + margin-top: 2px; + margin-bottom: 2px; + } + h6.subtoc { + margin-left: 3em; + font-size: 75%; + margin-top: 0px; + margin-bottom: 0px; + } + h7.subtoc { + margin-left: 4em; + font-size: 70%; + margin-top: 0px; + margin-bottom: 0px; + } + div.substance { + width: 100%; + background-color: #ffffff; + } + div.ocn { + width: 5%; + float: right; + top: 0; + background-color: #ffffff; + } + div.endnote { + width: 95%; + background-color: #fffffff; + } + div.toc { + position: absolute; + float: left; + margin: 0; + padding: 0; + padding-top: 0.5em; + border: 0; + width: 13em; + background-color: #eeeeee; + margin-right:1em; + } + div.summary { + margin: 0; + padding: 0; + border-left: 13em solid #eeeeee; + padding-left: 1em; + background-color: #eeeeee; + } + div.content, div.main_column { + margin: 0; + padding: 0; + border-left: 13em solid #ffffff; + padding-left: 1em; + padding-right: 1em; + } + div.content0, div.main_column0 { + margin: 0; + padding: 0; + border-left: 0% solid #ffffff; + padding-left: 5%; + } + div.scroll { + margin: 0; + padding: 0; + padding-left: 1em; + padding-right: 1em; + } + div.content:after { + content:' '; + clear:both; + display:block; + height:0; + overflow:hidden + } + div.footer { + clear:left; + padding: 0.5em; + font-size: 80%; + margin: 0; + } + div.toc ul { + list-style: none; + padding: 0; + margin: 0; + } + div.toc li ul a, li ul span.currentlink + { + font-weight: normal; + font-size: 90%; + padding-left: 2em; + background-color: #eeeeee; + } + div.toc a, span.currentlink{ + display:block; + text-decoration: none; + padding-left: 0.5em; + color: #0000aa; + } + hr { + width: 90%; + } + span.currentlink { + text-decoration: none; + background-color: #aaaaf9; + } + div.toc a:visited { + color: #0000aa; + } + div.toc a:hover { + color: #000000; + background-color: #f9f9aa; + } + .minitoc { + font-weight: normal; + margin-top: 2px; + margin-bottom: 2px; + } + h1.minitoc, h2.minitoc, h3.minitoc { + margin-left: 0em; + font-weight: bold; + text-align: left; + font-size: 90%; + margin-top: 4px; + margin-bottom: 4px; + } + h4.minitoc { + margin-left: 0em; + font-size: 90%; + } + h5.minitoc { + margin-left: 1em; + font-size: 85%; + } + h6.minitoc { + margin-left: 2em; + font-size: 85%; + } + h7.minitoc { + margin-left: 3em; + font-size: 80%; + } + h0.minitoc { + margin-left: 0em; + font-size: 90%; + } + h0.c, h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, h7.c, p.c { + text-align: center + } + h1.red, h2.red, h3.red, h4.red, h5.red, h6.red, h7.red { + text-align: center; + color: #ff0000; + margin-left: 5mm; + text-indent: 5mm; + margin-top: 30px; + margin-bottom: 20px; + margin-right: 15mm; + } + h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby, h7.ruby { + text-align: center; + color: #990000; + margin-left: 5mm; + text-indent: 5mm; + margin-top: 30px; + margin-bottom: 20px; + margin-right: 15mm; + }"; + return css; + } + auto css_write() { + auto pth_css= "_sisu/css"; + auto pth_css_fn= pth_css ~ "/html.css"; + try { + mkdirRecurse(pth_css); + auto f = File(pth_css_fn, "w"); + f.writeln(html_css); + // foreach (o; doc) { + // f.writeln(o); + // } + } + catch (ErrnoException ex) { + // Handle error + } + } + auto html_toc(O)( + auto ref const O obj, + ) { + string o; + o = format(q"◎%s◎", + obj.heading_attrib.lev_markup_number, + obj.obj_cite_number, + obj.object, + obj.heading_attrib.lev_markup_number + ); + return o; + } + auto html_heading(O)( + auto ref const O obj, + ) { + string o; + o = format(q"◎


+
+ + + %s + +
+ ◎", + obj.obj_cite_number, + obj.obj_cite_number, + obj.heading_attrib.lev_markup_number, + obj.obj_cite_number, + obj.obj_cite_number, + obj.object, + obj.heading_attrib.lev_markup_number + ); + return o; + } + auto html_para(O)( + auto ref const O obj, + ) { + string o; + o = format(q"◎
+ +

+ %s +

+
+ ◎", + obj.obj_cite_number, + obj.obj_cite_number, + obj.para_attrib.indent_first, + obj.para_attrib.indent_second, + obj.obj_cite_number, + obj.object + ); + return o; + } + auto scroll_head() { + string o; + o = format(q"◎ + + + + + + Title + + + + + + + + + + + + + + + + + + + + + ◎"); + return o; + } + auto scroll_tail() { + string o; + o = format(q"◎ + + + + + + ◎"); + return o; + } + auto scroll(C)( + auto ref const C contents, + string[][string][string] bookindex_unordered_hashes, + JSONValue[] biblio, + JSONValue[string] dochead_make, + JSONValue[string] dochead_meta, + string fn_src, + bool[string] opt_action_bool + ) { + mixin ScreenTxtColors; + mixin RgxInit; + auto rgx = Rgx(); + string[] toc; + string[] body_; + string[] doc; + foreach (obj; contents) { + if (obj.use == "content") { + switch (obj.is_a) { + case "heading": + toc ~= html_toc(obj); + body_ ~= html_heading(obj); + break; + case "para": + body_ ~= html_para(obj); + break; + case "verse": + body_ ~= html_para(obj); + // body_ ~= html_verse(obj); + break; + case "group": + body_ ~= html_para(obj); + // body_ ~= html_group(obj); + break; + case "block": + body_ ~= html_para(obj); + // body_ ~= html_block(obj); + break; + case "quote": + body_ ~= html_para(obj); + // body_ ~= html_quote(obj); + break; + case "table": + body_ ~= html_para(obj); + // body_ ~= html_table(obj); + break; + case "code": + body_ ~= html_para(obj); + // body_ ~= html_code(obj); + break; + default: + body_ ~= html_para(obj); + break; + } + } + } + doc = scroll_head ~ toc ~ body_ ~ scroll_tail; + auto m = matchFirst(fn_src, rgx.src_fn); + auto fn = m["fn_base"] ~ ".html"; + auto pth_html = "en/html"; + auto pth_seg = pth_html ~ "/" ~ m["fn_base"]; + auto pth_html_fn = pth_html ~ "/" ~ fn; + // auto pth_css= "_sisu/css"; + // auto pth_css_fn= pth_css ~ "/html.css"; + try { + mkdirRecurse(pth_seg); + auto f = File(pth_html_fn, "w"); + foreach (o; doc) { + f.writeln(o); + } + } + catch (ErrnoException ex) { + // Handle error + } + } + } +} diff --git a/subprojects/archived b/subprojects/archived new file mode 160000 index 0000000..9f410f7 --- /dev/null +++ b/subprojects/archived @@ -0,0 +1 @@ +Subproject commit 9f410f788b7ae3b3cc732547378f7ab7e79afec5 diff --git a/subprojects/d2sqlite3 b/subprojects/d2sqlite3 new file mode 160000 index 0000000..4a73215 --- /dev/null +++ b/subprojects/d2sqlite3 @@ -0,0 +1 @@ +Subproject commit 4a7321549a0a02f386792bcff10c5d5afae4e610 diff --git a/subprojects/imageformats-d b/subprojects/imageformats-d new file mode 160000 index 0000000..563468a --- /dev/null +++ b/subprojects/imageformats-d @@ -0,0 +1 @@ +Subproject commit 563468aa79700909ad530ee429b9beab894c03e9 diff --git a/subprojects/toml-d b/subprojects/toml-d new file mode 160000 index 0000000..02eb1ba --- /dev/null +++ b/subprojects/toml-d @@ -0,0 +1 @@ +Subproject commit 02eb1baaca47aa9862408719fd48ff178f94fdae diff --git a/tangle b/tangle index 334cd43..2fbaadf 100755 --- a/tangle +++ b/tangle @@ -4,7 +4,7 @@ DIR=`pwd` ORGFILES="" EMACSLISP=/usr/share/emacs/site-lisp -ORG_VERSION=20160411 +ORG_VERSION=20160530 EMACSLISP_ORG=~/.emacs.d/elpa/org-$($(shell echo $(ORG_VERSION))) EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-$($(shell echo $(ORG_VERSION))) # wrap each argument in the code required to call tangle on it -- cgit v1.2.3