Commit graph

152 commits

Author SHA1 Message Date
Vasyl Fesik
06300d0873 rename CommonMark to commonmark 2018-09-10 14:23:08 +03:00
Eric Holscher
33b5c2a4ec
Merge pull request #115 from tswast/patch-1
Update package version to 0.5.0.dev
2018-09-07 17:24:28 +02:00
Eric Holscher
51b7f77e13
Merge pull request #113 from tk0miya/use_new_Sphinx_API
Register a parser class using new Sphinx API; add_source_suffix
2018-09-07 17:24:21 +02:00
Eric Holscher
a312543fc6
Merge pull request #111 from ttmc/patch-1
Add more metadata to setup.py for PyPI
2018-08-22 14:08:22 +02:00
Tim Swast
dbe109149e
Update package version
Clearly there have been many changes since 0.4.0. I propose the next release be 0.5.0. In the meantime, by adding a [development release separator](https://www.python.org/dev/peps/pep-0440/#development-release-separators) pip will more clearly indicate the package version for those installing via git.
2018-08-08 10:50:58 -07:00
Takeshi KOMIYA
029c649065 Register a parser class using new Sphinx API; add_source_suffix 2018-07-28 18:14:42 +09:00
Troy McConaghy
fab0218efb
Add more metadata to setup.py for PyPI
Add a description, URL and license to `setup.py` so [the recommonmark package page on PyPI](https://pypi.org/project/recommonmark/) will include that information.
2018-07-24 12:17:09 +02:00
Eric Holscher
956bf18b24
Merge pull request #102 from FireflyTeam/add-translate-section-name
Add section name translate support
2018-05-30 15:59:43 -04:00
Eric Holscher
4f6a53ac3b
Merge pull request #101 from FireflyTeam/fix-bold-link
Fix exception with link inside bold/italic
2018-05-30 15:58:52 -04:00
Eric Holscher
5f4bd644a6
Merge pull request #99 from rtfd/split-lint
Stop linting since there's a lot of errors for now.
2018-05-30 15:51:28 -04:00
Eric Holscher
0cf3a3aea3 Newer sphinx 2018-05-30 15:48:39 -04:00
djw
63f25d2a71 Add section name translate support
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.
2018-05-07 17:41:03 +08:00
djw
dd15581df1 Fix exception with link inside bold/italic
Return default line number of 0 when no sourcepos found.

Fixes #100
2018-05-07 17:24:07 +08:00
Eric Holscher
31e4cdcd4b Continue running docs 2018-04-27 09:36:51 -07:00
Eric Holscher
7e15d3823c Stop linting since there's a lot of errors for now. 2018-04-27 09:33:14 -07:00
Eric Holscher
450909bdcf
Merge pull request #91 from kbenzie/kbenzie/fix_md_links
Fix hard error on cross-linking markdown document
2018-04-27 09:15:27 -07:00
Eric Holscher
3238b029b6
Merge pull request #95 from choldgraf/patch-1
Updating autostructify links in readme
2018-02-16 14:01:44 +07:00
Chris Holdgraf
25db3cb68d
Updating autostructify links in readme
The links are hard to find, so this makes them more discoverable
2018-02-10 08:41:14 -08:00
Kenneth Benzie (Benie)
7762ab3888 Fix hard error on cross-linking markdown document
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.
2017-11-02 16:46:27 +00:00
Anthony
c410abb565 Merge pull request #63 from rtfd/commonmark-0.7.3
Update to support CommonMark >= 0.7.3 and clean up code
2017-05-03 15:30:47 -07:00
Anthony Johnson
e62f4039ea
Add missing inline code parsing 2017-03-23 14:13:47 -07:00
Anthony Johnson
bdd12f9bbc
Lint fix 2017-03-03 01:35:52 -08:00
Anthony Johnson
e30cd3f894
Fix py3 urllib call 2017-03-03 01:31:05 -08:00
Anthony Johnson
8baf238562
Fix linking, add tests, fix auto toc, deprecate and remove auto ref
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.
2017-03-03 01:20:23 -08:00
Anthony Johnson
1f7f525c7b
Port in pending_xref node changes to references
* 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.
2017-03-02 20:04:30 -08:00
Anthony Johnson
fe8e00ab41
Update to support CommonMark >= 0.7.3 and clean up code
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
2017-03-02 20:04:30 -08:00
Eric Holscher
50be4978d7 Merge pull request #61 from pfultz2/pending-xref
Use pending_xref for links
2017-03-02 14:25:43 -08:00
Paul
c64958e5e8 Add info how links are handled in the doc 2017-02-23 16:45:27 -06:00
Paul
a551eed06c Add two blank lines for pep8 2017-02-07 19:17:58 -06:00
Paul
e9bac97518 Add a reference to the XRefRole class 2017-02-07 17:09:39 -06:00
Paul Fultz II
a9459aabfa Update sphinx version 2017-02-07 13:58:31 -06:00
Eric Holscher
81d7c6f7b3 Merge pull request #58 from pfultz2/nester-header-block
Add test for header nested in a block
2016-11-01 20:29:46 -07:00
Paul
6a22f6b04b Add test for header nested in a block 2016-10-27 01:17:06 -05:00
Eric Holscher
8ae002b040 Merge pull request #53 from kindly/fix-eval-rst
Fix eval_rst so it assigns source properly
2016-08-25 09:30:17 -07:00
Eric Holscher
b70d5f5224 Merge pull request #52 from kindly/master
Change priority to highest.
2016-08-25 09:29:43 -07:00
David Raznick
71631f1e2f Fix eval_rst so it assigns source properly
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.
2016-08-25 13:35:28 +01:00
David Raznick
3b18390549 Change priority to highest.
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.
2016-08-25 13:18:11 +01:00
Eric Holscher
e81b0a0de1 Merge pull request #48 from pfultz2/master
Transform files with other endings besides .md
2016-06-28 12:50:22 -07:00
Eric Holscher
5c64c77637 Merge pull request #49 from pfultz2/hilite-bug
Fix regression with highliting
2016-06-20 13:43:09 -07:00
Paul
b6440bf2c8 Fix pep8 problems 2016-06-14 12:03:24 -05:00
Paul
ad36e4990c Add support for external links 2016-06-14 01:16:46 -05:00
Paul
c9c58bcfc9 Use pending_xref for reference nodes 2016-06-13 23:14:35 -05:00
Paul
0ff83a9091 Add tests for checking custom file extensions 2016-06-12 03:12:15 -05:00
Paul
c98a939751 Merge branch 'master' into md-files 2016-06-11 08:50:17 -05:00
Paul
0eee19e600 Add tests for checking that pygments will still highlight the code. This requires a newer version sphinx as well. 2016-06-10 21:08:31 -05:00
Paul
391bbe4e68 Remove pep8 whitespace 2016-06-06 23:56:37 -05:00
Paul
40a82ef39d Fix regression with highliting 2016-06-06 23:51:20 -05:00
Paul
74e0566dbf Transform files with other endings besides .md 2016-06-06 21:39:21 -05:00
Eric Holscher
da77951476 Merge pull request #44 from mgeier/code-blocks
Fix code blocks
2016-04-24 19:14:54 -07:00
Eric Holscher
842dde424b Merge pull request #43 from mgeier/sphinx-extension
Turn package into a Sphinx extension
2016-04-24 19:14:45 -07:00