When section name is not written in ASCII, the ID of the section will be
generated by default, in the form of 'id<unique number>'. This is no good
writing links to other document, whose ID are subject to change in adding
or removing sections.
Adding a `translate_section_name` filter in Parser will allow user to install
a customized one to translate the section name into more readable one. For
example, convert the Chinese section name to more ASCII-friendly pinyin.
Sphinx 1.6.5 with tip recommonmark hard errors when a markdown document
contains a cross-reference to another local markdown document as it
unconditionally access the `refdomain` of a `pending_xref`. This was
fixed [elsewhere](https://github.com/ignatenkobrain/sphinxcontrib-issuetracker/pull/13/files#diff-61beda6e59ec3020dbf0c2826dbb64c4R161)
by setting it to `None`. This patch uses the same approach which no
longer causes the Sphinx build to fail on cross-linking a markdown
document however the generated link is not correctly rendered producing
broken links in the generated html.
Addressing the broken links, the `mdnode.destination` is stripped of its
file extension if that extension is supported by `CommonMarkParser`
however this will only work for markdown documents, not ReStructuedText
or any other extended file type parsers.
Fixes#89.
This fixes link nesting, and resolves some issues around links not closing
correctly. There were a few changes required to support the autotoc feature, and
the auto ref feature has be deprecated. This feature no longer is required, as
we are doing pending_xref natively. The functionality was breaking Sphinx
altogether, so it doesn't make sense to keep it and deprecate the feature.
* Moves changes from #61 into this PR
* Drops basic testing from #61
* Adds to implementation pending_xref back down to reference
The implementation in #61 breaks a number of cases, like "/example" and
"example.html", etc. Instead of trying to enumerate case we want an xref instead
of a pending_xref, just pin the xref on the pending_xref to back down.
pending_xref replaces itself with it's children if the reference isn't resolved.
This was already dealing with a rewrite due to the spec change on CommonMark, so
I took the opportunity to modernize the code and clean things up as well.
* Updates to support CommonMark==0.7.3
* Reworks pattern for handling CommonMark nodes, mimic docutils visit/depart
pattern
* Drops SectionHandler class, as it was only used in one place. Merge into the
parser class, where it is used
* Drops requirements file for setup.py config, as this is a package requirements
is superfluous
* Adds a number of more detailed test cases
* Adds test runner for 3.5, 3.6
* Updates strictness on prospector, cleans up linting errors and docstring
problems
At the moment it is passing source as node.rawsource. This is always
going to be the empty string as it is getting it from a newly created
node.
This patch saves a reference to the original node and parses down the
correct source. This patch along with #52 means that eval_rst blocks will
internationalize correctly fixing [#47]. Sphinx will not translate
nodes with a blank source.
Currently the priority for the Autostructify is set to 1000. I think it
was the intention to set it so that it runs before any other transforms.
However the ordering in docutils is confusing and setting it to 1
actually means it will be run first.
This was causing a problem for i18n in sphinx as it would not translate
anything in ```eval_rst`` blocks or ``` directive:: ``` blocks as these were
not converted to the node tree before gettext was meant to translate
them.