aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc_reform/meta')
-rw-r--r--src/doc_reform/meta/metadoc_from_src.d53
-rw-r--r--src/doc_reform/meta/object_setter.d4
-rw-r--r--src/doc_reform/meta/rgx.d10
3 files changed, 12 insertions, 55 deletions
diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d
index 4f12e0b..9d2935c 100644
--- a/src/doc_reform/meta/metadoc_from_src.d
+++ b/src/doc_reform/meta/metadoc_from_src.d
@@ -780,7 +780,7 @@ template DocReformDocAbstraction() {
} else {
/+ not book_index +/
an_object_key="body_nugget";
- if (auto m = matchFirst(line, rgx.comment)) {
+ if (auto m = line.matchFirst(rgx.comment)) {
/+ matched comment +/
debug(comment) {
writeln(line);
@@ -1047,7 +1047,7 @@ template DocReformDocAbstraction() {
comp_obj_para.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg];
comp_obj_para.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star];
comp_obj_para.has.inline_links = substantive_obj_misc_tuple[sObj.links];
- comp_obj_para.has.contains_image_without_dimensions = substantive_obj_misc_tuple[sObj.image_no_dimensions];
+ comp_obj_para.has.image_without_dimensions = substantive_obj_misc_tuple[sObj.image_no_dimensions];
the_document_body_section ~= comp_obj_para;
tag_assoc = inline_para_link_anchor(an_object, tag_in_seg, tag_assoc);
_common_reset_(line_occur, an_object, obj_type_status);
@@ -1698,7 +1698,7 @@ template DocReformDocAbstraction() {
}
string[] segnames_lv0_to_4;
auto _image_dimensions(M,O)(M manifest_matter, O obj) {
- if (obj.has.contains_image_without_dimensions) {
+ if (obj.has.image_without_dimensions) {
import std.math;
import imageformats;
int w, h, chans;
@@ -2244,50 +2244,7 @@ template DocReformDocAbstraction() {
dom_structure_markedup_tags_status_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
dom_structure_collapsed_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
dom_structure_collapsed_tags_status_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
- debug(abstraction) {
- foreach (part; sequenced_document_keys.scroll) {
- foreach (ref obj; document_the[part]) {
- debug(node_misc) {
- if (obj.metainfo.is_a == "heading") {
- writeln("heading ancestors text?: ", obj.tags.heading_ancestors_text);
- }
- }
- debug(node_headings) {
- if (obj.metainfo.is_a == "heading") {
- writeln("---");
- writeln(obj.text);
- writeln(" node: ", obj.metainfo.node);
- writeln(" ocn: ", obj.metainfo.ocn);
- writeln(" markedup heading lev: ", obj.metainfo.heading_lev_markup);
- writeln(" collapsed heading lev ", obj.metainfo.heading_lev_collapsed);
- writeln(" parent ocn: ", obj.metainfo.parent_ocn);
- writeln(" parent lev: ", obj.metainfo.parent_lev_markup);
- writeln(" markedup ancestors o_n: ", obj.metainfo.markedup_ancestors);
- writeln(" dom markedup: ", obj.metainfo.dom_structure_markedup_tags_status);
- writeln(" collapsed ancestors o_n: ", obj.metainfo.collapsed_ancestors);
- writeln(" dom collapsed: ", obj.metainfo.dom_structure_collapsed_tags_status);
- }
- }
- debug(node_all) {
- writeln("---");
- if (obj.metainfo.is_a == "heading") {
- writeln(obj.text);
- }
- writeln("node: ", obj.metainfo.node);
- writeln("ocn: ", obj.metainfo.ocn);
- writeln("markedup heading lev: ", obj.metainfo.heading_lev_markup);
- writeln("collapsed heading lev ", obj.metainfo.heading_lev_collapsed);
- writeln("markedup ancestors o_n: ", obj.metainfo.markedup_ancestors);
- writeln("collapsed ancestors o_n: ", obj.metainfo.collapsed_ancestors);
- writeln("dom markedup: ", obj.metainfo.dom_structure_markedup_tags_status);
- writeln("dom collapsed: ", obj.metainfo.dom_structure_collapsed_tags_status);
- writeln("parent ocn: ", obj.metainfo.parent_ocn);
- writeln("parent lev: ", obj.metainfo.parent_lev_markup);
- writeln("Node: ", obj.metainfo.ocn);
- }
- }
- }
- }
+
auto t = tuple(
document_the,
sequenced_document_keys,
@@ -4978,7 +4935,7 @@ template DocReformDocAbstraction() {
if (auto n = munge_.match(rgx.heading_anchor_tag_plus_colon)) {
auto tag_remunge_ = n.captures[2]
.replaceAll(rgx.heading_marker_tag_has_colon, "..");
- munge_=munge_.replaceFirst(rgx.heading_anchor_tag_plus_colon, n.captures[1] ~ tag_remunge_ ~ " ");
+ munge_ = munge_.replaceFirst(rgx.heading_anchor_tag_plus_colon, n.captures[1] ~ tag_remunge_ ~ " ");
}
} else if (auto m = munge_.match(rgx.heading_extract_unnamed_anchor_tag)) {
munge_ = munge_.replaceFirst(
diff --git a/src/doc_reform/meta/object_setter.d b/src/doc_reform/meta/object_setter.d
index 03197da..a4eaaf6 100644
--- a/src/doc_reform/meta/object_setter.d
+++ b/src/doc_reform/meta/object_setter.d
@@ -10,7 +10,7 @@ template ObjectSetter() {
string is_of_part = ""; // frontmatter, body, backmatter
string is_of_section = ""; // toc, body, glossary, biography, book index, blurb
string is_of_type = ""; // para, block ?
- string is_a = ""; // heading, para, table, code block, group, ...
+ string is_a = ""; // heading, para, table, code block, group, verse/poem ...
alias of_part = is_of_part;
alias of_section = is_of_section;
alias is_of = is_of_type;
@@ -86,7 +86,7 @@ template ObjectSetter() {
bool inline_links = false;
bool inline_notes_reg = false;
bool inline_notes_star = false;
- bool contains_image_without_dimensions = false;
+ bool image_without_dimensions = false;
}
struct DocObj_Table_ {
int number_of_columns = 0;
diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d
index 8c592a6..c43390d 100644
--- a/src/doc_reform/meta/rgx.d
+++ b/src/doc_reform/meta/rgx.d
@@ -247,7 +247,7 @@ static template DocReformRgxInit() {
static inline_al_delimiter_close_regular = ctRegex!(`】`, "m");
static inline_al_delimiter_open_and_close_regular = ctRegex!(`【|】`, "m");
static inline_notes_delimiter_al_regular = ctRegex!(`【(.+?)】`, "mg");
- static inline_notes_delimiter_al_regular_number_note = ctRegex!(`【(\d+)\s+(.+?)】`, "mg");
+ static inline_notes_delimiter_al_regular_number_note = ctRegex!(`【(?P<num>\d+)\s+(?P<note>.+?)】`, "mg");
static inline_al_delimiter_open_asterisk = ctRegex!(`【\*`, "m");
static inline_al_delimiter_open_plus = ctRegex!(`【\+`, "m");
static inline_text_and_note_al = ctRegex!(`(?P<text>.+?)【(?:[*+ ]*)(?P<note>.+?)】`, "mg");
@@ -282,10 +282,10 @@ static template DocReformRgxInit() {
static inline_mono_box = ctRegex!(`■\{(?P<text>.+?)\}■`, "mg");
static inline_cite = ctRegex!(`"\{(?P<text>.+?)\}"`, "mg");
static inline_faces_line = ctRegex!(`^[*!/_]_ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
- static inline_emphasis_line = ctRegex!(`^\*_ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
- static inline_bold_line = ctRegex!(`^!_ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
- static inline_italics_line = ctRegex!(`^/_ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
- static inline_underscore_line = ctRegex!(`^__ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
+ static inline_emphasis_line = ctRegex!(`^\*_ (?P<text>.+?)(?P<tail>(?: [\\]{2}|[~]#){0,2}$)`);
+ static inline_bold_line = ctRegex!(`^!_ (?P<text>.+?)(?P<tail>(?: [\\]{2}|[~]#){0,2}$)`);
+ static inline_italics_line = ctRegex!(`^/_ (?P<text>.+?)(?P<tail>(?: [\\]{2}|[~]#){0,2}$)`);
+ static inline_underscore_line = ctRegex!(`^__ (?P<text>.+?)(?P<tail>(?: [\\]{2}|[~]#){0,2}$)`);
static inline_fontface_clean = ctRegex!(`[*!_/^,+#■"-]\{|\}[*!_/^,+#■"-]`, "mg");
static no_header_rgx = ctRegex!(`^=NULL$`);
/+ table delimiters +/