From 4bf61c31fac50313753246e76993739fff3bfa14 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 3 Feb 2017 15:42:31 -0500 Subject: doc_matters, add image list --- org/ao_doc_abstraction.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'org/ao_doc_abstraction.org') diff --git a/org/ao_doc_abstraction.org b/org/ao_doc_abstraction.org index 6911b63..33ebea3 100644 --- a/org/ao_doc_abstraction.org +++ b/org/ao_doc_abstraction.org @@ -1667,6 +1667,14 @@ next are not yet known for backmatter during the second pass #+name: abs_post #+BEGIN_SRC d +string[] _images; +auto extract_images(S)(S content_block) { + string[] images_; + if (auto m = matchAll(content_block, rgx.image)) { + images_ ~= m.captures[1]; + } + return images_; +} foreach (ref obj; the_document_head_section) { if (obj.is_a == "heading") { debug(dom) { @@ -1754,9 +1762,12 @@ if (the_document_body_section.length > 1) { dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); + } else if (obj.is_a == "para") { + _images ~= extract_images(obj.text); } } } +auto images=uniq(_images.sort()); /+ optional only one 1~ level +/ if (the_endnotes_section.length > 1) { dom_markedup_buffer = dom_markedup.dup; @@ -2033,6 +2044,7 @@ auto t = tuple( document_the, document_section_keys_sequenced, html_segnames, + images, ); return t; #+END_SRC -- cgit v1.2.3