Commit graph

175 commits

Author SHA1 Message Date
Gibson Fahnestock
ec0ada952d
Remove URL quoting from refs before passing to Sphinx
Sphinx allows refs with spaces etc, and in fact autogenerates them with
the command [`autosectionlabel`][].

So if you put a:

```markdown
[Link 1](<some ref>)
[Link 2](<https://foo.com/bar baz>)
```

Then the links will be `some%20ref` and `https://foo.com/bar%20baz`.

We want to keep the URL quoting for external references, but if we're
passing it as `:any:` to Sphinx we need to unquote so Sphinx can find
the correct reference, the `<some ref>` should map to:

```rst
:ref:`some ref`
```

[`autosectionlabel`](https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html)

Fixes: https://github.com/rtfd/recommonmark/issues/155
2019-05-23 16:01:37 +02:00
Eric Holscher
815d75ea50
Merge pull request #147 from loganrosen/patch-1
Bump dependency on commonmark to >= 0.8.1
2019-03-19 10:01:00 -03:00
Logan Rosen
150311c844
Bump dependency on commonmark to >= 0.8.1
In #118, there was a change made to rename all commonmark imports from `commonmark` to `CommonMark` due to a breaking change to the package name in that dependency in version 0.8.1. However, the dependency on `commonmark` wasn't updated, which means that people pulling in commonmark >= 0.7.3 and < 0.8.1 are experiencing issues while using recommonmark. This updates the versioned dependency accordingly to resolve this issue.
2019-03-18 20:52:17 -04:00
Eric Holscher
7d7d5d0b88
Merge pull request #140 from codejamninja/codejamninja/gitignore
Use official gitignore template
2019-02-22 10:49:57 -03:00
Eric Holscher
caeff7e9b5
Update .gitignore 2019-02-22 10:49:50 -03:00
Jam Risser
25019a4810 Use official gitignore template 2019-02-04 14:27:11 -06:00
Eric Holscher
589d25994a
Merge pull request #128 from dotlambda/patch-1
Include all test files in PyPI tarball
2019-01-14 09:59:13 -05:00
Robert Schütz
8e02e8309a
Include all test files in PyPI tarball 2019-01-14 14:52:21 +01:00
Eric Holscher
f79c2bf616 Release 0.5 2019-01-08 16:45:59 -05:00
Eric Holscher
eebb02c77a
Merge pull request #126 from molpako/fix-contents-directive
Fix contents directive
2019-01-02 19:27:06 -05:00
molpako
e53321e713 add a last line 2018-12-31 19:43:40 +09:00
molpako
34f3352135 add test 2018-12-31 19:38:28 +09:00
molpako
0183db8365 fix contents directive 2018-12-19 15:47:08 +09:00
Eric Holscher
fdeeda5f6f
Merge pull request #125 from rtfd/update-tox
Run travis against multiple sphinx versions
2018-10-12 13:55:47 +02:00
Eric Holscher
72563901b7 Run against latest for lint/docs 2018-10-12 11:42:45 +02:00
Eric Holscher
fe2974f127 Attempt to fix tox ini 2018-10-12 11:30:22 +02:00
Eric Holscher
0440308592 Run travis against multiple sphinx versions 2018-10-12 10:54:50 +02:00
Eric Holscher
a0afe7d383
Merge pull request #123 from rtfd/fix-docs-urls
Fix TOCTree not linking properly
2018-10-11 16:54:42 +02:00
Eric Holscher
32255dc308 Fix TOCTree not linking properly 2018-10-11 16:46:28 +02:00
Eric Holscher
298caf6462
Merge pull request #122 from Anntoin/master
Add visit_html_block
2018-10-09 16:58:15 +02:00
Anntoin Wilkinson
be55a6de90 Add visit_html_block
Without this any html_block nodes processed by the parser are dropped.
`visit_html_block` uses the existing logic for `visit_html_inline`.

Added a test case to check html_blocks are parsed as expected.

Fixes: https://github.com/rtfd/recommonmark/issues/121
2018-10-08 20:17:02 +01:00
Eric Holscher
9c15d32547
Merge pull request #118 from vvfesik/master
rename `CommonMark` to `commonmark`
2018-10-06 17:55:56 +02:00
Vasyl Fesik
a38bac33b7 rename CommonMark to commonmark in tests 2018-09-17 16:16:57 +03:00
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