From 1716ad72ccb6454529a9fc05b0f5a79fd72a8748 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 12 Sep 2026 23:55:37 -0400 Subject: epub, html: a named anchor, and subtitle fixes fixes related to: - named anchor id - subtitles, emit only where they exist (assisted by Claude-Code) --- org/out_xmls.org | 31 +++++++++++++++---------------- src/sisudoc/outputs/io_out/epub3.d | 10 +++++----- src/sisudoc/outputs/io_out/xmls.d | 21 ++++++++++----------- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/org/out_xmls.org b/org/out_xmls.org index f40a8fe..33dfa5d 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -308,7 +308,7 @@ string _xhtml_anchor_tags(O)(O obj) { if (obj.tags.anchor_tags.length > 0) { foreach (tag; obj.tags.anchor_tags) { if (!(tag.empty)) { - tags ~= ""; + tags ~= ""; /+ repeated markers, not unique targets: see below +/ } } } @@ -519,7 +519,7 @@ string html_head(M)( - +
%s @@ -595,7 +595,7 @@ string epub3_seg_head(M)( -┃", +┃", html_simple, special_characters_plain(doc_matters.conf_make_meta.meta.title_full), (doc_matters.conf_make_meta.meta.creator_author.empty) ? "" @@ -645,7 +645,7 @@ string tail(M)(M doc_matters) {
%s
-

+

%s

@@ -658,8 +658,8 @@ string tail(M)(M doc_matters) { (web 1993, object numbering 1997, object search 2002 ...) <>

- - + + ┃", @@ -1096,7 +1096,7 @@ string heading(O,M)( string o; heading_lev_anchor_tag = (obj.tags.heading_lev_anchor_tag.empty) ? "" - : ""; + : ""; if (_txt.empty) { o = format(q"┃%s ┃", @@ -1110,7 +1110,7 @@ string heading(O,M)( - ┃", @@ -1123,7 +1123,7 @@ string heading(O,M)( o ~= format(q"┃%s
- %s%s + %s%s %s
┃", @@ -1136,7 +1136,6 @@ string heading(O,M)( : obj.metainfo.heading_lev_markup), obj.metainfo.is_a, obj.metainfo.identifier, - obj.metainfo.identifier, tags, heading_lev_anchor_tag, _txt, @@ -1223,7 +1222,7 @@ string para(O,M)( string o; _txt = (obj.attrib.bullet) ? ("●  " ~ _txt) : _txt; _txt = _txt.replaceFirst(rgx.inline_link_anchor, - ""); + ""); if (!(obj.metainfo.identifier.empty)) { o = format(q"┃
@@ -2610,9 +2609,7 @@ string epub3_oebps_content(D,P)(D doc, P parts) { urn:uuid:%s %s main - %s - subtitle - %s +%s %s %s %s %s @@ -2625,8 +2622,10 @@ string epub3_oebps_content(D,P)(D doc, P parts) { ┃", _uuid, xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.title_main), - (doc.matters.conf_make_meta.meta.title_sub.empty) - ? "" : xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.title_sub), + (doc.matters.conf_make_meta.meta.title_sub.empty) ? "" : format( + " %s\n" + ~ " subtitle\n", + xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.title_sub)), (doc.matters.conf_make_meta.meta.creator_author.empty) ? "" : xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.creator_author), (doc.matters.conf_make_meta.meta.creator_author_surname_fn.empty) diff --git a/src/sisudoc/outputs/io_out/epub3.d b/src/sisudoc/outputs/io_out/epub3.d index b606e7a..b00165d 100644 --- a/src/sisudoc/outputs/io_out/epub3.d +++ b/src/sisudoc/outputs/io_out/epub3.d @@ -115,9 +115,7 @@ template outputEPub3() { urn:uuid:%s %s main - %s - subtitle - %s + %s %s %s %s %s @@ -130,8 +128,10 @@ template outputEPub3() { ┃", _uuid, xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.title_main), - (doc.matters.conf_make_meta.meta.title_sub.empty) - ? "" : xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.title_sub), + (doc.matters.conf_make_meta.meta.title_sub.empty) ? "" : format( + " %s\n" + ~ " subtitle\n", + xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.title_sub)), (doc.matters.conf_make_meta.meta.creator_author.empty) ? "" : xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.creator_author), (doc.matters.conf_make_meta.meta.creator_author_surname_fn.empty) diff --git a/src/sisudoc/outputs/io_out/xmls.d b/src/sisudoc/outputs/io_out/xmls.d index 66f2b1e..097ce44 100644 --- a/src/sisudoc/outputs/io_out/xmls.d +++ b/src/sisudoc/outputs/io_out/xmls.d @@ -210,7 +210,7 @@ template outputXHTMLs() { if (obj.tags.anchor_tags.length > 0) { foreach (tag; obj.tags.anchor_tags) { if (!(tag.empty)) { - tags ~= ""; + tags ~= ""; /+ repeated markers, not unique targets: see below +/ } } } @@ -394,7 +394,7 @@ template outputXHTMLs() { - +
%s @@ -464,7 +464,7 @@ template outputXHTMLs() { - ┃", + ┃", html_simple, special_characters_plain(doc_matters.conf_make_meta.meta.title_full), (doc_matters.conf_make_meta.meta.creator_author.empty) ? "" @@ -501,7 +501,7 @@ string tail(M)(M doc_matters) {
%s
-

+

%s

@@ -514,8 +514,8 @@ string tail(M)(M doc_matters) { (web 1993, object numbering 1997, object search 2002 ...) 2026

- - + + ┃", @@ -892,7 +892,7 @@ string tail(M)(M doc_matters) { string o; heading_lev_anchor_tag = (obj.tags.heading_lev_anchor_tag.empty) ? "" - : ""; + : ""; if (_txt.empty) { o = format(q"┃%s ┃", @@ -906,7 +906,7 @@ string tail(M)(M doc_matters) { -
┃", @@ -919,7 +919,7 @@ string tail(M)(M doc_matters) { o ~= format(q"┃%s
- %s%s + %s%s %s
┃", @@ -932,7 +932,6 @@ string tail(M)(M doc_matters) { : obj.metainfo.heading_lev_markup), obj.metainfo.is_a, obj.metainfo.identifier, - obj.metainfo.identifier, tags, heading_lev_anchor_tag, _txt, @@ -1000,7 +999,7 @@ string tail(M)(M doc_matters) { string o; _txt = (obj.attrib.bullet) ? ("●  " ~ _txt) : _txt; _txt = _txt.replaceFirst(rgx.inline_link_anchor, - ""); + ""); if (!(obj.metainfo.identifier.empty)) { o = format(q"┃
-- cgit v1.2.3