From cf5e80c5c5355dfb40f8abd1350fb4d3869316a6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 6 Jul 2018 11:27:23 -0400 Subject: parent ocn --- org/meta_abstraction.org | 52 +++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 18 deletions(-) (limited to 'org/meta_abstraction.org') diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index 6b6ad9f..00b87a3 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -1978,6 +1978,7 @@ if (the_document_body_section.length > 1) { if (obj.metainfo.is_a == "heading") { obj.metainfo.markedup_ancestors = _get_ancestors_markup(obj, _ancestors_markup); obj.metainfo.collapsed_ancestors = _get_ancestors_collapsed(obj, _ancestors_collapsed); + obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup]; } } debug(ancestors) { @@ -1994,9 +1995,12 @@ if (the_document_body_section.length > 1) { if (the_endnotes_section.length > 1) { html_segnames ~= "endnotes"; html_segnames_ptr = html_segnames_ptr_cntr; - foreach (ref section; the_endnotes_section) { - if (section.metainfo.heading_lev_markup == 4) { - section.ptr.html_segnames = html_segnames_ptr; + foreach (ref obj; the_endnotes_section) { + if (obj.metainfo.is_a == "heading") { + obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup]; + } + if (obj.metainfo.heading_lev_markup == 4) { + obj.ptr.html_segnames = html_segnames_ptr; break; } } @@ -2011,9 +2015,12 @@ if (the_endnotes_section.length > 1) { if (the_glossary_section.length > 1) { html_segnames ~= "glossary"; html_segnames_ptr = html_segnames_ptr_cntr; - foreach (ref section; the_glossary_section) { - if (section.metainfo.heading_lev_markup == 4) { - section.ptr.html_segnames = html_segnames_ptr; + foreach (ref obj; the_glossary_section) { + if (obj.metainfo.is_a == "heading") { + obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup]; + } + if (obj.metainfo.heading_lev_markup == 4) { + obj.ptr.html_segnames = html_segnames_ptr; break; } } @@ -2028,9 +2035,12 @@ if (the_glossary_section.length > 1) { if (the_bibliography_section.length > 1) { html_segnames ~= "bibliography"; html_segnames_ptr = html_segnames_ptr_cntr; - foreach (ref section; the_bibliography_section) { - if (section.metainfo.heading_lev_markup == 4) { - section.ptr.html_segnames = html_segnames_ptr; + foreach (ref obj; the_bibliography_section) { + if (obj.metainfo.is_a == "heading") { + obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup]; + } + if (obj.metainfo.heading_lev_markup == 4) { + obj.ptr.html_segnames = html_segnames_ptr; break; } } @@ -2045,15 +2055,18 @@ if (the_bibliography_section.length > 1) { if (the_bookindex_section["scroll"].length > 1) { html_segnames ~= "bookindex"; html_segnames_ptr = html_segnames_ptr_cntr; - foreach (ref section; the_bookindex_section["scroll"]) { - if (section.metainfo.heading_lev_markup == 4) { - section.ptr.html_segnames = html_segnames_ptr; + foreach (ref obj; the_bookindex_section["scroll"]) { + if (obj.metainfo.is_a == "heading") { + obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup]; + } + if (obj.metainfo.heading_lev_markup == 4) { + obj.ptr.html_segnames = html_segnames_ptr; break; } } - foreach (ref section; the_bookindex_section["seg"]) { - if (section.metainfo.heading_lev_markup == 4) { - section.ptr.html_segnames = html_segnames_ptr; + foreach (ref obj; the_bookindex_section["seg"]) { + if (obj.metainfo.heading_lev_markup == 4) { + obj.ptr.html_segnames = html_segnames_ptr; break; } } @@ -2068,9 +2081,12 @@ if (the_bookindex_section["scroll"].length > 1) { if (the_blurb_section.length > 1) { html_segnames ~= "blurb"; html_segnames_ptr = html_segnames_ptr_cntr; - foreach (ref section; the_blurb_section) { - if (section.metainfo.heading_lev_markup == 4) { - section.ptr.html_segnames = html_segnames_ptr; + foreach (ref obj; the_blurb_section) { + if (obj.metainfo.is_a == "heading") { + obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup]; + } + if (obj.metainfo.heading_lev_markup == 4) { + obj.ptr.html_segnames = html_segnames_ptr; break; } } -- cgit v1.2.3