markup modification: table attributes
authorRalph Amissah <ralph@amissah.com>
Wed, 28 Aug 2019 14:50:16 +0000 (10:50 -0400)
committerRalph Amissah <ralph@amissah.com>
Tue, 3 Sep 2019 16:08:28 +0000 (12:08 -0400)
data/doc/sisu/CHANGELOG_v7
data/doc/sisu/markup-samples/manual/en/sisu_howto.sst
data/doc/sisu/markup-samples/manual/en/sisu_markup.sst
data/doc/sisu/markup-samples/manual/en/sisu_output_overview.sst
lib/sisu/ao_doc_str.rb

index 7e7a44c5f4dbab94de142b81e5c4f87b63c467e4..dce249e0728377f8473b34315b2ed8e2c18197b1 100644 (file)
@@ -27,6 +27,9 @@ Reverse Chronological:
 
   - markup modification
     - (markup blocks) distinguish block from group
+    - table attributes, place in parenthesis
+      table([attributes]){
+      ``` table([attributes])
 
 * 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 f40d53294bfa0a149d79a169fea60f89e29fe100..8440a64ad77a5ddca78be1f96094e49931efc527 100644 (file)
@@ -455,7 +455,7 @@ Table markup sample
 
 code{
 
-table{~h c3; 26; 32; 32;
+table(h c3, 26, 32, 32){
 
 This is a table, column1
 this would become row one of column two
index f67db5a1e4fb8d409b4744003f4758b6c97968c1..73ed21ab9771e99a5717e7e86fb50bdd12a541e3 100644 (file)
@@ -839,7 +839,7 @@ Tables may be prepared in two either of two forms
 
 code{
 
-table{ c3; 40; 30; 30;
+table(c3: 40, 30, 30){
 
 This is a table
 this would become column two of row one
@@ -855,7 +855,7 @@ column three of row two, and so on
 
 !_ resulting output:
 
-table{ c3; 40; 30; 30;
+table(c3: 40, 30, 30){
 
 This is a table
 this would become column two of row one
@@ -877,7 +877,7 @@ code{
 
 !_ Table 3.1: Contributors to Wikipedia, January 2001 - June 2005
 
-{table~h 24; 12; 12; 12; 12; 12; 12;}
+{table(h 24, 12, 12, 12, 12, 12, 12)}
                                 |Jan. 2001|Jan. 2002|Jan. 2003|Jan. 2004|July 2004|June 2006
 Contributors*                   |       10|      472|    2,188|    9,653|   25,011|   48,721
 Active contributors**           |        9|      212|      846|    3,228|    8,442|   16,945
@@ -894,7 +894,7 @@ No. of articles, all languages  |       25|   19,000|  138,000|  490,000|  862,0
 
 !_ Table 3.1: Contributors to Wikipedia, January 2001 - June 2005
 
-{table~h 24; 12; 12; 12; 12; 12; 12;}
+{table(h 24, 12, 12, 12, 12, 12, 12)}
                                 |Jan. 2001|Jan. 2002|Jan. 2003|Jan. 2004|July 2004|June 2006
 Contributors*                   |       10|      472|    2,188|    9,653|   25,011|   48,721
 Active contributors**           |        9|      212|      846|    3,228|    8,442|   16,945
index 332f4aaebe7bef6d2ad6b3e32157b8c74acce14a..428bc22326fa1d1062bb7dc2519163e8adc14c45 100644 (file)
@@ -34,7 +34,7 @@ for various forms of output of SiSU.
 
 !_ sisu-2.0.0 on 2010-03-06
 
-{table~h 28}
+{table(h 28)}
 feature                   |txt|ltx/pdf|HTML|EPUB|XML/s|XML/d|ODF|SQLite|pgSQL
 headings                  | * | *     | *  | *  | *   | *   | * | *    | *
 footnotes                 | * | *     | *  | *  | *   | *   | * | *    | *
@@ -65,7 +65,7 @@ special characters        | . | .     | .  | .  |     |     |   |      |
 
 !_ sisu-1.0.0 on 2009-10-28
 
-{table~h 28}
+{table(h 28)}
 feature                   |txt|ltx/pdf|HTML|XML/s|XML/d|ODF|SQLite|pgSQL
 headings                  | * | *     | *  | *   | *   | * | *    | *
 footnotes                 | * | *     | *  | *   | *   | * | *    | *
@@ -96,7 +96,7 @@ special characters        | . | .     | .  |     |     |   |      |
 
 !_ sisu-0.36.6 on 2006-01-23
 
-{table~h 28; 8; 8; 8; 8; 8; 8; 8; 8; 8;}
+{table(h 28, 8, 8, 8, 8, 8, 8, 8, 8, 8)}
 feature                   |txt|ltx/pdf|HTML|XHTML|XML/s|XML/d|ODF|SQLite|pgSQL
 headings                  | * | *     | *  | *   | *   | *   | * | *    | *
 footnotes                 | * | *     | *  | *   | *   | *   | * | *    | *
index 27152b981867cd08764e0f5981266949edc64657..5b1f8f614981ef871e05822e78913fd1c4080ae3 100644 (file)
@@ -296,7 +296,7 @@ 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)[ ~]/ \
+        if t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?: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 \
@@ -613,7 +613,7 @@ module SiSU_AO_DocumentStructureExtract
             }
             t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
             #tuned_file << t_o #% find second source, entered twice, should be once so closed off here
-          elsif t_o =~/^(?:table\{|```[ ]+table|\{table)[ ~]/
+          elsif t_o =~/^(?:table\(.+?\)\{|```[ ]+table\(.+?\)|\{table\(.+?\))/
             @num_id[:table] +=1
             h={
               is_for: :table,
@@ -623,15 +623,15 @@ module SiSU_AO_DocumentStructureExtract
             }
             ins_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
             tuned_file << ins_o
-            if t_o=~/^table\{(?:~h)?\s+/
+            if t_o=~/^table\((?:.*?\bh;\s+)?.+?\)\{/
               @per.table=:curls
               @rows=''
               case t_o
-              when /table\{~h\s+c(\d+);\s+(.+)/
+              when /table\(.*?\bh;\s+c(\d+):\s+(.+?)\)\{/
                 cols=$1
                 col=$2.scan(/\d+/)
                 heading=true
-              when /table\{\s+c(\d+);\s+(.+)/
+              when /table\(.*?c(\d+):\s+(.+?)\)\{/
                 cols=$1
                 col=$2.scan(/\d+/)
                 heading=false
@@ -642,15 +642,15 @@ module SiSU_AO_DocumentStructureExtract
                 widths: col,
                 idx: idx,
               }
-            elsif t_o=~/^```[ ]+table(?:~h)?\s+c\d+/
+            elsif t_o=~/^```[ ]+table\((?:.*?\bh;)?\s+c\d+:/
               @per.table=:tics
               @rows=''
               case t_o
-              when /^```[ ]+table~h\s+c(\d+);\s+(.+)/
+              when /^```[ ]+table\(.*?\bh;\s+c(\d+):\s+(.+?)\)/
                 cols=$1
                 col=$2.scan(/\d+/)
                 heading=true
-              when /^```[ ]+table\s+c(\d+);\s+(.+)/
+              when /^```[ ]+table\(\s*c(\d+):\s+(.+?)\)/
                 cols=$1
                 col=$2.scan(/\d+/)
                 heading=false
@@ -661,10 +661,10 @@ module SiSU_AO_DocumentStructureExtract
                 widths: col,
                 idx: idx,
               }
-            elsif t_o=~/^\{table(?:~h)?(?:\s+\d+;?)?\}\n.+\Z/m
+            elsif t_o=~/^\{table\((?:.*?\bh;\s+)?(?:\s+\d+,?)?\)\s*\}\n.+\Z/m
               m1,m2,hd=nil,nil,nil
-              tbl=/^\{table(?:~h)?(?:\s+\d+;?)?\}\n(.+)\Z/m.match(t_o)[1]
-              hd=((t_o =~/^\{table~h/) ? true : false)
+              tbl=/^\{table\((?:.*?\bh;\s+)?(?:\s+\d+,?)*\)\s*\}\n(.+)\Z/m.match(t_o)[1] # fix
+              hd=((t_o =~/^\{table\(.*?\bh;\s+/) ? true : false)
               tbl,tags=extract_tags(tbl)
               rws=tbl.split(/\n/)
               rows=''
@@ -675,7 +675,7 @@ module SiSU_AO_DocumentStructureExtract
                 rows += r + Mx[:tc_c]
               end
               col=[]
-              if t_o =~/^\{table(?:~h)?\s+(\d+);?\}/       #width of col 1 given as %, usually when wider than rest that are even
+              if t_o =~/^\{table\((?:.*?\bh;\s+)?\s+c(\d+):.*?\)\s*\}/       #width of col 1 given as %, usually when wider than rest that are even
                 c1=$1.to_i
                 width=(100 - c1)/(cols - 1)
                 col=[ c1 ]
@@ -704,12 +704,12 @@ module SiSU_AO_DocumentStructureExtract
               }
               t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
               t_o
-            elsif t_o=~/^```[ ]+table(?:~h)?\s+/
+            elsif t_o=~/^```[ ]+table\((?:.*?\bh;)?\s+/
               m1,m2,hd=nil,nil,nil
               h=case t_o
-              when /^```[ ]+table~h\s+(.+?)\n(.+)\Z/m      #two table representations should be consolidated as one
+              when /^```[ ]+table\(.*?\bh;\s+(.+?)\)\n(.+)\Z/m      #two table representations should be consolidated as one
                 m1,tbl,hd=$1,$2,true
-              when /^```[ ]+table\s+(.+?)\n(.+)\Z/m        #two table representations should be consolidated as one
+              when /^```[ ]+table\((.+?)\)\n(.+)\Z/m        #two table representations should be consolidated as one
                 m1,tbl,hd=$1,$2,false
               else nil
               end
@@ -741,12 +741,12 @@ module SiSU_AO_DocumentStructureExtract
                 }
               t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
               t_o
-            elsif t_o=~/^\{table(?:~h)?\s+/
+            elsif t_o=~/^\{table\((?:.*?\bh;)?/
               m1,m2,hd=nil,nil,nil
               h=case t_o
-              when /\{table~h\s+(.+?)\}\n(.+)\Z/m          #two table representations should be consolidated as one
+              when /\{table\(.*?\bh;\s+(.+?)\)\s*\}\n(.+)\Z/m          #two table representations should be consolidated as one
                 m1,tbl,hd=$1,$2,true
-              when /\{table\s+(.+?)\}\n(.+)\Z/m            #two table representations should be consolidated as one
+              when /\{table\((.+?)\)\s*\}\n(.+)\Z/m            #two table representations should be consolidated as one
                 m1,tbl,hd=$1,$2,false
               else nil
               end