aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_regex.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/default_regex.org')
-rw-r--r--org/default_regex.org67
1 files changed, 52 insertions, 15 deletions
diff --git a/org/default_regex.org b/org/default_regex.org
index ffd03f1..1c0ca2f 100644
--- a/org/default_regex.org
+++ b/org/default_regex.org
@@ -4,12 +4,12 @@
#+FILETAGS: :spine:regex:
#+AUTHOR: Ralph Amissah
#+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
-#+COPYRIGHT: Copyright (C) 2015 - 2024 Ralph Amissah
+#+COPYRIGHT: Copyright (C) 2015 - 2025 Ralph Amissah
#+LANGUAGE: en
#+STARTUP: content hideblocks hidestars noindent entitiespretty
#+PROPERTY: header-args :exports code
#+PROPERTY: header-args+ :noweb yes
-#+PROPERTY: header-args+ :results no
+#+PROPERTY: header-args+ :results output none
#+PROPERTY: header-args+ :cache no
#+PROPERTY: header-args+ :padline no
#+PROPERTY: header-args+ :mkdirp yes
@@ -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
@@ -289,9 +308,9 @@ static table_col_separator_nl = ctRegex!(`[┊]$`, "mg");
#+BEGIN_SRC d
/+ inline markup footnotes endnotes +/
static inline_notes_curly_gen = ctRegex!(`~\{.+?\}~`, "m");
-static inline_notes_curly = ctRegex!(`~\{\s*(.+?)\}~`, "mg");
-static inline_notes_curly_sp_asterisk = ctRegex!(`~\{[*]+\s+(.+?)\}~`, "m");
-static inline_notes_curly_sp_plus = ctRegex!(`~\{[+]+\s+(.+?)\}~`, "m");
+static inline_notes_curly = ctRegex!(`~\{\s*(.+?)\s*\}~`, "mg");
+static inline_notes_curly_sp_asterisk = ctRegex!(`~\{[*]+\s+(.+?)\s*\}~`, "m");
+static inline_notes_curly_sp_plus = ctRegex!(`~\{[+]+\s+(.+?)\s*\}~`, "m");
static note_ref = ctRegex!(`^\S+?noteref_(?P<ref>[0-9]+)`, "mg"); // {^{73.}^}#noteref_73
#+END_SRC
@@ -312,8 +331,8 @@ static smid_inline_url_generic = ctRegex!(`(?:^|[}(\[ ])(
static smid_inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]\S*)`, "mg");
static smid_inline_link_naked_url = ctRegex!(`(?P<pre>^|[ (\[])(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?=[.,;:?!'"]?([ )\]]|$))`, "mg");
static smid_inline_link_markup_regular = ctRegex!(`(?P<pre>^|[ (\[])\{\s*(?P<content>.+?)\s*\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
-static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[.,;:?!]?([ ]|$))`, "mg");
-static smid_inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
+static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P<content>.+?)\s*\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[.,;:?!]?([ ]|$))`, "mg");
+static smid_inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P<content>.+?)\s*\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
#+END_SRC
#+BEGIN_SRC d
@@ -488,7 +507,6 @@ static make_breakcolumn = ctRegex!(`break=(?P<breakcolum
#+END_SRC
* 2. ctRegex defaults shared by meta & output (generic)
-
** meta
#+NAME: prgmkup_rgx_meta
@@ -526,9 +544,9 @@ static middle_dot = ctRegex!(`·`, "mg");
static br_empty_line = ctRegex!(`\n[ ]*\n`, "mg");
static br_linebreaks_newlines = ctRegex!(`[\n┘┙]`, "mg");
static br_linebreaks = ctRegex!(`[┘┙]`, "mg");
-static br_line = ctRegex!(`┘`, "mg");
-static br_line_inline = ctRegex!(`┙`, "mg");
-static br_line_spaced = ctRegex!(`┚`, "mg");
+static br_line = ctRegex!(`\s*┘\s*`, "mg");
+static br_line_inline = ctRegex!(`\s*┙\s*`, "mg");
+static br_line_spaced = ctRegex!(`\s*┚\s*`, "mg");
#+END_SRC
#+BEGIN_SRC d
@@ -590,6 +608,7 @@ static inline_al_delimiter_open_regular = ctRegex!(`【\s`, "m");
static inline_al_delimiter_open_symbol_star = ctRegex!(`【[*]\s`, "m");
static inline_al_delimiter_open_symbol_plus = ctRegex!(`【[+]\s`, "m");
static inline_text_and_note_al_ = ctRegex!(`(.+?(?:【[*+]*\s+.+?】|.+))`, "mg");
+static endnote_section_note = ctRegex!(`┥\s*⑆\^┨(?P<notenumber>\d+)\.┣\^┝┤(?P<link>¤?.+?)├.+`, "mg");
#+END_SRC
#+BEGIN_SRC d
@@ -615,6 +634,7 @@ static inline_link_hash = ctRegex!(`┥(?P<text>.+?)┝
static inline_link_seg_and_hash = ctRegex!(`┥(?P<text>.+?)┝┤(?P<link>(?P<seg>[^/#├]*)#(?P<hash>.+?))├`, "mg");
static inline_link_clean = ctRegex!(`┤(?:.+?)├|[┥┝]`, "mg");
static inline_link_toc_to_backmatter = ctRegex!(`┤#(?P<link>endnotes|bibliography|bookindex|glossary|blurb)├`, "mg");
+static find_bookindex_ocn_link_and_comma = ctRegex!(`[, ]*┥.+?┝┤#?\S+?├`, "mg");
static url = ctRegex!(`https?://`, "mg");
static uri = ctRegex!(`(?:https?|git)://`, "mg");
static uri_identify_components = ctRegex!(`(?P<type>(?:https?|git)://)(?P<path>\S+?/)(?P<file>[^/]+)$`, "mg");
@@ -692,7 +712,7 @@ static src_formalised_file_path_parts = ctRegex!(`(?P<pth>(?:[/a-zA-Z0
** _module template yaml tags
-#+HEADER: :tangle "../src/sisudoc/meta/rgx_yaml_tags.d"
+#+HEADER: :tangle "../src/sisudoc/meta/rgx_yaml.d"
#+HEADER: :noweb yes
#+BEGIN_SRC d
<<doc_header_including_copyright_and_license>>
@@ -780,7 +800,24 @@ static latex_clean_internal_link = ctRegex!(`^(?:#|¤\S+?#)`, "m"
static latex_clean_bookindex_linebreak = ctRegex!(`\s*\\\\\\\\\s*`, "m");
#+END_SRC
-* document header including copyright & license
+* org includes
+** project version
+
+#+NAME: spine_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./sisudoc_spine_version_info_and_doc_header_including_copyright_and_license.org:spine_project_version()>>
+#+END_SRC
+
+** year
+
+#+NAME: year
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./sisudoc_spine_version_info_and_doc_header_including_copyright_and_license.org:year()>>
+#+END_SRC
+
+** document header including copyright & license
#+NAME: doc_header_including_copyright_and_license
#+HEADER: :noweb yes