summaryrefslogtreecommitdiff
path: root/wiki2html.py
AgeCommit message (Collapse)AuthorFiles
2015-07-16Restructure the package.Sergey Poznyakoff1
The idea is to switch from using this project as a git submodule to having it distributed via PyPI. Since the name 'wit' is already registered there, the package is renamed to 'wikitrans'. * setup.py: Use setuptools Rename package to wikitrans. * wikicvt.py: Remove. Replaced with: * bin/wikitrans: New file. * __init__.py: Move to WikiTrans/__init__.py * wiki2html.py: Move to WikiTrans/wiki2html.py * wiki2texi.py: Move to WikiTrans/wiki2texi.py * wiki2text.py: Move to WikiTrans/wiki2text.py * wikimarkup.py: Move to WikiTrans/wikimarkup.py * wikins.py: Move to WikiTrans/wikins.py * test.py: Move to tests/test.py * MANIFEST.in: New file. * README.rst: New file. * .gitignore: Update.
2015-07-16Support for Python 3Sergey Poznyakoff1
* wiki2html.py: Import urllib.parse if importing urllib fails. Use list comprehensions to build lists from maps. * wiki2texi.py: Use 'in' instead of has_key. Use list comprehensions to build lists from maps. * wiki2text.py: Likewise. * wikicvt.py: Use print function. Import StringIO from io if unable to import is as a module * wikimarkup.py: Use print function. Fix some UTF strings.
2015-07-15Parse tag attributesSergey Poznyakoff1
* wikimarkup.py (TagAttributes) (TagAttributeSyntax): New classes. (BaseWikiMarkup): Store a TagAttributes object in tag['args'] of an XML tag. * wiki2html.py (str_tag): convert tag['args'] to string * wiki2text.py: Likewise. * wiki2texi.py (str_tag): Handle <div>
2015-07-15Fix parsing of <nowiki> blocks.Sergey Poznyakoff1
* wikimarkup.py (tokread): Catch the </nowiki> tag appearing on the same line with the opening <nowiki>. Never return nowiki block as a tag, instead yield a sequence of TEXT nodes. * wiki2html.py (str_tag): Update. * wiki2texi.py: Likewise. * wiki2text.py: Likewise.
2015-07-14Fix processing of environments (numbered/unnumbered lists, definition lists) ↵Sergey Poznyakoff1
and indented strings. * wikimarkup.py (tokread): Always add 'continuation' key to DELIM entries. Delete whitespace following environment delimiters. (peektkn): Take an optional offset argument. (parse0): Handle indentations. * wiki2html.py (str_ind): Use <dl> to produce indentations. * wiki2texi.py (str_ind): End text with a newline. * testdata/colon.html: Update. * testdata/deflist.html: Update. * testdata/numlist.html: Update. * testdata/unlist.html: Update.
2015-07-12Improve tag handling and debuggingSergey Poznyakoff1
* wikimarkup.py: Rewrite tag recognition. Implement dump method. * wikicvt.py: New options -D (--dump), and -t dump * wiki2html.py (input_tag): Remove method (str_tag): Change handling of tags * wiki2texi.py: Likewise. * wiki2text.py: Likewise.
2015-07-07Remove unnecessary debug printSergey Poznyakoff1
2015-07-07Initial implementation of Texinfo translator classSergey Poznyakoff1
* wiki2html.py (str_pre): Don't add <pre> tags if nested * wiki2texi.py: New file. * wikicvt.py: Add --type (--to, -t) and --input-type (-I) options. * wikimarkup.py (BaseWikiMarkup): Use new object style. (tokread): Remove 'extra' keyword for the sake of parse_env
2015-07-07Update copyright yearsSergey Poznyakoff1
2015-07-06Handle <tags> and implicit preformatted blocksSergey Poznyakoff1
Among <tags>, this commit handles <nowiki> and <code>. General tag handling mechanism is provided. * wikimarkup.py (otag, ctag, close_delim): New variables. (BaseWikiMarkup)<newline,nested>: New attributes. (otag, ctag, close_delim): New variables. (newline,nested>: New attributes. (input_tag): New abstract method. (tokread): Remove calls to dprint, now done by the callers. Handle xml-style tags. (getkn,ungetkn): Set newline. (inline_delims): Add '|' (parse_para): Decide whether it is going to be a PRE or PARA. Don't mix the two. Fix recovery in case of unmatched/incorrect inline constructs. (parse): eliminate initial PARA, if called as a nested instance. (WikiMarkup): Remove parse method. Rely on the parent class. * wiki2html.py (input_tag, str_tag, str_pre): New methods. (format): Handle PRE and TAG tokens * wiki2text.py: Similar changes. Needs some more work.
2015-07-06Redo parse tree as a sequence of dictionaries, instead of arrays.Sergey Poznyakoff1
2015-07-05Fix most testcases.Sergey Poznyakoff1
* wikimarkup.py (envtypes): Redo as a dictionary. (ELT): New item type (BaseWikiMarkup): Fix list parsing. (parse): Comment out changes introduced by 9c42879. Must be rewritten. * wiki2html.py (HtmlWikiMarkup): Change handling of lists. * wiki2text.py: Likewise. * testdata/deflist.wiki: New testcase. * testdata/deflist.html: Likewise. * testdata/colon.html: Update. * testdata/headings.html: Update. * testdata/hz.html: Update. * testdata/numlist.html: Update. * testdata/unlist.html: Update.
2009-03-08Another buch of dirty kludgesSergey Poznyakoff1
2009-03-07Remove disambiguiations and graphics. Remove everything before the first ↵Sergey Poznyakoff1
header and any traling language links
2009-03-06Lots of formatting kludgesSergey Poznyakoff1
2009-03-05Avoid losing newlines while parsing the input stream. Provide some ↵Sergey Poznyakoff1
rudimentary parsing for wiktionary templates
2009-03-03Quick & dirty fixSergey Poznyakoff1
2009-03-03Implement conversion to HTMLSergey Poznyakoff1
2008-11-29Image rendering change.Wojciech Polak1
2008-11-29Improve text output generationSergey Poznyakoff1
* wiki2html.py (mktgt): Add 3rd argument. All callers updated. * wiki2text.py (wiki_ns_name,mktgt): New functions (str_link,str_tmpl): Rewrite * wikicvt.py: New argument --input-text (not used yet)
2008-11-29Add slash to html_base explicitely.Wojciech Polak1
2008-11-27* wiki2html.py: Fix broken continuation after bold and it.Sergey Poznyakoff1
2008-11-26Fix HTML generation.Sergey Poznyakoff1
* wikins.py: New file (automatically generated.) * build-aux/extrns.php: New file (generator for the above). * wiki2html.py (HtmlWikiMarkup.image_kw, target): Remove (wiki_ns_name,link,mktgt): New methods. (str_link,str_tmpl): Rewrite using self.link. * wiki2text.py, wikimarkup.py (__init__): Fix handling of multiple keywords.
2008-11-26Implement paragraphsSergey Poznyakoff1
2008-11-26Implement plain text conversion.Sergey Poznyakoff1
* wiki2html.py (HtmlWikiMarkup): Move lang, html_base, image_base, media_base, langtab, str_nil, str_text, fmtok, __str__ to WikiMarkup * wikimarkup.py: See above. * wiki2plain.py: Remove. * wiki2text.py: New file (instead of the above) * wikicvt.py: Implement new options.
2008-11-26Initial commitSergey Poznyakoff1

Return to:

Send suggestions and report system problems to the System administrator.