Age | Commit message (Collapse) | Author | Files |
|
|
|
|
|
|
|
* WikiTrans/wiki2html.py (HtmlTextNode): Use quote=False to make sure
same output is obtained in Python 2.7 and 3.x
* testdata/headings.html: Update
|
|
|
|
* WikiTrans/wikimarkup.py (BaseWikiMarkup.otag): Fix the P<args> named
part so that it cannot start with a slash.
|
|
* WikiTrans/wikimarkup.py (BaseWikiMarkup.tags): Add 'ref' and 'references'.
* WikiTrans/wikitoken.py (WikiTagNode): If the parser has the 'references'
attribute, store each <ref> there.
* WikiTrans/wikidump.py: Handle new tags.
* WikiTrans/wiki2html.py (HtmlTagNode): Handle new tags.
(HtmlWikiMarkup.references): New attribute
* WikiTrans/wiki2texi.py (TexiTagNode): Handle new tags.
* WikiTrans/wiki2text.py (TextTagNode): Handle new tags.
(TextWikiMarkup.showrefs): Renamed from references
(TextWikiMarkup.references): New attribute.
|
|
* bin/wikitrans (getwiki): fix downloading for Python 2.7
Return a properly encoded string.
Fix help output.
Allow to use -t dump with -I wiktionary
|
|
|
|
|
|
|
|
* WikiTrans/wiki2texi.py: Reimplement accumulator as a separate class.
|
|
|
|
|
|
* WikiTrans/wiki2html.py (HtmlTextNode): Escape html entities
* WikiTrans/wiki2text.py: Remove the format method.
* testdata/headings.html: Fix.
* testdata/nowiki-tag.html: Fix.
* tests/test.py: Rename to tests/test-html.py
* tests/test-text.py: New file.
* testdata/bold.text: New file.
* testdata/boldit1.text: New file.
* testdata/boldit2.text: New file.
* testdata/boldit3.text: New file.
* testdata/colon.text: New file.
* testdata/deflist.text: New file.
* testdata/headings.text: New file.
* testdata/hz.text: New file.
* testdata/it.text: New file.
* testdata/itbold1.text: New file.
* testdata/itbold2.text: New file.
* testdata/itbold3.text: New file.
* testdata/nowiki-ind.text: New file.
* testdata/nowiki-tag.text: New file.
* testdata/nowiki.text: New file.
* testdata/numlist.text: New file.
* testdata/para.text: New file.
* testdata/unlist.text: New file.
|
|
|
|
* WikiTrans/wiki2html.py: Use absolute import names.
* WikiTrans/wiki2texi.py: Likewise.
* WikiTrans/wiki2text.py: Likewise.
* WikiTrans/wikimarkup.py: Likewise.
* bin/wikitrans: Enforce UTF-8 for Python 2
New option --base-name.
Optionally download the material from http
|
|
* WikiTrans/wikitoken.py (parser): New attribute.
(__init__): Take three arguments. Second one is the
parser that creates this node.
(jsonEncode): Omit parser.
* WikiTrans/wikimarkup.py (__createWikiNode): Pass self
as the first argument to the constructor.
* WikiTrans/wiki2html.py: Use derived node classes.
* WikiTrans/wiki2texi.py: Likewise.
* WikiTrans/wiki2text.py: Likewise.
|
|
* WikiTrans/wikidump.py: New file.
* WikiTrans/__init__.py: Update
* WikiTrans/wiki2html.py: Minor change
* WikiTrans/wiki2texi.py: Likewise.
* WikiTrans/wikimarkup.py (BaseWikiMarkup.__createWikiNode): New
method; use it instead of invoking constructors directly throughout
the code.
(token_class): New attribute. A dictionary of token classes for each
specific node type.
* WikiTrans/wikitoken.py: Use JSON for printable representation of
nodes.
* bin/wikitrans: Update
|
|
Use dedicated classes, instead of dictionaries, to represent markup tokens
* WikiTrans/wikitoken.py: New file. Defines Wiki markup tokens.
* WikiTrans/wikimarkup.py: Rewrite.
* WikiTrans/wiki2html.py: Update.
* WikiTrans/wiki2texi.py: Update.
* WikiTrans/wiki2text.py: Update.
* bin/wikitrans: Update
|
|
* WikiTrans/wikimarkup.py (delim): Use [ \t] instead of \s.
(parse0): Undo c41c19ff.
* testdata/headings.html: Update.
* testdata/nowiki-ind.html: New file.
* testdata/nowiki-ind.wiki: New file.
* testdata/nowiki-tag.html: New file.
* testdata/nowiki-tag.wiki: New file.
* testdata/nowiki.html: New file.
* testdata/nowiki.wiki: New file.
* tests/test.py: Add new files.
|
|
* WikiTrans/wiki2texi.py (str_tag): Use the 'isblock' attribute
to decide how to render the block.
* WikiTrans/wikimarkup.py (parse_para): Parse tags.
(parse_til): Rename to parse_tag. All callers changed.
Set the 'isblock' attribute
(parse0): Call parse_para if at the beginning of the input.
|
|
|
|
* WikiTrans/wikimarkup.py (tokread): Fix recognition of <nowiki>
blocks and unhandled tags.
* tests/test.py: Minor fix.
|
|
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.
|
|
|
|
* 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.
|
|
* 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>
|
|
* wikimarkup.py (delim,otag,ctag)
(refstart): Now class attributes
|
|
* wikimarkup.py (ctag,otag): pfx group not needed anymore
(refstart): New global
(tokread): Clean up logic. Handle <</nowiki>tag> properly.
(parse_ref): Rewrite.
(parse_inline): Recover in case of unmatched delimiters
(parse_line): Handle OTAG tokens.
|
|
* 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.
|
|
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.
|
|
* 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.
|
|
|
|
* 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
|
|
|
|
* wikimarkup.py (tokenize): Handle the three possible
ambiguities in placing italic and bold markers.
Redefine unresolved markers as text.
* test.py: Add new tests.
* testdata/boldit1.wiki: Rewrite.
* testdata/boldit2.wiki: Rewrite.
* testdata/boldit3.wiki: Rewrite.
* testdata/boldit4.wiki: Remove.
* testdata/boldit5.wiki: Remove,
* testdata/bold.html: New file.
* testdata/boldit0.html: New file.
* testdata/boldit1.html: New file.
* testdata/boldit3.html: New file.
* testdata/it.html: New file.
* testdata/itbold1.html: New file.
* testdata/itbold1.wiki: New file.
* testdata/itbold2.html: New file.
* testdata/itbold2.wiki: New file.
* testdata/itbold3.html: New file.
* testdata/itbold3.wiki: New file.
* testdata/para.html: New file.
|
|
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.
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
header and any traling language links
|
|
|
|
rudimentary parsing for wiktionary templates
|
|
|
|
|
|
|
|
|