diff options
Diffstat (limited to 'src/sisudoc/ocda/meta/metadoc_from_src.d')
| -rw-r--r-- | src/sisudoc/ocda/meta/metadoc_from_src.d | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/sisudoc/ocda/meta/metadoc_from_src.d b/src/sisudoc/ocda/meta/metadoc_from_src.d index cae6c25..e104c94 100644 --- a/src/sisudoc/ocda/meta/metadoc_from_src.d +++ b/src/sisudoc/ocda/meta/metadoc_from_src.d @@ -1405,6 +1405,32 @@ template docAbstraction() { // dom tail only "tail": the_document_xml_dom_tail_section, ]; + /+ ↓ document level counts of inline markup. The block counters + (codeblock, poem, group, block, quote, table) are incremented as the + blocks are recognised; the inline markup is counted here, over the + assembled body objects. The body is counted alone: the endnotes + section is a rendering of the notes the body objects carry inline. + Links: those _links() stowed are counted from stow.link, their place + in the text having been taken by the stow index (a numeric target); + the link markup left in the text (anchors, and urls _links() does + not stow) is counted from the text + +/ + foreach (obj_; document_the["body"]) { + dochas["inline_links"] += obj_.stow.link.length.to!uint; + foreach (m; obj_.text.matchAll(rgx.inline_link)) { + if (!(m["link"].all!(c => (c >= '0' && c <= '9')))) { + ++dochas["inline_links"]; + } + } + foreach (m; obj_.text.matchAll(rgx.inline_notes_al_regular_number_note)) { + ++dochas["inline_notes"]; + } + foreach (m; obj_.text.matchAll(rgx.inline_notes_al_special_char_note)) { + if (m["char"].canFind("*")) { + ++dochas["inline_notes_star"]; + } + } + } // document parts keys as needed string[][string] document_section_keys_sequenced = [ "scroll": ["head", "toc", "body",], |
