mediawiki-parser
mediawiki-parser copied to clipboard
Add a command line
Instead of copying the wikitext in wikitext.txt
, running python parser.py
and reading article.htm
, one should be able to provide the file he/she wants and pass some parameters to the parser and get the result directly in the console to redirect it where he/she wants.
We can expect something like that: <project_name> -format html -allowed_tags b;i;center -allow_autoclose_tags br;hr -templates templates file.wiki
Where templates
would be a directory containing the called templates in text files.
It should also be possible to store the allowed tags in a configuration file, as well as the correspondence between the interwiki prefixes and the foreign wiki URLs.
argparse already has conventions for multiply-valued flags, so we should look at those first and see if they're too verbose.