From 9f5a72665fd94dcb082a9710c71e6a6a08386450 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 31 Jul 2018 10:25:29 -0400 Subject: messages & remove outputs not generated --- org/sdp.org | 211 +++++++++++++++++++++++++++--------------------------------- 1 file changed, 94 insertions(+), 117 deletions(-) (limited to 'org/sdp.org') diff --git a/org/sdp.org b/org/sdp.org index e85d040..8796a6b 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -47,7 +47,7 @@ version (Posix) { #+END_SRC * 1. sdp (sisu document parser) :sdp: - +** notes - deal with imports - get options - get command line instructions @@ -233,17 +233,13 @@ bool[string] opts = [ "concordance" : false, "debug" : false, "digest" : false, - "docbook" : false, "epub" : false, "html" : false, "html-seg" : false, "html-scroll" : false, "manifest" : false, "ocn" : true, - "odt" : false, - "pdf" : false, - "postgresql" : false, - "qrcode" : false, + "quiet" : false, "sisupod" : false, "source" : false, "sqlite-discrete" : false, @@ -255,9 +251,8 @@ bool[string] opts = [ "sqlite-update" : false, "text" : false, "verbose" : false, + "very-verbose" : false, "xhtml" : false, - "xml-dom" : false, - "xml-sax" : false, "section_toc" : true, "section_body" : true, "section_endnotes" : true, @@ -276,52 +271,46 @@ string[string] settings = [ ]; auto helpInfo = getopt(args, std.getopt.config.passThrough, - "abstraction", "--abstraction document abstraction ", &opts["abstraction"], - "assert", "--assert set optional assertions on", &opts["assertions"], - "concordance", "--concordance file for document", &opts["concordance"], - "debug", "--debug", &opts["debug"], - "digest", "--digest hash digest for each object", &opts["digest"], - "docbook", "--docbook process docbook output", &opts["docbook"], - "epub", "--epub process epub output", &opts["epub"], - "html", "--html process html output", &opts["html"], - "html-seg", "--html-seg process html output", &opts["html-seg"], - "html-scroll", "--html-seg process html output", &opts["html-scroll"], - "manifest", "--manifest process manifest output", &opts["manifest"], - "ocn", "--ocn object cite numbers (default)", &opts["ocn"], - "odf", "--odf process odf:odt output", &opts["odt"], - "odt", "--odt process odf:odt output", &opts["odt"], - "pdf", "--pdf process pdf output", &opts["pdf"], - "pg", "--pg process postgresql output", &opts["postgresql"], - "postgresql", "--postgresql process postgresql output", &opts["postgresql"], - "qrcode", "--qrcode with document metadata", &opts["qrcode"], - "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"], - "source", "--source markup source text content", &opts["source"], - "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"], - "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"], - "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"], - "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"], - "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"], - "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"], - "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"], - "text", "--text process text output", &opts["text"], - "txt", "--txt process text output", &opts["text"], - "verbose|v", "--verbose output to terminal", &opts["verbose"], - "xhtml", "--xhtml process xhtml output", &opts["xhtml"], - "xml-dom", "--xml-dom process xml dom output", &opts["xml-dom"], - "xml-sax", "--xml-sax process xml sax output", &opts["xml-sax"], - "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"], - "section-body", "--section-body process document body (default)", &opts["section_body"], - "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"], - "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"], - "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"], - "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"], - "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"], - "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"], - "skip-output", "--skip-output", &opts["skip-output"], - "output-dir", "--output-dir=[dir path]", &settings["output-dir"], - "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"], - "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"], - "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"], + "abstraction", "--abstraction document abstraction ", &opts["abstraction"], + "assert", "--assert set optional assertions on", &opts["assertions"], + "concordance", "--concordance file for document", &opts["concordance"], + "debug", "--debug", &opts["debug"], + "digest", "--digest hash digest for each object", &opts["digest"], + "epub", "--epub process epub output", &opts["epub"], + "html", "--html process html output", &opts["html"], + "html-seg", "--html-seg process html output", &opts["html-seg"], + "html-scroll", "--html-seg process html output", &opts["html-scroll"], + "manifest", "--manifest process manifest output", &opts["manifest"], + "ocn", "--ocn object cite numbers (default)", &opts["ocn"], + "quiet", "--quiet output to terminal", &opts["quiet"], + "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"], + "source", "--source markup source text content", &opts["source"], + "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"], + "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"], + "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"], + "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"], + // "sqlite-db-populate", "--sqlite-db-populate create db & tables, insert specified", &opts["sqlite-db-populate"], + "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"], + "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"], + "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"], + "text", "--text process text output", &opts["text"], + "txt", "--txt process text output", &opts["text"], + "verbose|v", "--verbose output to terminal", &opts["verbose"], + "very-verbose", "--very-verbose output to terminal", &opts["very-verbose"], + "xhtml", "--xhtml process xhtml output", &opts["xhtml"], + "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"], + "section-body", "--section-body process document body (default)", &opts["section_body"], + "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"], + "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"], + "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"], + "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"], + "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"], + "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"], + "skip-output", "--skip-output", &opts["skip-output"], + "output-dir", "--output-dir=[dir path]", &settings["output-dir"], + "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"], + "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"], + "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"], ); if (helpInfo.helpWanted) { defaultGetoptPrinter("Some information about the program.", helpInfo.options); @@ -345,41 +334,45 @@ struct OptActions { auto digest() { return opts["digest"]; } - auto docbook() { - return opts["docbook"]; - } auto epub() { return opts["epub"]; } auto html() { - bool _is; - if ( + bool _is = ( opts["html"] || opts["html-seg"] || opts["html-scroll"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto html_seg() { - bool _is; - if ( + bool _is = ( opts["html"] || opts["html-seg"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto html_scroll() { - bool _is; - if ( + bool _is = ( + opts["html"] + || opts["html-scroll"] + ) + ? true + : false; + return _is; + } + auto html_stuff() { + bool _is = ( opts["html"] || opts["html-scroll"] - ) { - _is = true; - } else { _is = false; } + || opts["html-seg"] + ) + ? true + : false; return _is; } auto manifest() { @@ -388,17 +381,8 @@ struct OptActions { auto ocn() { return opts["ocn"]; } - auto odt() { - return opts["odt"]; - } - auto pdf() { - return opts["pdf"]; - } - auto postgresql() { - return opts["postgresql"]; - } - auto qrcode() { - return opts["qrcode"]; + auto quiet() { + return opts["quiet"]; } auto sisupod() { return opts["sisupod"]; @@ -410,23 +394,21 @@ struct OptActions { return opts["sqlite-discrete"]; } auto sqlite_db_drop() { - bool _is; - if ( + bool _is = ( opts["sqlite-db-recreate"] || opts["sqlite-db-drop"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto sqlite_db_create() { - bool _is; - if ( + bool _is = ( opts["sqlite-db-recreate"] || opts["sqlite-db-create"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto sqlite_insert() { @@ -442,17 +424,20 @@ struct OptActions { return opts["text"]; } auto verbose() { - return opts["verbose"]; + bool _is = ( + opts["verbose"] + || opts["very-verbose"] + ) + ? true + : false; + return _is; + } + auto very_verbose() { + return opts["very-verbose"]; } auto xhtml() { return opts["xhtml"]; } - auto xml_dom() { - return opts["xml-dom"]; - } - auto xml_sax() { - return opts["xml-sax"]; - } auto section_toc() { return opts["section_toc"]; } @@ -490,29 +475,21 @@ struct OptActions { return settings["sqlite-filename"]; } auto abstraction() { - bool _is; - if ( + bool _is = ( opts["abstraction"] || concordance - || docbook || epub || html || manifest - || odt - || pdf - || postgresql - || qrcode || sisupod || source || sqlite_discrete || sqlite_delete || sqlite_insert || sqlite_update - || text - || xhtml - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } } @@ -600,7 +577,7 @@ foreach(arg; args[1..$]) { _manifests ~= _manifest_matter; } } else if (arg.match(rgx.src_pth_zip)) { - // fns_src ~= arg; // gather input markup source file names for processing + // fns_src ~= arg; // gather input markup source file names for processing } else { // anything remaining, unused arg_unrecognized ~= " " ~ arg; } @@ -639,7 +616,7 @@ if (!(_opt_action.skip_output)) { #+NAME: sdp_each_file_do_scope #+BEGIN_SRC d scope(success) { - debug(checkdoc) { + if (!(_opt_action.quiet)) { writefln( "%s\n%s", "~ document complete, ok ~", @@ -730,7 +707,7 @@ if (!(doc_matters.opt.action.skip_output)) { #+NAME: sdp_each_file_do_scope_exit #+BEGIN_SRC d scope(exit) { - debug(checkdoc) { + if (!(_opt_action.quiet)) { writefln( "processed file: %s", manifest.src.filename @@ -763,7 +740,7 @@ template SiSUabstraction() { auto SiSUabstraction(E,O,M)( E _env, O _opt_action, - M _manifest, + M _manifest ){ <> <> @@ -1265,7 +1242,7 @@ consider **** ocn |-------------+-----------------------+-----------------------+----------------+------| -| *objects | section / part | ocn described | how used* | type | +| objects | section / part | ocn described | how used | type | |-------------+-----------------------+-----------------------+----------------+------| | regular ocn | | | | | |-------------+-----------------------+-----------------------+----------------+------| -- cgit v1.2.3