diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2018-12-12 10:53:41 -0500 | 
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-05-17 16:59:38 -0400 | 
| commit | d67f94fc2af8be775dd9cc01f5feacd501b71721 (patch) | |
| tree | 8d02c5424235820629085b5f429110bf13194db2 | |
| parent | output_hub conditional imports (diff) | |
0.4.1 markup syntax extension for blocks, re: attributes
- for all blocks, e.g.
  - table{
    - table(){
    - table([recognized attributes if any]){
  - code{
    - code(){
    - code.d([recognized attributes if any]){
- allows for the subsequent addition of attributes as required
| -rw-r--r-- | org/default_regex.org | 40 | ||||
| -rw-r--r-- | org/doc_reform.org | 2 | ||||
| -rw-r--r-- | src/doc_reform/meta/rgx.d | 40 | ||||
| -rw-r--r-- | views/version.txt | 2 | 
4 files changed, 42 insertions, 42 deletions
| diff --git a/org/default_regex.org b/org/default_regex.org index be628dd..ad8b9e5 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -76,7 +76,7 @@ static levels_markup                                  = ctRegex!(`^[A-D1-4]$`);  static levels_numbered                                = ctRegex!(`^[0-9]$`);  static levels_numbered_headings                       = ctRegex!(`^[0-7]$`);  static numeric                                        = ctRegex!(`[ 0-9,.-]+`); -static numeric_col                                    = ctRegex!(`^[ 0-9,.$£₤Є€€¥-]+$`); +static numeric_col                                    = ctRegex!(`^[ 0-9,.%$£₤Є€€¥()-]+$`);  #+END_SRC  ** comments                                                        :comment: @@ -174,8 +174,8 @@ static para_inline_link_anchor                        = ctRegex!(`\*[~](?P<ancho  #+name: meta_rgx  #+BEGIN_SRC d  /+ blocked markup +/ -static block_open                                     = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)|^[{]table(~h)?(?P<columns>(?:[ ]+[0-9]+;)+)[}]"); -static block_poem_open                                = ctRegex!("^((poem[{].*?$)|`{3} poem)"); +static block_open                                     = ctRegex!("^((code(?:[.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)(?:[(][ a-zA-Z0-9;:,#]*[)])?[{][ ]*$)|^`{3} (code(?:[.][a-z][0-9a-z_]+)?|poem|group|block|quote|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: @@ -183,13 +183,13 @@ static block_poem_open                                = ctRegex!("^((poem[{].*?$  #+name: meta_rgx  #+BEGIN_SRC d  /+ blocked markup tics +/ -static block_tic_open                                 = ctRegex!("^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); // what of numbered code? -static block_tic_code_open                            = ctRegex!("^`{3} (?:code)(?:[.]([a-z][0-9a-z_]+))?(?:[ ]+([#]))?"); // extract additional info -static block_tic_poem_open                            = ctRegex!("^`{3} (poem)"); -static block_tic_group_open                           = ctRegex!("^`{3} (group)"); -static block_tic_block_open                           = ctRegex!("^`{3} (block)"); -static block_tic_quote_open                           = ctRegex!("^`{3} (quote)"); -static block_tic_table_open                           = ctRegex!("^`{3} table(.*)"); +static block_tic_open                                 = ctRegex!("^`{3} (code(?:[.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); +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<attrib>[ a-zA-Z0-9;:,]*)[)])?"); +static block_tic_group_open                           = ctRegex!("^`{3} (group)(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?"); +static block_tic_block_open                           = ctRegex!("^`{3} (block)(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?"); +static block_tic_quote_open                           = ctRegex!("^`{3} (quote)(?:[(](?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");  #+END_SRC @@ -198,27 +198,27 @@ static block_tic_close                                = ctRegex!("^(`{3})$","m")  #+name: meta_rgx  #+BEGIN_SRC d  /+ blocked markup curly +/ -static block_curly_open                               = ctRegex!(`^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)`); -static block_curly_code_open                          = ctRegex!(`^(?:code(?:[.]([a-z][0-9a-z_]+))?[{]([#]?)\s*$)`); // extract additional info +static block_curly_open                               = ctRegex!(`^((?:code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)(?:[(][ a-zA-Z0-9;:,#]*[)])?[{][ ]*$)`); +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)`); -static block_curly_poem_open                          = ctRegex!(`^(poem[{].*?$)`); +static block_curly_poem_open                          = ctRegex!(`^(poem(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);  static block_curly_poem_close                         = ctRegex!(`^([}]poem)`); -static block_curly_group_open                         = ctRegex!(`^(group[{].*?$)`); +static block_curly_group_open                         = ctRegex!(`^(group(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);  static block_curly_group_close                        = ctRegex!(`^([}]group)`); -static block_curly_block_open                         = ctRegex!(`^(block[{].*?$)`); +static block_curly_block_open                         = ctRegex!(`^(block(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);  static block_curly_block_close                        = ctRegex!(`^([}]block)`); -static block_curly_quote_open                         = ctRegex!(`^(quote[{].*?$)`); +static block_curly_quote_open                         = ctRegex!(`^(quote(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);  static block_curly_quote_close                        = ctRegex!(`^([}]quote)`); -static block_curly_table_open                         = ctRegex!(`^table[{](.*)`); +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((~h)?(?P<columns>(?:[ ]+[0-9]+;)+))[}]`, "mg"); +static block_curly_table_special_markup               = ctRegex!(`^[{]table[(](?P<attrib>(?:(h);)?(?P<columns>(?:[, ]+[0-9]+)+))[)][}]`, "mg");  #+END_SRC  *** block sub-matches                                         :block:curly:  #+name: meta_rgx  #+BEGIN_SRC d -static table_head_instructions                        = ctRegex!(`(?P<c_heading>h)?(?:[ ]+c(?P<c_num>[0-9]);)?(?P<c_widths>(?:[ ]+[0-9]+[lr]?;)+)`); +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]+)`);  static table_col_align                                = ctRegex!(`(?P<align>[lr]?)`); @@ -293,7 +293,7 @@ static book_index_close                               = ctRegex!(`^(.*?)\}$`, "m  #+name: meta_rgx  #+BEGIN_SRC d  /+ no object_number object +/ -static object_number_off                            = ctRegex!(`~#$`, "m"); +static object_number_off                            = ctRegex!(`~#[ ]*$`, "m");  static object_number_off_dh                         = ctRegex!(`-#$`, "m");  static object_number_off_all                        = ctRegex!(`[~-]#$`, "m");  #+END_SRC diff --git a/org/doc_reform.org b/org/doc_reform.org index afc7477..bef16f0 100644 --- a/org/doc_reform.org +++ b/org/doc_reform.org @@ -26,7 +26,7 @@ struct Version {    int minor;    int patch;  } -enum ver = Version(0, 4, 0); +enum ver = Version(0, 4, 1);  #+END_SRC  ** compilation restrictions (supported compilers) diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d index 6143656..6cf9c28 100644 --- a/src/doc_reform/meta/rgx.d +++ b/src/doc_reform/meta/rgx.d @@ -33,7 +33,7 @@ static template DocReformRgxInit() {      static levels_numbered                                = ctRegex!(`^[0-9]$`);      static levels_numbered_headings                       = ctRegex!(`^[0-7]$`);      static numeric                                        = ctRegex!(`[ 0-9,.-]+`); -    static numeric_col                                    = ctRegex!(`^[ 0-9,.$£₤Є€€¥-]+$`); +    static numeric_col                                    = ctRegex!(`^[ 0-9,.%$£₤Є€€¥()-]+$`);      /+ comments +/      static comment                                        = ctRegex!(`^%+ `);      static comments                                       = ctRegex!(`^%+ |^%+$`); @@ -93,33 +93,33 @@ static template DocReformRgxInit() {      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|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)|^[{]table(~h)?(?P<columns>(?:[ ]+[0-9]+;)+)[}]"); -    static block_poem_open                                = ctRegex!("^((poem[{].*?$)|`{3} poem)"); +    static block_open                                     = ctRegex!("^((code(?:[.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)(?:[(][ a-zA-Z0-9;:,#]*[)])?[{][ ]*$)|^`{3} (code(?:[.][a-z][0-9a-z_]+)?|poem|group|block|quote|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_open                                 = ctRegex!("^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); // what of numbered code? -    static block_tic_code_open                            = ctRegex!("^`{3} (?:code)(?:[.]([a-z][0-9a-z_]+))?(?:[ ]+([#]))?"); // extract additional info -    static block_tic_poem_open                            = ctRegex!("^`{3} (poem)"); -    static block_tic_group_open                           = ctRegex!("^`{3} (group)"); -    static block_tic_block_open                           = ctRegex!("^`{3} (block)"); -    static block_tic_quote_open                           = ctRegex!("^`{3} (quote)"); -    static block_tic_table_open                           = ctRegex!("^`{3} table(.*)"); +    static block_tic_open                                 = ctRegex!("^`{3} (code(?:[.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); +    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<attrib>[ a-zA-Z0-9;:,]*)[)])?"); +    static block_tic_group_open                           = ctRegex!("^`{3} (group)(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?"); +    static block_tic_block_open                           = ctRegex!("^`{3} (block)(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?"); +    static block_tic_quote_open                           = ctRegex!("^`{3} (quote)(?:[(](?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 curly +/ -    static block_curly_open                               = ctRegex!(`^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)`); -    static block_curly_code_open                          = ctRegex!(`^(?:code(?:[.]([a-z][0-9a-z_]+))?[{]([#]?)\s*$)`); // extract additional info +    static block_curly_open                               = ctRegex!(`^((?:code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)(?:[(][ a-zA-Z0-9;:,#]*[)])?[{][ ]*$)`); +    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)`); -    static block_curly_poem_open                          = ctRegex!(`^(poem[{].*?$)`); +    static block_curly_poem_open                          = ctRegex!(`^(poem(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);      static block_curly_poem_close                         = ctRegex!(`^([}]poem)`); -    static block_curly_group_open                         = ctRegex!(`^(group[{].*?$)`); +    static block_curly_group_open                         = ctRegex!(`^(group(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);      static block_curly_group_close                        = ctRegex!(`^([}]group)`); -    static block_curly_block_open                         = ctRegex!(`^(block[{].*?$)`); +    static block_curly_block_open                         = ctRegex!(`^(block(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);      static block_curly_block_close                        = ctRegex!(`^([}]block)`); -    static block_curly_quote_open                         = ctRegex!(`^(quote[{].*?$)`); +    static block_curly_quote_open                         = ctRegex!(`^(quote(?:[(](?P<attrib>[ a-zA-Z0-9;:,]*)[)])?[{][ ]*$)`);      static block_curly_quote_close                        = ctRegex!(`^([}]quote)`); -    static block_curly_table_open                         = ctRegex!(`^table[{](.*)`); +    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((~h)?(?P<columns>(?:[ ]+[0-9]+;)+))[}]`, "mg"); -    static table_head_instructions                        = ctRegex!(`(?P<c_heading>h)?(?:[ ]+c(?P<c_num>[0-9]);)?(?P<c_widths>(?:[ ]+[0-9]+[lr]?;)+)`); +    static block_curly_table_special_markup               = ctRegex!(`^[{]table[(](?P<attrib>(?:(h);)?(?P<columns>(?:[, ]+[0-9]+)+))[)][}]`, "mg"); +    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]+)`);      static table_col_align                                = ctRegex!(`(?P<align>[lr]?)`); @@ -163,7 +163,7 @@ static template DocReformRgxInit() {      static book_index_open                                = ctRegex!(`^=\{\s*([^}]+?)$`);      static book_index_close                               = ctRegex!(`^(.*?)\}$`, "m");      /+ no object_number object +/ -    static object_number_off                            = ctRegex!(`~#$`, "m"); +    static object_number_off                            = ctRegex!(`~#[ ]*$`, "m");      static object_number_off_dh                         = ctRegex!(`-#$`, "m");      static object_number_off_all                        = ctRegex!(`[~-]#$`, "m");      /+ no object_number block +/ diff --git a/views/version.txt b/views/version.txt index de1a62b..735996e 100644 --- a/views/version.txt +++ b/views/version.txt @@ -4,7 +4,7 @@ struct Version {    int minor;    int patch;  } -enum ver = Version(0, 4, 0); +enum ver = Version(0, 4, 1);  version (Posix) {    version (DigitalMars) {    } else version (LDC) { | 
