FreedomBox/doc/scripts/test-wikiparser
James Valleroy 5b0335a2fa
doc: Add moinmoin wiki parser
- Handle internal links
- Handle includes
- Handle generic categories and includes
- Handle embedded links
- Handle lists
- Handle admonitions and code blocks
- Generate docbook from wiki
- Use argparse
- Generate <itemizedlist> for lists
- Generate docbook article for testing
- Escape content strings
- Create nested <section>s for headings
- Handle links with empty text
- Generate comments as <remark> within <para>
- Add space at end of paragraph
- Ignore Category when generating
- Generate comment for horizontal rule
- Add missing structure to tables
- Don't generate End Include
- Handle Includes
- Handle BEGIN_INCLUDE
- Process begin and end markers when including file
- Handle embedded attachments
- Add a helper script to test all pages
- Generate docbook for admonitions
- Fix include context
- Don't generate for table of contents
- Ignore lines starting with ##
- Ignore space in comparison test
- Use <para> around listitem content
- Wrap code text in <screen>
- Only split plain text for double underscore
- Generate warning for smaller text
- Handle relative links to wiki
- Fix handling of recursive includes
- Parse URLs out of text
- Handle image attachment parameters
- Use SPDX license identifier
- Handle height property for images
- Strip whitespace when using startswith
- Add cols property to tgroup
- Handle spaces at start and end of multi-line CodeText
- Fix page names
- Make consistent in generating <para>s
- Rewrite list handling to support nested lists properly
- Handle embedded attachments inside links
- Handle links within emphasis
- Handle wiki links to InstallingDebianOn/
- Handle line breaks
- Use paragraphs in Admonitions.
- Handle Anchors
- Don't escape code text
- Fix stopping paragraph when list begins
- Fix characters dropped after PlainText
- Fix finding http and https links in text
- Ignore example URLs containing < or >
- Pass context to every call of to_docbook()
- Render CodeText in paragraph as simply <code>
- Ensure only tablestyle is removed from table cells
- Handle line breaks within table cells
- Handle text alignment style within table cell
- Only split plain text for double brace or double bracket
- Ignore lines with only whitespace for paragraphs
- Make tests verbose if no input files givena

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-08-28 12:08:58 -04:00

10 lines
304 B
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-or-later
for var in "$@"
do
gen=$(python3 scripts/wikiparser.py "$var" | xmllint --format -)
orig=$(sed 's/<revhistory>.*<\/revhistory>//g' "${var//.wiki/.xml}" | xmllint --format -)
diff --ignore-all-space <(echo "$gen") <(echo "$orig")
done