aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ocda.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/ocda.org')
-rw-r--r--org/ocda.org19
1 files changed, 19 insertions, 0 deletions
diff --git a/org/ocda.org b/org/ocda.org
index d930917..f822f8d 100644
--- a/org/ocda.org
+++ b/org/ocda.org
@@ -1364,6 +1364,25 @@ if (the_document_body_section.length > 1) {
}
}
}
+/+ ↓ 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: