aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-07-13 20:53:44 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-10-17 19:07:20 -0400
commit97b317410345d56c274ad58f044d15cb06b8eca3 (patch)
tree4b4b89c122c4bcb17ad6c724da25d2b1c1660377 /src/doc_reform/meta
parentxmls, css, user-select on object-numbers & seg minitoc (diff)
xmls, css, codeblocks linenumbers
Diffstat (limited to 'src/doc_reform/meta')
-rw-r--r--src/doc_reform/meta/metadoc_from_src.d2
-rw-r--r--src/doc_reform/meta/object_setter.d1
-rw-r--r--src/doc_reform/meta/rgx.d2
3 files changed, 4 insertions, 1 deletions
diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d
index 944189e..ec1e01a 100644
--- a/src/doc_reform/meta/metadoc_from_src.d
+++ b/src/doc_reform/meta/metadoc_from_src.d
@@ -3357,6 +3357,7 @@ template DocReformDocAbstraction() {
"code block status: closed"
);
assertions_flag_types_block_status_none_or_closed(obj_type_status);
+ static auto rgx = Rgx();
if (obj_type_status["quote"] == TriState.closing) {
obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]);
an_object["bookindex_nugget"]
@@ -3584,6 +3585,7 @@ template DocReformDocAbstraction() {
comp_obj_code.metainfo.object_number_type = obj_cite_digits.type;
comp_obj_code.metainfo.syntax = an_object["syntax"];
comp_obj_code.metainfo.attrib = an_object["attrib"];
+ comp_obj_code.code_block.linenumbers = (an_object["attrib"].match(rgx.code_numbering)) ? true : false;
comp_obj_code.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"];
comp_obj_code.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"];
comp_obj_code.text = an_object["substantive"];
diff --git a/src/doc_reform/meta/object_setter.d b/src/doc_reform/meta/object_setter.d
index 6a95bcf..0ce74fd 100644
--- a/src/doc_reform/meta/object_setter.d
+++ b/src/doc_reform/meta/object_setter.d
@@ -101,6 +101,7 @@ template ObjectSetter() {
}
struct DocObj_CodeBlock_ {
string syntax = "";
+ bool linenumbers = false;
}
struct DocObj_Stow_ {
string[] link = [];
diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d
index 50665e1..926f2c6 100644
--- a/src/doc_reform/meta/rgx.d
+++ b/src/doc_reform/meta/rgx.d
@@ -100,7 +100,7 @@ static template DocReformRgxInit() {
static block_curly_table_open = ctRegex!(`^table(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$`);
static block_curly_table_close = ctRegex!(`^([}]table)`);
static block_curly_table_special_markup = ctRegex!(`^[{]table[(](?P<attrib>(?:(h);)?(?P<columns>(?:[, ]+[0-9]+)+))[)][}]`, "mg");
- static code_numbering = ctRegex!(`(?P<number>\bnumber\b)`);
+ static code_numbering = ctRegex!(`(?P<number>\blinenumber\b|\bnumber\b|\blnr\b)`);
static table_head_instructions = ctRegex!(`(?:(?P<c_heading>h);)?(?:[ ]+c(?P<c_num>[0-9]):)?(?P<c_widths>(?:[, ]+[0-9]+[lr]?)+)`);
static table_col_widths_and_alignment = ctRegex!(`(?P<width>[0-9]+)(?P<align>[lr]?)`);
static table_col_widths = ctRegex!(`(?P<widths>[0-9]+)`);