diff options
| -rw-r--r-- | org/meta_conf_make_meta.org | 17 | ||||
| -rw-r--r-- | org/out_xmls.org | 116 | ||||
| -rw-r--r-- | org/out_xmls_css.org | 18 | ||||
| -rw-r--r-- | src/doc_reform/io_out/epub3.d | 4 | ||||
| -rw-r--r-- | src/doc_reform/io_out/html.d | 4 | ||||
| -rw-r--r-- | src/doc_reform/io_out/xmls.d | 108 | ||||
| -rw-r--r-- | src/doc_reform/io_out/xmls_css.d | 54 | ||||
| -rw-r--r-- | src/doc_reform/meta/conf_make_meta_yaml.d | 12 | 
8 files changed, 245 insertions, 88 deletions
| diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org index f91a615..331fe49 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -16,6 +16,18 @@  #+PROPERTY:    header-args+ :padline no  #+PROPERTY:    header-args+ :mkdirp yes +#+NAME: meta_check_input_markup +#+BEGIN_SRC d +string check_input_markup()( +  string _txt, +) { +  _txt = _txt +   .replaceAll(regex(r"\\"), mkup.br_newline_inline) +   .strip; +  return _txt; +} +#+END_SRC +  [[./spine.org][spine]]  [[./][org/]]  * generic  ** conf yaml REFERENCE @@ -573,6 +585,7 @@ template contentYAMLtoSpineStruct() {    ) {      mixin spineRgxIn;      static auto rgx = RgxI(); +    <<meta_check_input_markup>>      confCompositeMakeBuild _mk;      if (_identifier != "header") { // called only once per run anyway        <<yaml_objects_conf>> @@ -1647,7 +1660,7 @@ if ("rights" in _yaml        && _yaml["rights"]["copyright"].type.string        && _yaml["rights"]["copyright"].tag.match(rgx.yaml_tag_is_str)      ) { -      _struct_composite.meta.rights_copyright = _yaml["rights"]["copyright"].get!string; +      _struct_composite.meta.rights_copyright = check_input_markup(_yaml["rights"]["copyright"].get!string);      }      if ("copyright_text" in _yaml["rights"]        && _yaml["rights"]["copyright_text"].type.string @@ -1695,7 +1708,7 @@ if ("rights" in _yaml        && _yaml["rights"]["license"].type.string        && _yaml["rights"]["license"].tag.match(rgx.yaml_tag_is_str)      ) { -      _struct_composite.meta.rights_license = _yaml["rights"]["license"].get!string; +      _struct_composite.meta.rights_license = check_input_markup(_yaml["rights"]["license"].get!string);      }    }  } diff --git a/org/out_xmls.org b/org/out_xmls.org index a113832..9348a55 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -544,13 +544,36 @@ import  #+NAME: xhtml_format_objects_tail  #+BEGIN_SRC d -@safe string tail() { +@safe string tail(M)(M doc_matters) {    string o; -  o = format(q"┃ +  o = format(q"┃<hr /> +  <div class="rights"> +    <p class="small" id="copyright"><a name="copyright"></a> +      <b>Copyright:</b> %s +    </p> +  </div> +  %s +  <div class="rights"> +    <p class="small" id="rights"><a name="rights"></a> +      %s +    </p> +  </div> +  <hr /> +  <div class="generator"> +    <p class="small_center" id="sisu_spine"><a name="sisu_spine"></a> +      <a href="https://sisudoc.org">SiSU Spine</a> (object numbering & search) +    </p> +  </div>    <a name="bottom" id="bottom"></a>    <a name="end" id="end"></a>  </body> -</html>┃"); +</html> +┃", +    special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright), +    ((doc_matters.conf_make_meta.meta.rights_license).empty) ? "" : "<br />", +    ((doc_matters.conf_make_meta.meta.rights_license).empty) ? "" +      : "<b>License:</b> " ~ special_characters_text(doc_matters.conf_make_meta.meta.rights_license) +  );    return o;  }  #+END_SRC @@ -985,48 +1008,65 @@ import    ┃",      _horizontal_rule,      ); -  } else if (!(obj.metainfo.identifier.empty)) { -    o = format(q"┃%s +  } else { +    o = ""; +    if (obj.metainfo.is_of_section == "toc") { +      o ~= format(q"┃ +  <div class="substance"> +    <p class="small" id="copyright"><a name="copyright"></a> +      Copyright: %s +    </p> +    <!-- <p class="small" id="rights"><a name="rights"></a> +      %s +    </p> --> +  </div>┃", +        special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright), +        special_characters_text(doc_matters.conf_make_meta.meta.rights_license) +      ); +    } +  } +    if (!(obj.metainfo.identifier.empty)) { +      o ~= format(q"┃%s    <div class="substance">      <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label>      <h%s class="%s" id="%s"><a name="%s"></a>%s%s        %s      </h%s>    </div>┃", -      _horizontal_rule, -      obj.metainfo.identifier, -      (doc_matters.opt.action.ocn_off) -        ? "" : ((obj.metainfo.object_number.empty) -          ? "" : obj.metainfo.identifier), -      ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -      : obj.metainfo.heading_lev_markup), -      obj.metainfo.is_a, -      obj.metainfo.identifier, -      obj.metainfo.identifier, -      tags, -      heading_lev_anchor_tag, -      _txt, -      ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -      : obj.metainfo.heading_lev_markup), -    ); -  } else { -    o = format(q"┃%s +        _horizontal_rule, +        obj.metainfo.identifier, +        (doc_matters.opt.action.ocn_off) +          ? "" : ((obj.metainfo.object_number.empty) +            ? "" : obj.metainfo.identifier), +        ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +        : obj.metainfo.heading_lev_markup), +        obj.metainfo.is_a, +        obj.metainfo.identifier, +        obj.metainfo.identifier, +        tags, +        heading_lev_anchor_tag, +        _txt, +        ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +        : obj.metainfo.heading_lev_markup), +      ); +    } else { +      o ~= format(q"┃%s    <div class="substance">      <h%s class="%s">%s%s        %s      </h%s>    </div>┃", -      _horizontal_rule, -      ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -      : obj.metainfo.heading_lev_markup), -      obj.metainfo.is_a, -      tags, -      heading_lev_anchor_tag, -      _txt, -      ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -      : obj.metainfo.heading_lev_markup), -    ); -  } +        _horizontal_rule, +        ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +        : obj.metainfo.heading_lev_markup), +        obj.metainfo.is_a, +        tags, +        heading_lev_anchor_tag, +        _txt, +        ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +        : obj.metainfo.heading_lev_markup), +      ); +    }    return o;  }  #+END_SRC @@ -1886,7 +1926,7 @@ default:    doc = xhtml_format.html_head(doc_matters, "scroll")      ~ doc_html      ~ xhtml_format.dom_close -    ~ xhtml_format.tail; +    ~ xhtml_format.tail(doc_matters);    scroll_write_output(doc, doc_matters);  }  #+END_SRC @@ -2256,7 +2296,7 @@ default:        foreach (docseg; doc_html_endnotes[seg_filename]) {          f.writeln(docseg);        } -      f.writeln(xhtml_format.tail); +      f.writeln(xhtml_format.tail(doc_matters));      }    } catch (ErrnoException ex) {      // handle error @@ -3076,7 +3116,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS              foreach (docseg; epub_write.doc_epub3_endnotes[seg_filename]) {                f.writeln(docseg);              } -            f.writeln(xhtml_format.tail); +            f.writeln(xhtml_format.tail(doc_matters));            }          }          foreach (docseg; epub_write.doc_epub3[seg_filename]) { @@ -3085,7 +3125,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS          foreach (docseg; epub_write.doc_epub3_endnotes[seg_filename]) {            zip_data.write(docseg.dup);          } -        zip_data.write(xhtml_format.tail.dup); +        zip_data.write(xhtml_format.tail(doc_matters).dup);          zip_arc_member_file.expandedData = zip_data.toBytes();          zip.addMember(zip_arc_member_file);          /+ create the zip file +/ diff --git a/org/out_xmls_css.org b/org/out_xmls_css.org index f49e56a..9c1bf7a 100644 --- a/org/out_xmls_css.org +++ b/org/out_xmls_css.org @@ -508,13 +508,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.2rem;    margin-top               : 0px; @@ -1424,13 +1431,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.35rem;    margin-top               : 0px; diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index efdf12c..8a8b9e4 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -670,7 +670,7 @@ template outputEPub3() {                foreach (docseg; epub_write.doc_epub3_endnotes[seg_filename]) {                  f.writeln(docseg);                } -              f.writeln(xhtml_format.tail); +              f.writeln(xhtml_format.tail(doc_matters));              }            }            foreach (docseg; epub_write.doc_epub3[seg_filename]) { @@ -679,7 +679,7 @@ template outputEPub3() {            foreach (docseg; epub_write.doc_epub3_endnotes[seg_filename]) {              zip_data.write(docseg.dup);            } -          zip_data.write(xhtml_format.tail.dup); +          zip_data.write(xhtml_format.tail(doc_matters).dup);            zip_arc_member_file.expandedData = zip_data.toBytes();            zip.addMember(zip_arc_member_file);            /+ create the zip file +/ diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index 136229b..4efc91d 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -234,7 +234,7 @@ template outputHTML() {      doc = xhtml_format.html_head(doc_matters, "scroll")        ~ doc_html        ~ xhtml_format.dom_close -      ~ xhtml_format.tail; +      ~ xhtml_format.tail(doc_matters);      scroll_write_output(doc, doc_matters);    }    @trusted void scroll_write_output(D,M)( @@ -543,7 +543,7 @@ template outputHTML() {          foreach (docseg; doc_html_endnotes[seg_filename]) {            f.writeln(docseg);          } -        f.writeln(xhtml_format.tail); +        f.writeln(xhtml_format.tail(doc_matters));        }      } catch (ErrnoException ex) {        // handle error diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index fd9305a..871332d 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -417,13 +417,36 @@ template outputXHTMLs() {    o = format(q"┃</div>┃");    return o;  } -@safe string tail() { +@safe string tail(M)(M doc_matters) {    string o; -  o = format(q"┃ +  o = format(q"┃<hr /> +  <div class="rights"> +    <p class="small" id="copyright"><a name="copyright"></a> +      <b>Copyright:</b> %s +    </p> +  </div> +  %s +  <div class="rights"> +    <p class="small" id="rights"><a name="rights"></a> +      %s +    </p> +  </div> +  <hr /> +  <div class="generator"> +    <p class="small_center" id="sisu_spine"><a name="sisu_spine"></a> +      <a href="https://sisudoc.org">SiSU Spine</a> (object numbering & search) +    </p> +  </div>    <a name="bottom" id="bottom"></a>    <a name="end" id="end"></a>  </body> -</html>┃"); +</html> +┃", +    special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright), +    ((doc_matters.conf_make_meta.meta.rights_license).empty) ? "" : "<br />", +    ((doc_matters.conf_make_meta.meta.rights_license).empty) ? "" +      : "<b>License:</b> " ~ special_characters_text(doc_matters.conf_make_meta.meta.rights_license) +  );    return o;  }      @safe string inline_images(O,M)( @@ -798,48 +821,65 @@ template outputXHTMLs() {        ┃",          _horizontal_rule,          ); -      } else if (!(obj.metainfo.identifier.empty)) { -        o = format(q"┃%s +      } else { +        o = ""; +        if (obj.metainfo.is_of_section == "toc") { +          o ~= format(q"┃ +      <div class="substance"> +        <p class="small" id="copyright"><a name="copyright"></a> +          Copyright: %s +        </p> +        <!-- <p class="small" id="rights"><a name="rights"></a> +          %s +        </p> --> +      </div>┃", +            special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright), +            special_characters_text(doc_matters.conf_make_meta.meta.rights_license) +          ); +        } +      } +        if (!(obj.metainfo.identifier.empty)) { +          o ~= format(q"┃%s        <div class="substance">          <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label>          <h%s class="%s" id="%s"><a name="%s"></a>%s%s            %s          </h%s>        </div>┃", -          _horizontal_rule, -          obj.metainfo.identifier, -          (doc_matters.opt.action.ocn_off) -            ? "" : ((obj.metainfo.object_number.empty) -              ? "" : obj.metainfo.identifier), -          ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -          : obj.metainfo.heading_lev_markup), -          obj.metainfo.is_a, -          obj.metainfo.identifier, -          obj.metainfo.identifier, -          tags, -          heading_lev_anchor_tag, -          _txt, -          ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -          : obj.metainfo.heading_lev_markup), -        ); -      } else { -        o = format(q"┃%s +            _horizontal_rule, +            obj.metainfo.identifier, +            (doc_matters.opt.action.ocn_off) +              ? "" : ((obj.metainfo.object_number.empty) +                ? "" : obj.metainfo.identifier), +            ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +            : obj.metainfo.heading_lev_markup), +            obj.metainfo.is_a, +            obj.metainfo.identifier, +            obj.metainfo.identifier, +            tags, +            heading_lev_anchor_tag, +            _txt, +            ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +            : obj.metainfo.heading_lev_markup), +          ); +        } else { +          o ~= format(q"┃%s        <div class="substance">          <h%s class="%s">%s%s            %s          </h%s>        </div>┃", -          _horizontal_rule, -          ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -          : obj.metainfo.heading_lev_markup), -          obj.metainfo.is_a, -          tags, -          heading_lev_anchor_tag, -          _txt, -          ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 -          : obj.metainfo.heading_lev_markup), -        ); -      } +            _horizontal_rule, +            ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +            : obj.metainfo.heading_lev_markup), +            obj.metainfo.is_a, +            tags, +            heading_lev_anchor_tag, +            _txt, +            ((_xml_type == "epub" && obj.metainfo.heading_lev_markup == 0) ? 1 +            : obj.metainfo.heading_lev_markup), +          ); +        }        return o;      }      @safe string heading_scroll(O,M)( diff --git a/src/doc_reform/io_out/xmls_css.d b/src/doc_reform/io_out/xmls_css.d index bb2cdfc..505287e 100644 --- a/src/doc_reform/io_out/xmls_css.d +++ b/src/doc_reform/io_out/xmls_css.d @@ -762,13 +762,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.2rem;    margin-top               : 0px; @@ -1485,13 +1492,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.35rem;    margin-top               : 0px; @@ -2211,13 +2225,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.2rem;    margin-top               : 0px; @@ -2860,13 +2881,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.35rem;    margin-top               : 0px; @@ -3512,13 +3540,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.2rem;    margin-top               : 0px; @@ -4051,13 +4086,20 @@ p.em {    font-style               : normal;    background               : #FFF3B6;  } -p.small { +.small, .small_center {    font-size                : 1.4rem;    margin-top               : 0px;    margin-bottom            : 0px;    margin-right             : 6px; +} +p.small {    text-align               : left;  } +p.small_center { +  margin-left              : 0px; +  margin-right             : 0px; +  text-align               : center; +}  .tiny, .tiny_left, .tiny_right, .tiny_center {    font-size                : 1.35rem;    margin-top               : 0px; diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index af6096a..ff0bcf5 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -80,6 +80,14 @@ template contentYAMLtoSpineStruct() {    ) {      mixin spineRgxIn;      static auto rgx = RgxI(); +    string check_input_markup()( +      string _txt, +    ) { +      _txt = _txt +       .replaceAll(regex(r"\\"), mkup.br_newline_inline) +       .strip; +      return _txt; +    }      confCompositeMakeBuild _mk;      if (_identifier != "header") { // called only once per run anyway        /+ conf ------------------------------------------------------------------- +/ @@ -1127,7 +1135,7 @@ template contentYAMLtoSpineStruct() {              && _yaml["rights"]["copyright"].type.string              && _yaml["rights"]["copyright"].tag.match(rgx.yaml_tag_is_str)            ) { -            _struct_composite.meta.rights_copyright = _yaml["rights"]["copyright"].get!string; +            _struct_composite.meta.rights_copyright = check_input_markup(_yaml["rights"]["copyright"].get!string);            }            if ("copyright_text" in _yaml["rights"]              && _yaml["rights"]["copyright_text"].type.string @@ -1175,7 +1183,7 @@ template contentYAMLtoSpineStruct() {              && _yaml["rights"]["license"].type.string              && _yaml["rights"]["license"].tag.match(rgx.yaml_tag_is_str)            ) { -            _struct_composite.meta.rights_license = _yaml["rights"]["license"].get!string; +            _struct_composite.meta.rights_license = check_input_markup(_yaml["rights"]["license"].get!string);            }          }        } | 
