re-introduce depreciated markup for numbering codeblocks
authorRalph Amissah <ralph@amissah.com>
Mon, 2 Sep 2019 15:47:30 +0000 (11:47 -0400)
committerRalph Amissah <ralph@amissah.com>
Tue, 3 Sep 2019 16:08:57 +0000 (12:08 -0400)
lib/sisu/ao_doc_str.rb

index 1aba9bd743e88be3cbf09c99fcc4e4fb883e2da4..40f5a0456d8f95a27c564ff9a4edd8812190bb70 100644 (file)
@@ -515,9 +515,12 @@ module SiSU_AO_DocumentStructureExtract
             end
             @@counter=1
             @codeblock_numbered=
-              (t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\)\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\))/) \
+              (t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\)\{|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\(.*number(?:lines)?.*?\)|code(?:\.[a-z][0-9a-z_]+)?\{#|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\s[#])/) \
               ? true
               : false
+            if (t_o =~/^(?:code(?:\.[a-z][0-9a-z_]+)?\{#|```[ ]+code(?:\.[a-z][0-9a-z_]+)?\s[#])/)
+              puts "WARNING document using depreciated markup for numbering codeblocks\nuse: code(numberlines){ ... or: ```code(numberlines) ..."
+            end
             @num_id[:code_block] +=1
             h={
               is_for: :code,