From 930967bf4974cf45c9854159cc6e4f83d467db93 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Tue, 14 Mar 2017 18:22:41 +0100 Subject: [PATCH] gen-readme.sh: add 'known problems and limitations' section generation --- gen-readme.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gen-readme.sh b/gen-readme.sh index 217e1407..003b212f 100755 --- a/gen-readme.sh +++ b/gen-readme.sh @@ -98,22 +98,35 @@ function _gen_section_header() { esac } +function _gen_problems() { + grep 'NOTICE:' user.js | sed 's|// NOTICE: |* |g' +} + function _write_readme() { - # write the generated section to README.md (section delimited by html comments BEGIN/END SECTION) + # write generated sections to README.md (section delimited by html comments BEGIN/END SECTION) # https://stackoverflow.com/questions/21876431 echo "$README_SECTION" > whatdoesitdo.tmp.md awk ' - BEGIN {p=1} + BEGIN {p=1} /BEGIN SECTION/ {print;system("cat whatdoesitdo.tmp.md");p=0} /END SECTION/ {p=1} p' README.md > README-new.md mv README-new.md README.md rm whatdoesitdo.tmp.md - #sed --silent "/BEGIN SECTION/{:a;N;/END SECTION/!ba;N;s/.*\n${README_SECTION}\n/};p" README.md + + echo "$PROBLEMS_SECTION" > knownproblems.tmp.md + awk ' + BEGIN {p=1} + /BEGIN PROBLEMS-LIMITATIONS/ {print;system("cat knownproblems.tmp.md");p=0} + /END PROBLEMS-LIMITATIONS/ {p=1} + p' README.md > README-new.md + mv README-new.md README.md + rm knownproblems.tmp.md } ################################### README_SECTION=$(_gen_entries) +PROBLEMS_SECTION=$(_gen_problems) _write_readme