diff options
Diffstat (limited to 'src/ssp_types.d')
| -rw-r--r-- | src/ssp_types.d | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/ssp_types.d b/src/ssp_types.d index f87da5b..3960df0 100644 --- a/src/ssp_types.d +++ b/src/ssp_types.d @@ -15,8 +15,13 @@ struct SspObject { string is_a; // heading, para, toc, table, code, group, block, verse, quote, endnote, glossary, bibliography, bookindex, blurb string section; // head, toc, body, endnotes, glossary, bibliography, bookindex, blurb string heading_level; // A, B, C, D, 1, 2, 3, 4 (for headings) - string identifier; // named segment (for headings) + string identifier; // heading: from the declaration line; otherwise .identifier string part; // frontmatter, body, backmatter + string is_of_type; // para, block, comment: how the text behaves + string own_section; // .section, when it differs from the block it sits in + string segment_html_is;// the html segment this object sits in + string table_aligns; // l c r per column + string[] stow_link; // links extracted from the object int parent_ocn; int last_descendant_ocn; int[] children; // direct child heading OCNs @@ -44,6 +49,22 @@ struct SspObject { string sha256; SspImage[] images; // repeatable .image records, in order string text; // content (lines joined with newline) + + /+ ↓ whether this object is rendered at all. + is_of_type "comment" is markup commentary: carried by the + abstraction so that nothing is lost, and not put into output. An + output that renders it leaks the author notes into the document, + which is what spine itself does not do. + +/ + bool renders() const { + return is_of_type != "comment"; + } + + /+ ↓ the section this object belongs to, which is the block it sits in + unless it says otherwise +/ + string sectionOf() const { + return (own_section.length > 0) ? own_section : section; + } } /+ ↓ what the reader met and did not understand. |
