Generic tool to redact markdown files.
Will look for files named SOLUTION.md in a target directory and any of it's sub-directories OR target file, parse the file(s), remove blocks wrapped in tags, and create a new markdown file in the same location as the source SOLUTION.md file with the name README.md.
In the target file, wrap a block of markdown in commented tags:
Some text
<!-- $SOLUTION_START -->
Markdown text that you want to remove from `SOLUTION.md`
<!-- $SOLUTION_END -->
Some more text
Use the tool with:
redact solution path/to/directory/or
redact solution path/to/SOLUTION.mdEnforces some quality checks. Will throw an error if a check fails:
- Tags must alternate: start, end, start, end, etc...
- The line immediately after a
starttag must have the same indentation as thestarttag. TODO: this should be the next line with text on it. - An
endtag must have the same identation level as it's precedingstarttag. - There can be no orphan tags: for every
starttag, there must be anendtag.
Unoptimised, inflexible, uncustomisable, and written in a hurry.