markup modification: code blocks attributes, numberlines
authorRalph Amissah <ralph@amissah.com>
Mon, 2 Sep 2019 15:36:58 +0000 (11:36 -0400)
committerRalph Amissah <ralph@amissah.com>
Tue, 3 Sep 2019 16:08:55 +0000 (12:08 -0400)
data/doc/sisu/CHANGELOG_v7
data/doc/sisu/markup-samples/manual/en/sisu_markup.sst
lib/sisu/ao_doc_str.rb

index dce249e0728377f8473b34315b2ed8e2c18197b1..1815a67ae8573c42b5e5f4cee75609adee7367e5 100644 (file)
@@ -30,6 +30,7 @@ Reverse Chronological:
     - table attributes, place in parenthesis
       table([attributes]){
       ``` table([attributes])
+    - code blocks attributes, numberlines
 
 * sisu_7.1.12.orig.tar.xz (2019-07-16:28/2)
   http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_7.1.12
index 73ed21ab9771e99a5717e7e86fb50bdd12a541e3..95b4a1462d17b763594f925f41db08ca643efe27 100644 (file)
@@ -1225,9 +1225,11 @@ code{
 
 }code
 
-From SiSU 2.7.7 on you can number codeblocks by placing a hash after the opening code tag #{ code{# }# as demonstrated here:
+From SiSU 2.7.7 on you can number codeblocks by placing a hash after the opening code tag #{ code{# }# this is depreciated from sisu 7.2.0 with the introduction of the parenthesis before curly braces for attributes.
 
-code{#
+From SiSU 7.2.0 on you can number codeblocks by writing the "numberline" attribute within parenthesis before the opening code tag #{ code(numberlines){ }# as demonstrated here:
+
+code(numberlines){
 
                     `Fury said to a
                    mouse, That he
index eec2cbad99e65c39eb4074bf492eb16b786b02fa..1aba9bd743e88be3cbf09c99fcc4e4fb883e2da4 100644 (file)
@@ -296,8 +296,8 @@ module SiSU_AO_DocumentStructureExtract
           else nil
           end
         end
-        if t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\(.+?\)\{|\{table\()|^(?:table\{|\{table)[ ~]/ \
-        and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$|^`:quote_(?:open|close)`/ \
+        if t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\(.+?\)\{|\{table\()|^(?:table\{|\{table)[ ~]/ \
+        and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$|^`:quote_(?:open|close)`/ \
         and @per.code==:off \
         and @per.poem==:off \
         and @per.group==:off \
@@ -497,15 +497,15 @@ module SiSU_AO_DocumentStructureExtract
             t_o=SiSU_AO_DocumentStructureExtract::Structure.new(@md).structure_markup(t_o) #must happen earlier, node info etc. require
           end
         elsif @per.code==:off
-          if t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?)/
+          if t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?)/
             @per.code=case t_o
-            when /^code(?:\.[a-z][0-9a-z_]+)?\{/ then :curls
+            when /^code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?\{/ then :curls
             when /^```[ ]+code/                  then :tics
             else                                 @per.code #error
             end
-            @per.lngsyn=if t_o =~/^(?:code\.[a-z][0-9a-z_]+\{|```[ ]+code\.[a-z_]+)/
+            @per.lngsyn=if t_o =~/^(?:code\.[a-z][0-9a-z_]+(?:\(.+?\))?\{|```[ ]+code\.[a-z_]+)/
               case t_o
-              when /^code\.([a-z][0-9a-z_]+)\{/
+              when /^code\.([a-z][0-9a-z_]+)(?:\(.+?\))?\{/
                 :"#{$1}"
               when /^```[ ]+code\.([a-z][0-9a-z_]+)/
                 :"#{$1}"
@@ -515,7 +515,7 @@ module SiSU_AO_DocumentStructureExtract
             end
             @@counter=1
             @codeblock_numbered=
-              (t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{#|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\s[#])/) \
+              (t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\)\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\))/) \
               ? true
               : false
             @num_id[:code_block] +=1