X-Git-Url: https://pere.pagekite.me/gitweb/text-madewithcc.git/blobdiff_plain/9e01e4518fe2e2840b7d90db1c21aa131dd306d5..bbfc718440e3a3fbcef978b0b2c11bbe93cfc7ea:/fixup.rb diff --git a/fixup.rb b/fixup.rb index 41e317d..17bf82b 100644 --- a/fixup.rb +++ b/fixup.rb @@ -271,5 +271,32 @@ data.each_with_index do |lin, idx| end end +log 0, 'Turn indented block after use cases into block quotes' +inscope=false +quote=false +data.each_with_index do |lin, idx| + if quote + lin.sub!(/^/, "> ") + end + if lin =~ /^> Profile written by/ + quote=false + end + # To this heading + if lin =~ /^## Bibliography/ + inscope=false + end + # From this heading + if lin =~ /^## Arduino/ + inscope=true + end + if inscope and lin =~ /^## / + quote=true + next + end +end + +log 0, 'emphesize keywords' +data.map {|lin| lin.gsub!(/^(>\s*)(Revenue model|Interview date|Interviewees?):/, '\\1**\\2**:')} + log 0, 'Writing processed file' File.open(dstfile, 'w') {|f| f.puts data.join("\n")}