From 3c2da303eed87e506533c738c1bcfda154944790 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 25 Jan 2022 14:36:59 -0500 Subject: doc presentation, add option to include date with title and author --- src/doc_reform/io_out/epub3.d | 4 +++- src/doc_reform/io_out/xmls.d | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/doc_reform/io_out') diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index 029a2c2..6593db5 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -70,6 +70,8 @@ template outputEPub3() { .replaceAll(rgx.xhtml_quotation, """) // """ .replaceAll(rgx.xhtml_less_than, "<") // "<" .replaceAll(rgx.xhtml_greater_than, ">") // ">" + .replaceAll(rgx.br_line, "
") + .replaceAll(rgx.br_nl, "
") .replaceAll(rgx.nbsp_char, " "); return _txt; } @@ -126,7 +128,7 @@ template outputEPub3() { ? "" : xhtml_format.special_characters_text(doc_matters.conf_make_meta.meta.creator_author), doc_matters.src.language, // language, fix (needed in dochead metadata) (doc_matters.conf_make_meta.meta.date_published.empty) - ? "" : xhtml_format.special_characters_text(doc_matters.conf_make_meta.meta.date_published), + ? "" : xhtml_format.special_characters_date(doc_matters.conf_make_meta.meta.date_published), (doc_matters.conf_make_meta.meta.rights_copyright.empty) ? "" : xhtml_format.special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright), _uuid, diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index f0c7185..f4ca976 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -99,6 +99,16 @@ template outputXHTMLs() { .replaceAll(rgx.xhtml_quotation, """) // """ .replaceAll(rgx.xhtml_less_than, "<") // "<" .replaceAll(rgx.xhtml_greater_than, ">") // ">" + .replaceAll(rgx.br_line, "
") + .replaceAll(rgx.br_nl, "
") + .replaceAll(rgx.nbsp_char, " "); + return _txt; + } + @safe string special_characters_date(string _txt) { + _txt = _txt + .replaceAll(regex(r"(?:-00)+"), "") + .replaceAll(rgx.br_line, "
") + .replaceAll(rgx.br_nl, "
") .replaceAll(rgx.nbsp_char, " "); return _txt; } @@ -202,7 +212,7 @@ template outputXHTMLs() { special_characters_text(doc_matters.conf_make_meta.meta.title_full), special_characters_text(doc_matters.conf_make_meta.meta.creator_author), _publisher, - special_characters_text(doc_matters.conf_make_meta.meta.date_published), + special_characters_date(doc_matters.conf_make_meta.meta.date_published), special_characters_text(doc_matters.conf_make_meta.meta.date_created), special_characters_text(doc_matters.conf_make_meta.meta.date_issued), special_characters_text(doc_matters.conf_make_meta.meta.date_available), @@ -382,7 +392,7 @@ template outputXHTMLs() { special_characters_text(doc_matters.conf_make_meta.meta.title_full), (doc_matters.conf_make_meta.meta.creator_author.empty) ? "" : ", " ~ special_characters_text(doc_matters.conf_make_meta.meta.creator_author), - special_characters_text(doc_matters.conf_make_meta.meta.date_published), + special_characters_date(doc_matters.conf_make_meta.meta.date_published), special_characters_text(doc_matters.conf_make_meta.meta.date_created), special_characters_text(doc_matters.conf_make_meta.meta.date_issued), special_characters_text(doc_matters.conf_make_meta.meta.date_available), -- cgit v1.2.3