aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/meta/metadoc_from_src.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/meta/metadoc_from_src.d')
-rw-r--r--src/sisudoc/meta/metadoc_from_src.d19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sisudoc/meta/metadoc_from_src.d b/src/sisudoc/meta/metadoc_from_src.d
index a4388fb..4967c1f 100644
--- a/src/sisudoc/meta/metadoc_from_src.d
+++ b/src/sisudoc/meta/metadoc_from_src.d
@@ -1331,6 +1331,25 @@ template docAbstraction() {
}
}
}
+ /+ ↓ compute children_headings for heading objects +/
+ {
+ int[][int] heading_children;
+ foreach (obj; the_document_body_section) {
+ if (obj.metainfo.is_a == "heading" && obj.metainfo.parent_ocn != 0) {
+ heading_children[obj.metainfo.parent_ocn] ~= obj.metainfo.ocn;
+ }
+ }
+ foreach (ref obj; the_document_head_section) {
+ if (obj.metainfo.is_a == "heading" && obj.metainfo.ocn in heading_children) {
+ obj.metainfo.children_headings = heading_children[obj.metainfo.ocn];
+ }
+ }
+ foreach (ref obj; the_document_body_section) {
+ if (obj.metainfo.is_a == "heading" && obj.metainfo.ocn in heading_children) {
+ obj.metainfo.children_headings = heading_children[obj.metainfo.ocn];
+ }
+ }
+ }
// TODO
// - note create/insert heading object sole purpose eof close all open tags
// sort out: