diff options
| -rw-r--r-- | org/default_paths.org | 33 | ||||
| -rw-r--r-- | org/out_metadata.org | 11 | ||||
| -rw-r--r-- | org/out_xmls.org | 21 | ||||
| -rw-r--r-- | org/spine.org | 5 | ||||
| -rw-r--r-- | src/doc_reform/io_out/metadata.d | 11 | ||||
| -rw-r--r-- | src/doc_reform/io_out/paths_output.d | 24 | ||||
| -rw-r--r-- | src/doc_reform/io_out/xmls.d | 21 | ||||
| -rwxr-xr-x | src/doc_reform/spine.d | 5 | 
8 files changed, 116 insertions, 15 deletions
| diff --git a/org/default_paths.org b/org/default_paths.org index 7748ab8..0579408 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -989,6 +989,7 @@ import doc_reform.meta.rgx;  <<template_paths_html_2>>  <<template_paths_epub>>  <<template_paths_odf>> +<<template_paths_pdf>>  <<template_paths_latex>>  <<template_paths_latex_sty>>  <<template_paths_sqlite_0>> @@ -1609,7 +1610,37 @@ template spinePathsLaTeXsty() {  }  #+END_SRC -** _sqlite_                                                            :sqlite: +** _pdf_                                                              :pdf: + +#+NAME: template_paths_pdf +#+BEGIN_SRC d +template spinePathsPDF() { +  mixin spineRgxIn; +  static auto rgx = RgxI(); +  auto spinePathsPDF(M)( +    M  doc_matters, +  ) { +    struct _PathsStruct { +      string base_filename(string fn_src) { +        return fn_src.baseName.stripExtension; +      } +      auto out_pth() { +        string output_dir = doc_matters.output_path ~ "/pdf"; +        return spineOutPaths!()(output_dir); +      } +      string base() { +        return (((out_pth.output_root).chainPath("pdf")).asNormalizedPath).array; +      } +      string pdf_path_stuff() { +        return ((base.chainPath(base_filename(doc_matters.src.filename))).asNormalizedPath).array; +      } +    } +    return _PathsStruct(); +  } +} +#+END_SRC + +** _sqlite_ :sqlite:  *** discrete  #+NAME: template_paths_sqlite_0 diff --git a/org/out_metadata.org b/org/out_metadata.org index f0106d8..605c32e 100644 --- a/org/out_metadata.org +++ b/org/out_metadata.org @@ -79,6 +79,7 @@ if (doc_matters.opt.action.debug_do) {  }  auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language);  auto pth_epub = spinePathsEPUB!()(doc_matters.output_path, doc_matters.src.language); +auto pth_pdf  = spinePathsPDF!()(doc_matters);  auto pth_pod =  spinePathsPods!()(doc_matters);  metadata_ ~= format(q"┃<body lang="en" xml:lang="en">  <a name="top" id="top"></a> @@ -138,7 +139,15 @@ metadata_ ~= "<p class=\"lev1\">● outputs: [<a href=\""    ~ doc_matters.src.f               ~ "[<a href=\""    ~ doc_matters.src.filename_base ~ "/toc.html\">"               ~ " ▤ html seg </a>]"               ~ "[<a href=\"../../" ~ pth_epub.internal_base ~ "/" ~ doc_matters.src.filename_base ~ "." ~ doc_matters.src.language ~ ".epub\">" -             ~ " ◆ epub </a>]</p>"; +             ~ " ◆ epub </a>]"; +if (doc_matters.opt.action.html_pdf_link) { +  metadata_ ~=  "[<a href=\"../../pdf/" +             ~ doc_matters.src.filename_base +             ~ "." ~ doc_matters.src.language ~ ".a4.portrait.pdf\">" +             ~ " □ a4 pdf </a>]</p>"; +} else { +  metadata_ ~=  "</p>"; +}  if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) {    metadata_ ~= "<hr /><p class=\"lev0\">Topics:</p>";    string[] _top = ["", "", "", "", ""]; diff --git a/org/out_xmls.org b/org/out_xmls.org index fa2acc0..7f3f52a 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -404,18 +404,27 @@ import  ) {    string o;    string metadata_links = ((doc_matters.opt.action.html_curate_link) -    ? format(q"┃<p class="small">[<a href="%s"> ≅ </a>|<a href="%s"> %s </a>|<a href="%sepub/%s.%s.epub"> ◆ </a>|<a href="%smetadata.%s.html"> m </a>|<a href="%s../../authors.html"> A </a>|<a href="%s../../topics.html"> T </a>]</p>┃", +    ? format(q"┃<p class="small">[<a href="%s"> ≅ </a>|<a href="%s"> %s </a>|<a href="%sepub/%s.%s.epub"> ◆ </a>|%s<a href="%smetadata.%s.html"> m </a>|<a href="%s../../authors.html"> A </a>|<a href="%s../../topics.html"> T </a>]</p>┃",          (doc_matters.opt.action.webserver_url_doc_root.length > 0) -        ? doc_matters.opt.action.webserver_url_doc_root -        : doc_matters.conf_make_meta.conf.w_srv_data_root_url -        , // HOME index.html equivalent _cfg.www_url_doc_root, +          ? doc_matters.opt.action.webserver_url_doc_root +          : doc_matters.conf_make_meta.conf.w_srv_data_root_url +          , // HOME index.html equivalent _cfg.www_url_doc_root,          (type == "seg") -        ? "../" ~ doc_matters.src.filename_base ~ ".html" -        : "./" ~ doc_matters.src.filename_base ~ "/toc.html", +          ? "../" ~ doc_matters.src.filename_base ~ ".html" +          : "./" ~ doc_matters.src.filename_base ~ "/toc.html",          (type == "seg") ? "▣" : "▤", // ■ □ ▢ ▣ ▤ ▥ ▦ ▧ ▨ 〓          (type == "seg") ? "../../" : "../",          doc_matters.src.filename_base,          doc_matters.src.lng, +        (doc_matters.opt.action.html_pdf_link) +        ? ("<a href=\"" +          ~ ((type == "seg") ? "../../../" : "../../") +          ~ "pdf/" +          ~ doc_matters.src.filename_base +          ~  "." +          ~ doc_matters.src.lng +          ~ ".a4.portrait.pdf\"> □ </a>|") +        : "",          (type == "seg") ? "../" : "",          doc_matters.src.filename_base,          (type == "seg") ? "../" : "", diff --git a/org/spine.org b/org/spine.org index f8e34e3..52c0e6c 100644 --- a/org/spine.org +++ b/org/spine.org @@ -355,6 +355,7 @@ bool[string] opts = [    "curate-topics"               : false,    "html"                        : false,    "html-link-curate"            : false, +  "html-link-pdf"               : false,    "html-link-search"            : false,    "html-seg"                    : false,    "html-scroll"                 : false, @@ -470,6 +471,7 @@ auto helpInfo = getopt(args,    "hide-ocn",                   "object cite numbers",                                            &opts["hide-ocn"],    "html",                       "process html output",                                            &opts["html"],    "html-link-curate",           "place links back to curate in segmented html",                   &opts["html-link-curate"], +  "html-link-pdf",              "provide a link to pdf a4 output",                                &opts["html-link-pdf"],    "html-link-search",           "html embedded search submission",                                &opts["html-link-search"],    "html-seg",                   "process html output",                                            &opts["html-seg"],    "html-scroll",                "process html output",                                            &opts["html-scroll"], @@ -648,6 +650,9 @@ struct OptActions {    @trusted bool html_curate_link() {      return (opts["html-link-curate"]) ? true : false;    } +  @trusted bool html_pdf_link() { +    return (opts["html-link-pdf"]) ? true : false; +  }    @trusted bool html_search_link() {      return (opts["html-link-search"]) ? true : false;    } diff --git a/src/doc_reform/io_out/metadata.d b/src/doc_reform/io_out/metadata.d index 9d6d57a..e3c04c1 100644 --- a/src/doc_reform/io_out/metadata.d +++ b/src/doc_reform/io_out/metadata.d @@ -344,6 +344,7 @@ string theme_light_1 = format(q"┃      }      auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language);      auto pth_epub = spinePathsEPUB!()(doc_matters.output_path, doc_matters.src.language); +    auto pth_pdf  = spinePathsPDF!()(doc_matters);      auto pth_pod =  spinePathsPods!()(doc_matters);      metadata_ ~= format(q"┃<body lang="en" xml:lang="en">      <a name="top" id="top"></a> @@ -403,7 +404,15 @@ string theme_light_1 = format(q"┃                   ~ "[<a href=\""    ~ doc_matters.src.filename_base ~ "/toc.html\">"                   ~ " ▤ html seg </a>]"                   ~ "[<a href=\"../../" ~ pth_epub.internal_base ~ "/" ~ doc_matters.src.filename_base ~ "." ~ doc_matters.src.language ~ ".epub\">" -                 ~ " ◆ epub </a>]</p>"; +                 ~ " ◆ epub </a>]"; +    if (doc_matters.opt.action.html_pdf_link) { +      metadata_ ~=  "[<a href=\"../../pdf/" +                 ~ doc_matters.src.filename_base +                 ~ "." ~ doc_matters.src.language ~ ".a4.portrait.pdf\">" +                 ~ " □ a4 pdf </a>]</p>"; +    } else { +      metadata_ ~=  "</p>"; +    }      if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) {        metadata_ ~= "<hr /><p class=\"lev0\">Topics:</p>";        string[] _top = ["", "", "", "", ""]; diff --git a/src/doc_reform/io_out/paths_output.d b/src/doc_reform/io_out/paths_output.d index a6a1a9b..fc31711 100644 --- a/src/doc_reform/io_out/paths_output.d +++ b/src/doc_reform/io_out/paths_output.d @@ -540,6 +540,30 @@ template spinePathsODT() {      return _PathsStruct();    }  } +template spinePathsPDF() { +  mixin spineRgxIn; +  static auto rgx = RgxI(); +  auto spinePathsPDF(M)( +    M  doc_matters, +  ) { +    struct _PathsStruct { +      string base_filename(string fn_src) { +        return fn_src.baseName.stripExtension; +      } +      auto out_pth() { +        string output_dir = doc_matters.output_path ~ "/pdf"; +        return spineOutPaths!()(output_dir); +      } +      string base() { +        return (((out_pth.output_root).chainPath("pdf")).asNormalizedPath).array; +      } +      string pdf_path_stuff() { +        return ((base.chainPath(base_filename(doc_matters.src.filename))).asNormalizedPath).array; +      } +    } +    return _PathsStruct(); +  } +}  template spinePathsLaTeX() {    mixin spineRgxIn;    static auto rgx = RgxI(); diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index 62d8842..d7d3436 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -290,18 +290,27 @@ template outputXHTMLs() {      ) {        string o;        string metadata_links = ((doc_matters.opt.action.html_curate_link) -        ? format(q"┃<p class="small">[<a href="%s"> ≅ </a>|<a href="%s"> %s </a>|<a href="%sepub/%s.%s.epub"> ◆ </a>|<a href="%smetadata.%s.html"> m </a>|<a href="%s../../authors.html"> A </a>|<a href="%s../../topics.html"> T </a>]</p>┃", +        ? format(q"┃<p class="small">[<a href="%s"> ≅ </a>|<a href="%s"> %s </a>|<a href="%sepub/%s.%s.epub"> ◆ </a>|%s<a href="%smetadata.%s.html"> m </a>|<a href="%s../../authors.html"> A </a>|<a href="%s../../topics.html"> T </a>]</p>┃",              (doc_matters.opt.action.webserver_url_doc_root.length > 0) -            ? doc_matters.opt.action.webserver_url_doc_root -            : doc_matters.conf_make_meta.conf.w_srv_data_root_url -            , // HOME index.html equivalent _cfg.www_url_doc_root, +              ? doc_matters.opt.action.webserver_url_doc_root +              : doc_matters.conf_make_meta.conf.w_srv_data_root_url +              , // HOME index.html equivalent _cfg.www_url_doc_root,              (type == "seg") -            ? "../" ~ doc_matters.src.filename_base ~ ".html" -            : "./" ~ doc_matters.src.filename_base ~ "/toc.html", +              ? "../" ~ doc_matters.src.filename_base ~ ".html" +              : "./" ~ doc_matters.src.filename_base ~ "/toc.html",              (type == "seg") ? "▣" : "▤", // ■ □ ▢ ▣ ▤ ▥ ▦ ▧ ▨ 〓              (type == "seg") ? "../../" : "../",              doc_matters.src.filename_base,              doc_matters.src.lng, +            (doc_matters.opt.action.html_pdf_link) +            ? ("<a href=\"" +              ~ ((type == "seg") ? "../../../" : "../../") +              ~ "pdf/" +              ~ doc_matters.src.filename_base +              ~  "." +              ~ doc_matters.src.lng +              ~ ".a4.portrait.pdf\"> □ </a>|") +            : "",              (type == "seg") ? "../" : "",              doc_matters.src.filename_base,              (type == "seg") ? "../" : "", diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index 06b483c..6d1a133 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -136,6 +136,7 @@ string program_name = "spine";      "curate-topics"               : false,      "html"                        : false,      "html-link-curate"            : false, +    "html-link-pdf"               : false,      "html-link-search"            : false,      "html-seg"                    : false,      "html-scroll"                 : false, @@ -237,6 +238,7 @@ string program_name = "spine";      "hide-ocn",                   "object cite numbers",                                            &opts["hide-ocn"],      "html",                       "process html output",                                            &opts["html"],      "html-link-curate",           "place links back to curate in segmented html",                   &opts["html-link-curate"], +    "html-link-pdf",              "provide a link to pdf a4 output",                                &opts["html-link-pdf"],      "html-link-search",           "html embedded search submission",                                &opts["html-link-search"],      "html-seg",                   "process html output",                                            &opts["html-seg"],      "html-scroll",                "process html output",                                            &opts["html-scroll"], @@ -408,6 +410,9 @@ string program_name = "spine";      @trusted bool html_curate_link() {        return (opts["html-link-curate"]) ? true : false;      } +    @trusted bool html_pdf_link() { +      return (opts["html-link-pdf"]) ? true : false; +    }      @trusted bool html_search_link() {        return (opts["html-link-search"]) ? true : false;      } | 
