aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--org/default_regex.org23
-rw-r--r--org/in_source_files.org20
-rw-r--r--org/ocda_functions.org200
-rw-r--r--org/ocda_obj_setter.org1
-rw-r--r--src/sisudoc/io_in/read_source_files.d20
-rw-r--r--src/sisudoc/meta/metadoc_from_src_functions.d200
-rw-r--r--src/sisudoc/meta/metadoc_object_setter.d1
-rw-r--r--src/sisudoc/meta/rgx.d12
8 files changed, 469 insertions, 8 deletions
diff --git a/org/default_regex.org b/org/default_regex.org
index 52d52d7..dc70056 100644
--- a/org/default_regex.org
+++ b/org/default_regex.org
@@ -53,6 +53,7 @@ static template spineRgxIn() {
<<meta_rgx_paragraph_marks>>
<<meta_rgx_blocks>>
<<meta_rgx_block_tic>>
+ <<meta_rgx_block_quotemarks>>
<<meta_rgx_block_curly>>
<<meta_rgx_sub_match_code>>
<<meta_rgx_table>>
@@ -220,12 +221,14 @@ static grouped_para_indent_hang = ctRegex!(`^_(?P<hang>[0-9])_(?
#+NAME: meta_rgx_blocks
#+BEGIN_SRC d
/+ blocked markup +/
-static block_open = ctRegex!("^((code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|^`{3} (code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?|^[{]table[(](?:h;)?(?P<columns>(?:[ ,]+[0-9]+)+)[)][}]");
-static block_poem_open = ctRegex!("^((poem(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|`{3} poem(?:[(][ a-zA-Z0-9;:,]*[)])?)");
+static block_open = ctRegex!("^((code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|^[`']{3} (code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?|^[{]table[(](?:h;)?(?P<columns>(?:[ ,]+[0-9]+)+)[)][}]");
+static block_poem_open = ctRegex!("^((poem(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|[`']{3} poem(?:[(][ a-zA-Z0-9;:,]*[)])?)");
#+END_SRC
*** blocked markup tic :block:tic:
+- consider quotemarks as alternative to, or to replace tics as using tics in text markup is a bit cumbersome
+
#+NAME: meta_rgx_block_tic
#+BEGIN_SRC d
/+ blocked markup tics +/
@@ -238,6 +241,22 @@ static block_tic_table_open = ctRegex!("^`{3} table(?:[(](?P
static block_tic_close = ctRegex!("^(`{3})$","m");
#+END_SRC
+*** blocked markup quotemarks :block:quotemarks:
+
+- consider quotemarks as alternative to, or to replace tics as using tics in text markup is a bit cumbersome
+
+#+NAME: meta_rgx_block_quotemarks
+#+BEGIN_SRC d
+/+ blocked markup tics +/
+static block_quotemarks_code_open = ctRegex!(`^'{3} code(?:[.](?P<syntax>[a-z][0-9a-z#+_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+static block_quotemarks_poem_open = ctRegex!(`^'{3} poem(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+static block_quotemarks_group_open = ctRegex!(`^'{3} group(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+static block_quotemarks_block_open = ctRegex!(`^'{3} block(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+static block_quotemarks_quote_open = ctRegex!(`^'{3} quote(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+static block_quotemarks_table_open = ctRegex!(`^'{3} table(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`); // ctRegex!("^'{3} table(?:\(.*?\))?");
+static block_quotemarks_close = ctRegex!(`^('{3})$`,"m");
+#+END_SRC
+
*** blocked markup curly :block:curly:
#+NAME: meta_rgx_block_curly
diff --git a/org/in_source_files.org b/org/in_source_files.org
index 700b551..cdd220f 100644
--- a/org/in_source_files.org
+++ b/org/in_source_files.org
@@ -581,7 +581,7 @@ final char[][] getInsertMarkupSourceContentRawLineArray(
#+BEGIN_SRC d
char[][] contents_insert;
int code_block_status = 0;
-enum codeBlock { off, curly, tic, }
+enum codeBlock { off, curly, tic, quotemarks }
auto fn_pth_full = fn_src.match(rgx_files.src_pth_sst_or_ssm);
auto markup_src_file_path = fn_pth_full.captures[1];
#+END_SRC
@@ -598,11 +598,19 @@ if (code_block_status == codeBlock.curly) {
} else if (line.matchFirst(rgx.block_curly_code_open)) {
code_block_status = codeBlock.curly;
contents_insert ~= line;
+} else if (code_block_status == codeBlock.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ code_block_status = codeBlock.off;
+ }
+ contents_insert ~= line;
} else if (code_block_status == codeBlock.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
code_block_status = codeBlock.off;
}
contents_insert ~= line;
+} else if (line.matchFirst(rgx.block_quotemarks_code_open)) {
+ code_block_status = codeBlock.quotemarks;
+ contents_insert ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
code_block_status = codeBlock.tic;
contents_insert ~= line;
@@ -666,7 +674,7 @@ return ret;
#+BEGIN_SRC d
char[][] contents;
int code_block_status = 0;
-enum codeBlock { off, curly, tic, }
+enum codeBlock { off, curly, tic, quotemarks }
auto fn_pth_full = fn_src.match(rgx_files.src_pth_sst_or_ssm);
auto markup_src_file_path = fn_pth_full.captures[1];
char[][] contents_insert;
@@ -686,11 +694,19 @@ if (code_block_status == codeBlock.curly) {
} else if (line.matchFirst(rgx.block_curly_code_open)) {
code_block_status = codeBlock.curly;
contents ~= line;
+} else if (code_block_status == codeBlock.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ code_block_status = codeBlock.off;
+ }
+ contents ~= line;
} else if (code_block_status == codeBlock.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
code_block_status = codeBlock.off;
}
contents ~= line;
+} else if (line.matchFirst(rgx.block_quotemarks_code_open)) {
+ code_block_status = codeBlock.quotemarks;
+ contents ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
code_block_status = codeBlock.tic;
contents ~= line;
diff --git a/org/ocda_functions.org b/org/ocda_functions.org
index ffbecb6..baae83e 100644
--- a/org/ocda_functions.org
+++ b/org/ocda_functions.org
@@ -1571,6 +1571,62 @@ ST_txt_by_line_block_start txt_by_line_block_start()(
pith["block_is"] = eN.blk_is.table;
pith["block_state"] = eN.blk_state.on;
pith["block_delim"] = eN.blk_delim.curly_special;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_code_open)) {
+ dochas["codeblock"]++;
+ an_object["lang"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["syntax"] = (m["syntax"]) ? m["syntax"].to!string : "";
+ debug(codequotemarks) { writefln( "* [code quotemarks] %s", line); }
+ pith["block_is"] = eN.blk_is.code;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks; //
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_poem_open)) {
+ dochas["poem"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["lang"] = (m["lang"]) ? m["lang"].to!string : "";
+ debug(poem) { writefln( "* [poem quotemarks] %s", line); }
+ object_number_poem["start"] = obj_cite_digits.object_number.to!string;
+ pith["block_is"] = eN.blk_is.poem;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks; //
+ pith["verse_new"] = eN.bi.on;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_group_open)) {
+ dochas["group"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["lang"] = (m["lang"]) ? m["lang"].to!string : "";
+ debug(group) { writefln( "* [group quotemarks] %s", line); }
+ pith["block_is"] = eN.blk_is.group;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_block_open)) {
+ dochas["block"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["lang"] = (m["lang"]) ? m["lang"].to!string : "";
+ debug(block) { writefln( "* [block quotemarks] %s", line); }
+ pith["block_is"] = eN.blk_is.block;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_quote_open)) {
+ dochas["quote"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = m["attrib"].to!string;
+ an_object["lang"] = m["lang"].to!string;
+ debug(quote) { writefln( "* [quote quotemarks] %s", line); // quote (quotemarks) open
+ }
+ pith["block_is"] = eN.blk_is.quote;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_table_open)) { // quotemarks table open
+ debug(table) { writefln( "* [table quotemarks] %s", line); }
+ dochas["table"] ++;
+ an_object["table_head"] = m["attrib"].to!string;
+ an_object["block_type"] = "quotemarks";
+ pith["block_is"] = eN.blk_is.table;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
} else if (auto m = line.matchFirst(rgx.block_tic_code_open)) {
dochas["codeblock"]++;
an_object["lang"] = "";
@@ -1654,6 +1710,17 @@ ST_txt_by_line_block_generic txt_by_line_block_group()(
debug(group) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(group) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key].stripRight;
+ pith["block_is"] = eN.blk_is.group;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(group) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(group) { writeln(line); }
@@ -1692,6 +1759,17 @@ ST_txt_by_line_block_generic txt_by_line_block_block()(
debug(block) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(block) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key].stripRight;
+ pith["block_is"] = eN.blk_is.block;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(block) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(block) { writeln(line); }
@@ -1816,6 +1894,94 @@ ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)(
++cntr;
}
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (auto m = line.matchFirst(rgx.block_quotemarks_close)) {
+ an_object[an_object_key] = "verse";
+ debug(poem) { writefln( "* [poem quotemarks] %s", line); }
+ if (processing.length > 0) {
+ an_object[an_object_key] = processing["verse"];
+ }
+ if (an_object.length > 0) {
+ debug(poem) { writeln(__LINE__); writeln(obj_cite_digits.object_number, line); }
+ processing.remove("verse");
+ an_object["is"] = "verse";
+ ST_txtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_struct
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc);
+ an_object["substantive"] = substantive_obj_misc_struct.obj_txt;
+ anchor_tag = substantive_obj_misc_struct.anchor_tag;
+ comp_obj_ = set_object_generic("body", "body", "block", "verse", an_object["substantive"], obj_cite_digits.object_number);
+ comp_obj_.metainfo.identifier = obj_cite_digits.identifier;
+ comp_obj_.metainfo.object_number_off = obj_cite_digits.off;
+ comp_obj_.metainfo.o_n_book_index = obj_cite_digits.bkidx;
+ comp_obj_.metainfo.object_number_type = obj_cite_digits.type;
+ comp_obj_.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"];
+ comp_obj_.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"];
+ comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg;
+ comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star;
+ comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links;
+ the_document_body_section ~= comp_obj_;
+ tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc);
+ object_number_poem["end"] = obj_cite_digits.object_number.to!string;
+ object_reset(an_object);
+ processing.remove("verse");
+ ++cntr;
+ }
+ pith["block_is"] = eN.blk_is.poem;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ processing["verse"] ~= line ~= "\n";
+ if (pith["verse_new"] == eN.bi.on) {
+ obj_cite_digits = ocn_emit(pith["ocn"]);
+ pith["verse_new"] = eN.bi.off;
+ } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) {
+ processing["verse"] = processing["verse"].stripRight;
+ pith["verse_new"] = eN.bi.on;
+ verse_line = eN.bi.off;
+ }
+ if (pith["verse_new"] == eN.bi.on) {
+ verse_line = 1;
+ an_object[an_object_key] = processing["verse"];
+ debug(poem) { writefln(
+ "* %s tic\n%s",
+ obj_cite_digits.object_number,
+ an_object[an_object_key]
+ );
+ }
+ processing.remove("verse");
+ an_object["is"] = "verse";
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
+ content_non_header,
+ tag_in_seg,
+ lev_anchor_tag,
+ tag_assoc,
+ obj_cite_digits,
+ cntr,
+ heading_ptr-1,
+ an_object["is"]
+ );
+ ST_txtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_struct
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc);
+ an_object["substantive"] = substantive_obj_misc_struct.obj_txt;
+ anchor_tag = substantive_obj_misc_struct.anchor_tag;
+ comp_obj_ = set_object_generic("body", "body", "block", "verse", an_object["substantive"], obj_cite_digits.object_number);
+ comp_obj_.metainfo.identifier = obj_cite_digits.identifier;
+ comp_obj_.metainfo.object_number_off = obj_cite_digits.off;
+ comp_obj_.metainfo.o_n_book_index = obj_cite_digits.bkidx;
+ comp_obj_.metainfo.object_number_type = obj_cite_digits.type;
+ comp_obj_.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"];
+ comp_obj_.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"];
+ comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg;
+ comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star;
+ comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links;
+ the_document_body_section ~= comp_obj_;
+ tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc);
+ object_reset(an_object);
+ processing.remove("verse");
+ ++cntr;
+ }
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (auto m = line.matchFirst(rgx.block_tic_close)) {
an_object[an_object_key] = "verse";
@@ -1934,6 +2100,19 @@ ST_txt_by_line_block_generic txt_by_line_block_code()(
debug(codecurly) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(codequotemarks) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key]
+ .replaceFirst(rgx.newline_eol_delimiter_only, "")
+ .stripRight;
+ pith["block_is"] = eN.blk_is.code;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(codequotemarks) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(codetic) { writeln(line); }
@@ -2002,6 +2181,16 @@ ST_txt_by_line_block_generic txt_by_line_block_code()(
debug(table) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(table) { writeln(line); }
+ pith["block_is"] = eN.blk_is.table;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(table) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(table) { writeln(line); }
@@ -2045,6 +2234,17 @@ ST_txt_by_line_block_generic txt_by_line_block_quote()(
debug(quote) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(quote) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key].stripRight;
+ pith["block_is"] = eN.blk_is.quote;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(quote) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(quote) { writeln(line); }
diff --git a/org/ocda_obj_setter.org b/org/ocda_obj_setter.org
index 5ae401a..f37df13 100644
--- a/org/ocda_obj_setter.org
+++ b/org/ocda_obj_setter.org
@@ -437,6 +437,7 @@ static auto eN() {
tic,
curly_special,
tic_special,
+ quotemarks,
}
}
return _e();
diff --git a/src/sisudoc/io_in/read_source_files.d b/src/sisudoc/io_in/read_source_files.d
index 3cbaed0..c683d1e 100644
--- a/src/sisudoc/io_in/read_source_files.d
+++ b/src/sisudoc/io_in/read_source_files.d
@@ -253,7 +253,7 @@ template spineRawMarkupContent() {
) {
char[][] contents_insert;
int code_block_status = 0;
- enum codeBlock { off, curly, tic, }
+ enum codeBlock { off, curly, tic, quotemarks }
auto fn_pth_full = fn_src.match(rgx_files.src_pth_sst_or_ssm);
auto markup_src_file_path = fn_pth_full.captures[1];
foreach (line; markup_sourcefile_insert_content) {
@@ -265,11 +265,19 @@ template spineRawMarkupContent() {
} else if (line.matchFirst(rgx.block_curly_code_open)) {
code_block_status = codeBlock.curly;
contents_insert ~= line;
+ } else if (code_block_status == codeBlock.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ code_block_status = codeBlock.off;
+ }
+ contents_insert ~= line;
} else if (code_block_status == codeBlock.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
code_block_status = codeBlock.off;
}
contents_insert ~= line;
+ } else if (line.matchFirst(rgx.block_quotemarks_code_open)) {
+ code_block_status = codeBlock.quotemarks;
+ contents_insert ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
code_block_status = codeBlock.tic;
contents_insert ~= line;
@@ -328,7 +336,7 @@ template spineRawMarkupContent() {
import std.algorithm;
char[][] contents;
int code_block_status = 0;
- enum codeBlock { off, curly, tic, }
+ enum codeBlock { off, curly, tic, quotemarks }
auto fn_pth_full = fn_src.match(rgx_files.src_pth_sst_or_ssm);
auto markup_src_file_path = fn_pth_full.captures[1];
char[][] contents_insert;
@@ -343,11 +351,19 @@ template spineRawMarkupContent() {
} else if (line.matchFirst(rgx.block_curly_code_open)) {
code_block_status = codeBlock.curly;
contents ~= line;
+ } else if (code_block_status == codeBlock.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ code_block_status = codeBlock.off;
+ }
+ contents ~= line;
} else if (code_block_status == codeBlock.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
code_block_status = codeBlock.off;
}
contents ~= line;
+ } else if (line.matchFirst(rgx.block_quotemarks_code_open)) {
+ code_block_status = codeBlock.quotemarks;
+ contents ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
code_block_status = codeBlock.tic;
contents ~= line;
diff --git a/src/sisudoc/meta/metadoc_from_src_functions.d b/src/sisudoc/meta/metadoc_from_src_functions.d
index 781227f..3ae10d1 100644
--- a/src/sisudoc/meta/metadoc_from_src_functions.d
+++ b/src/sisudoc/meta/metadoc_from_src_functions.d
@@ -453,6 +453,62 @@ template docAbstractionFunctions() {
pith["block_is"] = eN.blk_is.table;
pith["block_state"] = eN.blk_state.on;
pith["block_delim"] = eN.blk_delim.curly_special;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_code_open)) {
+ dochas["codeblock"]++;
+ an_object["lang"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["syntax"] = (m["syntax"]) ? m["syntax"].to!string : "";
+ debug(codequotemarks) { writefln( "* [code quotemarks] %s", line); }
+ pith["block_is"] = eN.blk_is.code;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks; //
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_poem_open)) {
+ dochas["poem"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["lang"] = (m["lang"]) ? m["lang"].to!string : "";
+ debug(poem) { writefln( "* [poem quotemarks] %s", line); }
+ object_number_poem["start"] = obj_cite_digits.object_number.to!string;
+ pith["block_is"] = eN.blk_is.poem;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks; //
+ pith["verse_new"] = eN.bi.on;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_group_open)) {
+ dochas["group"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["lang"] = (m["lang"]) ? m["lang"].to!string : "";
+ debug(group) { writefln( "* [group quotemarks] %s", line); }
+ pith["block_is"] = eN.blk_is.group;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_block_open)) {
+ dochas["block"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = (m["attrib"]) ? m["attrib"].to!string : "";
+ an_object["lang"] = (m["lang"]) ? m["lang"].to!string : "";
+ debug(block) { writefln( "* [block quotemarks] %s", line); }
+ pith["block_is"] = eN.blk_is.block;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_quote_open)) {
+ dochas["quote"]++;
+ an_object["syntax"] = "";
+ an_object["attrib"] = m["attrib"].to!string;
+ an_object["lang"] = m["lang"].to!string;
+ debug(quote) { writefln( "* [quote quotemarks] %s", line); // quote (quotemarks) open
+ }
+ pith["block_is"] = eN.blk_is.quote;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
+ } else if (auto m = line.matchFirst(rgx.block_quotemarks_table_open)) { // quotemarks table open
+ debug(table) { writefln( "* [table quotemarks] %s", line); }
+ dochas["table"] ++;
+ an_object["table_head"] = m["attrib"].to!string;
+ an_object["block_type"] = "quotemarks";
+ pith["block_is"] = eN.blk_is.table;
+ pith["block_state"] = eN.blk_state.on;
+ pith["block_delim"] = eN.blk_delim.quotemarks;
} else if (auto m = line.matchFirst(rgx.block_tic_code_open)) {
dochas["codeblock"]++;
an_object["lang"] = "";
@@ -536,6 +592,17 @@ template docAbstractionFunctions() {
debug(group) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(group) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key].stripRight;
+ pith["block_is"] = eN.blk_is.group;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(group) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(group) { writeln(line); }
@@ -574,6 +641,17 @@ template docAbstractionFunctions() {
debug(block) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(block) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key].stripRight;
+ pith["block_is"] = eN.blk_is.block;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(block) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(block) { writeln(line); }
@@ -698,6 +776,94 @@ template docAbstractionFunctions() {
++cntr;
}
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (auto m = line.matchFirst(rgx.block_quotemarks_close)) {
+ an_object[an_object_key] = "verse";
+ debug(poem) { writefln( "* [poem quotemarks] %s", line); }
+ if (processing.length > 0) {
+ an_object[an_object_key] = processing["verse"];
+ }
+ if (an_object.length > 0) {
+ debug(poem) { writeln(__LINE__); writeln(obj_cite_digits.object_number, line); }
+ processing.remove("verse");
+ an_object["is"] = "verse";
+ ST_txtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_struct
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc);
+ an_object["substantive"] = substantive_obj_misc_struct.obj_txt;
+ anchor_tag = substantive_obj_misc_struct.anchor_tag;
+ comp_obj_ = set_object_generic("body", "body", "block", "verse", an_object["substantive"], obj_cite_digits.object_number);
+ comp_obj_.metainfo.identifier = obj_cite_digits.identifier;
+ comp_obj_.metainfo.object_number_off = obj_cite_digits.off;
+ comp_obj_.metainfo.o_n_book_index = obj_cite_digits.bkidx;
+ comp_obj_.metainfo.object_number_type = obj_cite_digits.type;
+ comp_obj_.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"];
+ comp_obj_.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"];
+ comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg;
+ comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star;
+ comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links;
+ the_document_body_section ~= comp_obj_;
+ tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc);
+ object_number_poem["end"] = obj_cite_digits.object_number.to!string;
+ object_reset(an_object);
+ processing.remove("verse");
+ ++cntr;
+ }
+ pith["block_is"] = eN.blk_is.poem;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ processing["verse"] ~= line ~= "\n";
+ if (pith["verse_new"] == eN.bi.on) {
+ obj_cite_digits = ocn_emit(pith["ocn"]);
+ pith["verse_new"] = eN.bi.off;
+ } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) {
+ processing["verse"] = processing["verse"].stripRight;
+ pith["verse_new"] = eN.bi.on;
+ verse_line = eN.bi.off;
+ }
+ if (pith["verse_new"] == eN.bi.on) {
+ verse_line = 1;
+ an_object[an_object_key] = processing["verse"];
+ debug(poem) { writefln(
+ "* %s tic\n%s",
+ obj_cite_digits.object_number,
+ an_object[an_object_key]
+ );
+ }
+ processing.remove("verse");
+ an_object["is"] = "verse";
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
+ content_non_header,
+ tag_in_seg,
+ lev_anchor_tag,
+ tag_assoc,
+ obj_cite_digits,
+ cntr,
+ heading_ptr-1,
+ an_object["is"]
+ );
+ ST_txtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_struct
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc);
+ an_object["substantive"] = substantive_obj_misc_struct.obj_txt;
+ anchor_tag = substantive_obj_misc_struct.anchor_tag;
+ comp_obj_ = set_object_generic("body", "body", "block", "verse", an_object["substantive"], obj_cite_digits.object_number);
+ comp_obj_.metainfo.identifier = obj_cite_digits.identifier;
+ comp_obj_.metainfo.object_number_off = obj_cite_digits.off;
+ comp_obj_.metainfo.o_n_book_index = obj_cite_digits.bkidx;
+ comp_obj_.metainfo.object_number_type = obj_cite_digits.type;
+ comp_obj_.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"];
+ comp_obj_.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"];
+ comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg;
+ comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star;
+ comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links;
+ the_document_body_section ~= comp_obj_;
+ tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc);
+ object_reset(an_object);
+ processing.remove("verse");
+ ++cntr;
+ }
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (auto m = line.matchFirst(rgx.block_tic_close)) {
an_object[an_object_key] = "verse";
@@ -816,6 +982,19 @@ template docAbstractionFunctions() {
debug(codecurly) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(codequotemarks) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key]
+ .replaceFirst(rgx.newline_eol_delimiter_only, "")
+ .stripRight;
+ pith["block_is"] = eN.blk_is.code;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(codequotemarks) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(codetic) { writeln(line); }
@@ -884,6 +1063,16 @@ template docAbstractionFunctions() {
debug(table) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(table) { writeln(line); }
+ pith["block_is"] = eN.blk_is.table;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(table) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(table) { writeln(line); }
@@ -927,6 +1116,17 @@ template docAbstractionFunctions() {
debug(quote) { writeln(line); }
an_object[an_object_key] ~= line ~= "\n";
}
+ } else if (pith["block_delim"] == eN.blk_delim.quotemarks) {
+ if (line.matchFirst(rgx.block_quotemarks_close)) {
+ debug(quote) { writeln(line); }
+ an_object[an_object_key] = an_object[an_object_key].stripRight;
+ pith["block_is"] = eN.blk_is.quote;
+ pith["block_state"] = eN.blk_state.closing;
+ pith["block_delim"] = eN.blk_delim.off;
+ } else {
+ debug(quote) { writeln(line); }
+ an_object[an_object_key] ~= line ~= "\n";
+ }
} else if (pith["block_delim"] == eN.blk_delim.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(quote) { writeln(line); }
diff --git a/src/sisudoc/meta/metadoc_object_setter.d b/src/sisudoc/meta/metadoc_object_setter.d
index 89ef856..e0e896e 100644
--- a/src/sisudoc/meta/metadoc_object_setter.d
+++ b/src/sisudoc/meta/metadoc_object_setter.d
@@ -420,6 +420,7 @@ template ObjectSetter() {
tic,
curly_special,
tic_special,
+ quotemarks,
}
}
return _e();
diff --git a/src/sisudoc/meta/rgx.d b/src/sisudoc/meta/rgx.d
index eb6fc04..259ab82 100644
--- a/src/sisudoc/meta/rgx.d
+++ b/src/sisudoc/meta/rgx.d
@@ -108,8 +108,8 @@ static template spineRgxIn() {
static para_attribs = ctRegex!(`^_(?:(?:[0-9])(?:_([0-9]))?|(?:[1-9])?[*]) `);
static para_inline_link_anchor = ctRegex!(`\*[~](?P<anchor>[a-z0-9_.-]+)(?= |$)`,"i");
/+ blocked markup +/
- static block_open = ctRegex!("^((code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|^`{3} (code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?|^[{]table[(](?:h;)?(?P<columns>(?:[ ,]+[0-9]+)+)[)][}]");
- static block_poem_open = ctRegex!("^((poem(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|`{3} poem(?:[(][ a-zA-Z0-9;:,]*[)])?)");
+ static block_open = ctRegex!("^((code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|^[`']{3} (code(?:[.][a-z][0-9a-z#+_]+)?|(?:poem|group|block|quote)(?:[.][a-z][0-9a-z_]+)?|table)(?:[(][ a-zA-Z0-9;:,]*[)])?|^[{]table[(](?:h;)?(?P<columns>(?:[ ,]+[0-9]+)+)[)][}]");
+ static block_poem_open = ctRegex!("^((poem(?:[(][ a-zA-Z0-9;:,]*[)])?[{][ ]*$)|[`']{3} poem(?:[(][ a-zA-Z0-9;:,]*[)])?)");
/+ blocked markup tics +/
static block_tic_code_open = ctRegex!("^`{3} code(?:[.](?P<syntax>[a-z][0-9a-z#+_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?");
static block_tic_poem_open = ctRegex!("^`{3} poem(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?");
@@ -118,6 +118,14 @@ static template spineRgxIn() {
static block_tic_quote_open = ctRegex!("^`{3} quote(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?");
static block_tic_table_open = ctRegex!("^`{3} table(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?"); // ctRegex!("^`{3} table(?:\(.*?\))?");
static block_tic_close = ctRegex!("^(`{3})$","m");
+ /+ blocked markup tics +/
+ static block_quotemarks_code_open = ctRegex!(`^'{3} code(?:[.](?P<syntax>[a-z][0-9a-z#+_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+ static block_quotemarks_poem_open = ctRegex!(`^'{3} poem(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+ static block_quotemarks_group_open = ctRegex!(`^'{3} group(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+ static block_quotemarks_block_open = ctRegex!(`^'{3} block(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+ static block_quotemarks_quote_open = ctRegex!(`^'{3} quote(?:[.](?P<lang>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`);
+ static block_quotemarks_table_open = ctRegex!(`^'{3} table(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?`); // ctRegex!("^'{3} table(?:\(.*?\))?");
+ static block_quotemarks_close = ctRegex!(`^('{3})$`,"m");
/+ blocked markup curly +/
static block_curly_code_open = ctRegex!(`^(?:code(?:[.](?P<syntax>[a-z][0-9a-z_]+))?(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);
static block_curly_code_close = ctRegex!(`^([}]code)`);