From a47b0ef98ca7c5c47b81227b06f993609c41c3ff Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 24 Jun 2023 15:22:30 -0400 Subject: ocda, process section rather than part --- org/out_xmls.org | 100 +++++++++++++++++++++--------------------- src/doc_reform/io_out/epub3.d | 30 ++++++------- src/doc_reform/io_out/html.d | 56 +++++++++++------------ src/doc_reform/io_out/xmls.d | 14 +++--- 4 files changed, 100 insertions(+), 100 deletions(-) diff --git a/org/out_xmls.org b/org/out_xmls.org index 6d0e624..4a2626b 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -130,13 +130,13 @@ import #+NAME: xhtml_format_objects_div_delimit #+BEGIN_SRC d @safe string div_delimit( - string part, - return ref string previous_part + string section, + return ref string previous_section ) { string delimit = ""; string delimit_ = ""; - if (part != previous_part) { - switch (part) { + if (section != previous_section) { + switch (section) { case "head": delimit_ ~= "\n
\n" ; break; @@ -147,13 +147,13 @@ import delimit_ ~= "\n
\n" ; break; default: - delimit_ ~= "\n
\n" ; + delimit_ ~= "\n
\n" ; break; } - if (previous_part.length > 0) { + if (previous_section.length > 0) { delimit ~= "\n
"; } - previous_part = part; + previous_section = section; delimit ~= delimit_; } // you also need to close the last div, introduce a footer? @@ -1801,7 +1801,7 @@ template outputHTML() { string[] doc_html; string[] doc; string suffix = ".html"; - string previous_part = ""; + string previous_section = ""; string delimit = ""; #+END_SRC @@ -1809,9 +1809,9 @@ template outputHTML() { #+NAME: output_html_scroll_loop_parts #+BEGIN_SRC d -foreach (part; doc_matters.has.keys_seq.scroll) { - foreach (obj; doc_abstraction[part]) { - delimit = xhtml_format.div_delimit(part, previous_part); +foreach (section; doc_matters.has.keys_seq.scroll) { + foreach (obj; doc_abstraction[section]) { + delimit = xhtml_format.div_delimit(section, previous_section); string _txt = xhtml_format.special_characters_breaks_indents_bullets(obj); switch (obj.metainfo.is_of_part) { #+END_SRC @@ -1820,7 +1820,7 @@ foreach (part; doc_matters.has.keys_seq.scroll) { #+NAME: output_html_scroll_is_frontmatter #+BEGIN_SRC d -case "frontmatter": assert(part == "head" || "toc"); +case "frontmatter": assert(section == "head" || "toc"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -1854,7 +1854,7 @@ case "frontmatter": assert(part == "head" || "toc"); #+NAME: output_html_scroll_is_body #+BEGIN_SRC d -case "body": assert(part == "body" || "head"); +case "body": assert(section == "body" || "head"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -1920,29 +1920,29 @@ case "body": assert(part == "body" || "head"); #+NAME: output_html_scroll_is_backmatter #+BEGIN_SRC d case "backmatter": - assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { case "heading": doc_html ~= delimit ~ xhtml_format.heading_scroll(_txt, obj, doc_matters, suffix); break; - case "endnote": assert(part == "endnotes"); + case "endnote": assert(section == "endnotes"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "glossary": assert(part == "glossary"); + case "glossary": assert(section == "glossary"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "bibliography": assert(part == "bibliography"); + case "bibliography": assert(section == "bibliography"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "bookindex": assert(part == "bookindex"); + case "bookindex": assert(section == "bookindex"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "blurb": assert(part == "blurb"); + case "blurb": assert(section == "blurb"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "tail": assert(part == "tail"); + case "tail": assert(section == "tail"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; default: @@ -2041,7 +2041,7 @@ default: string[] top_level_headings = ["","","",""]; string previous_seg_filename = ""; string suffix = ".html"; - string previous_part = ""; + string previous_section = ""; string delimit = ""; #+END_SRC @@ -2049,9 +2049,9 @@ default: #+NAME: output_html_seg_loop_parts #+BEGIN_SRC d -foreach (part; doc_matters.has.keys_seq.seg) { - foreach (obj; doc_abstraction[part]) { - delimit = xhtml_format.div_delimit(part, previous_part); +foreach (section; doc_matters.has.keys_seq.seg) { + foreach (obj; doc_abstraction[section]) { + delimit = xhtml_format.div_delimit(section, previous_section); string _txt = xhtml_format.special_characters_breaks_indents_bullets(obj); #+END_SRC @@ -2060,7 +2060,7 @@ foreach (part; doc_matters.has.keys_seq.seg) { #+NAME: output_html_seg_is_heading #+BEGIN_SRC d if (obj.metainfo.is_a == "heading") { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.heading_lev_markup) { case 0: .. case 3: /+ fill buffer, and replace with new levels from 1 to 3 +/ @@ -2131,7 +2131,7 @@ if (obj.metainfo.is_a == "heading") { #+NAME: output_html_seg_is_not_heading_switch #+BEGIN_SRC d } else { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); Tuple!(string, string[]) t; switch (obj.metainfo.is_of_part) { #+END_SRC @@ -2140,7 +2140,7 @@ if (obj.metainfo.is_a == "heading") { #+NAME: output_html_seg_is_frontmatter #+BEGIN_SRC d -case "frontmatter": assert(part == "head" || "toc"); +case "frontmatter": assert(section == "head" || "toc"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -2172,7 +2172,7 @@ case "frontmatter": assert(part == "head" || "toc"); #+NAME: output_html_seg_is_body #+BEGIN_SRC d -case "body": assert(part == "body"); +case "body": assert(section == "body"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -2245,35 +2245,35 @@ case "body": assert(part == "body"); #+NAME: output_html_seg_is_backmatter #+BEGIN_SRC d case "backmatter": - assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { - case "endnote": assert(part == "endnotes"); + case "endnote": assert(section == "endnotes"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; break; - case "glossary": assert(part == "glossary"); + case "glossary": assert(section == "glossary"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "bibliography": assert(part == "bibliography"); + case "bibliography": assert(section == "bibliography"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "bookindex": assert(part == "bookindex"); + case "bookindex": assert(section == "bookindex"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "blurb": assert(part == "blurb"); + case "blurb": assert(section == "blurb"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "tail": assert(part == "tail"); + case "tail": assert(section == "tail"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; @@ -2578,8 +2578,8 @@ xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> content ~= " " ~ "" ~ "\n "; content ~= "" ~ ""; debug(epubmanifest) { - foreach (part; doc_matters.has.keys_seq.seg) { // TODO - foreach (obj; doc_abstraction[part]) { + foreach (section; doc_matters.has.keys_seq.seg) { // TODO + foreach (obj; doc_abstraction[section]) { if (obj.metainfo.is_a == "heading") { if (obj.metainfo.heading_lev_markup == 4) { writefln( @@ -2763,8 +2763,8 @@ xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> #+NAME: output_epub3_xhtml_seg_output_loop #+BEGIN_SRC d -foreach (part; doc_matters.has.keys_seq.seg) { - foreach (obj; doc_abstraction[part]) { +foreach (section; doc_matters.has.keys_seq.seg) { + foreach (obj; doc_abstraction[section]) { string _txt = xhtml_format.special_characters_breaks_indents_bullets(obj); #+END_SRC @@ -2773,7 +2773,7 @@ foreach (part; doc_matters.has.keys_seq.seg) { #+NAME: output_epub3_xhtml_seg_object_is_heading #+BEGIN_SRC d if (obj.metainfo.is_a == "heading") { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.heading_lev_markup) { case 0: .. case 3: /+ fill buffer, and replace with new levels from 1 to 3 +/ @@ -2840,7 +2840,7 @@ if (obj.metainfo.is_a == "heading") { #+NAME: output_epub3_xhtml_seg_object_is_not_heading #+BEGIN_SRC d } else { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); Tuple!(string, string[]) t; switch (obj.metainfo.is_of_part) { #+END_SRC @@ -2849,7 +2849,7 @@ if (obj.metainfo.is_a == "heading") { #+NAME: output_epub3_xhtml_seg_object_is_frontmatter #+BEGIN_SRC d -case "frontmatter": assert(part == "head" || "toc"); +case "frontmatter": assert(section == "head" || "toc"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -2882,7 +2882,7 @@ case "frontmatter": assert(part == "head" || "toc"); #+NAME: output_epub3_xhtml_seg_object_is_body #+BEGIN_SRC d -case "body": assert(part == "body"); +case "body": assert(section == "body"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -2956,35 +2956,35 @@ case "body": assert(part == "body"); #+NAME: output_epub3_xhtml_seg_object_is_backmatter #+BEGIN_SRC d case "backmatter": - assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { - case "endnote": assert(part == "endnotes"); + case "endnote": assert(section == "endnotes"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; break; - case "glossary": assert(part == "glossary"); + case "glossary": assert(section == "glossary"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "bibliography": assert(part == "bibliography"); + case "bibliography": assert(section == "bibliography"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "bookindex": assert(part == "bookindex"); + case "bookindex": assert(section == "bookindex"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "blurb": assert(part == "blurb"); + case "blurb": assert(section == "blurb"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "tail": assert(part == "tail"); + case "tail": assert(section == "tail"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index 54568ff..7a646fb 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -157,8 +157,8 @@ template outputEPub3() { content ~= " " ~ "" ~ "\n "; content ~= "" ~ ""; debug(epubmanifest) { - foreach (part; doc_matters.has.keys_seq.seg) { // TODO - foreach (obj; doc_abstraction[part]) { + foreach (section; doc_matters.has.keys_seq.seg) { // TODO + foreach (obj; doc_abstraction[section]) { if (obj.metainfo.is_a == "heading") { if (obj.metainfo.heading_lev_markup == 4) { writefln( @@ -321,11 +321,11 @@ template outputEPub3() { string[] doc_parts; } auto epubWrite = writeOut(); - foreach (part; doc_matters.has.keys_seq.seg) { - foreach (obj; doc_abstraction[part]) { + foreach (section; doc_matters.has.keys_seq.seg) { + foreach (obj; doc_abstraction[section]) { string _txt = xhtml_format.special_characters_breaks_indents_bullets(obj); if (obj.metainfo.is_a == "heading") { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.heading_lev_markup) { case 0: .. case 3: /+ fill buffer, and replace with new levels from 1 to 3 +/ @@ -386,10 +386,10 @@ template outputEPub3() { break; } } else { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); Tuple!(string, string[]) t; switch (obj.metainfo.is_of_part) { - case "frontmatter": assert(part == "head" || "toc"); + case "frontmatter": assert(section == "head" || "toc"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -416,7 +416,7 @@ template outputEPub3() { break; } break; - case "body": assert(part == "body"); + case "body": assert(section == "body"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -484,35 +484,35 @@ template outputEPub3() { } break; case "backmatter": - assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { - case "endnote": assert(part == "endnotes"); + case "endnote": assert(section == "endnotes"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; break; - case "glossary": assert(part == "glossary"); + case "glossary": assert(section == "glossary"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "bibliography": assert(part == "bibliography"); + case "bibliography": assert(section == "bibliography"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "bookindex": assert(part == "bookindex"); + case "bookindex": assert(section == "bookindex"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "blurb": assert(part == "blurb"); + case "blurb": assert(section == "blurb"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; - case "tail": assert(part == "tail"); + case "tail": assert(section == "tail"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index fe7e7a6..0cbf61e 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -75,14 +75,14 @@ template outputHTML() { string[] doc_html; string[] doc; string suffix = ".html"; - string previous_part = ""; + string previous_section = ""; string delimit = ""; - foreach (part; doc_matters.has.keys_seq.scroll) { - foreach (obj; doc_abstraction[part]) { - delimit = xhtml_format.div_delimit(part, previous_part); + foreach (section; doc_matters.has.keys_seq.scroll) { + foreach (obj; doc_abstraction[section]) { + delimit = xhtml_format.div_delimit(section, previous_section); string _txt = xhtml_format.special_characters_breaks_indents_bullets(obj); switch (obj.metainfo.is_of_part) { - case "frontmatter": assert(part == "head" || "toc"); + case "frontmatter": assert(section == "head" || "toc"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -110,7 +110,7 @@ template outputHTML() { break; } break; - case "body": assert(part == "body" || "head"); + case "body": assert(section == "body" || "head"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -170,29 +170,29 @@ template outputHTML() { } break; case "backmatter": - assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { case "heading": doc_html ~= delimit ~ xhtml_format.heading_scroll(_txt, obj, doc_matters, suffix); break; - case "endnote": assert(part == "endnotes"); + case "endnote": assert(section == "endnotes"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "glossary": assert(part == "glossary"); + case "glossary": assert(section == "glossary"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "bibliography": assert(part == "bibliography"); + case "bibliography": assert(section == "bibliography"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "bookindex": assert(part == "bookindex"); + case "bookindex": assert(section == "bookindex"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "blurb": assert(part == "blurb"); + case "blurb": assert(section == "blurb"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; - case "tail": assert(part == "tail"); + case "tail": assert(section == "tail"); doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; default: @@ -272,14 +272,14 @@ template outputHTML() { string[] top_level_headings = ["","","",""]; string previous_seg_filename = ""; string suffix = ".html"; - string previous_part = ""; + string previous_section = ""; string delimit = ""; - foreach (part; doc_matters.has.keys_seq.seg) { - foreach (obj; doc_abstraction[part]) { - delimit = xhtml_format.div_delimit(part, previous_part); + foreach (section; doc_matters.has.keys_seq.seg) { + foreach (obj; doc_abstraction[section]) { + delimit = xhtml_format.div_delimit(section, previous_section); string _txt = xhtml_format.special_characters_breaks_indents_bullets(obj); if (obj.metainfo.is_a == "heading") { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.heading_lev_markup) { case 0: .. case 3: /+ fill buffer, and replace with new levels from 1 to 3 +/ @@ -344,10 +344,10 @@ template outputHTML() { break; } } else { - assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); Tuple!(string, string[]) t; switch (obj.metainfo.is_of_part) { - case "frontmatter": assert(part == "head" || "toc"); + case "frontmatter": assert(section == "head" || "toc"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -373,7 +373,7 @@ template outputHTML() { break; } break; - case "body": assert(part == "body"); + case "body": assert(section == "body"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { @@ -440,35 +440,35 @@ template outputHTML() { } break; case "backmatter": - assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); + assert(section == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail"); switch (obj.metainfo.is_of_type) { case "para": switch (obj.metainfo.is_a) { - case "endnote": assert(part == "endnotes"); + case "endnote": assert(section == "endnotes"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; break; - case "glossary": assert(part == "glossary"); + case "glossary": assert(section == "glossary"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "bibliography": assert(part == "bibliography"); + case "bibliography": assert(section == "bibliography"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "bookindex": assert(part == "bookindex"); + case "bookindex": assert(section == "bookindex"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "blurb": assert(part == "blurb"); + case "blurb": assert(section == "blurb"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; break; - case "tail": assert(part == "tail"); + case "tail": assert(section == "tail"); t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0]; doc_html_endnotes[segment_filename] ~= t[1]; diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index 2b1f55b..048b614 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -68,13 +68,13 @@ template outputXHTMLs() { static auto rgx = RgxO(); static auto rgx_xhtml = RgxXHTML(); @safe string div_delimit( - string part, - return ref string previous_part + string section, + return ref string previous_section ) { string delimit = ""; string delimit_ = ""; - if (part != previous_part) { - switch (part) { + if (section != previous_section) { + switch (section) { case "head": delimit_ ~= "\n
\n" ; break; @@ -85,13 +85,13 @@ template outputXHTMLs() { delimit_ ~= "\n
\n" ; break; default: - delimit_ ~= "\n
\n" ; + delimit_ ~= "\n
\n" ; break; } - if (previous_part.length > 0) { + if (previous_section.length > 0) { delimit ~= "\n
"; } - previous_part = part; + previous_section = section; delimit ~= delimit_; } // you also need to close the last div, introduce a footer? -- cgit v1.2.3