Commit graph

199 commits

Author SHA1 Message Date
Valentin Boettcher
55ac935fb1 fix inline math 2019-08-27 13:58:59 +02:00
d067e096ef Add cross-reference labeling.
hide label text
2019-08-22 17:28:00 +02:00
Eric Holscher
ddd56e7717
Merge pull request #171 from readthedocs/fix-doc-builds
Disable math on builds to fix doc building
2019-08-09 11:42:28 -07:00
Eric Holscher
9868c77bd8 Small change 2019-08-09 11:38:52 -07:00
Eric Holscher
5a14811519 Disable math on builds to fix doc building 2019-08-09 11:37:09 -07:00
Eric Holscher
48f9d1a684
Merge pull request #170 from readthedocs/release/0.6.0
Setup release 0.6.0
2019-08-09 11:31:46 -07:00
Eric Holscher
cdd25e33f3 Add node_modules to gitignore 2019-08-09 11:30:59 -07:00
Eric Holscher
7577703567 Small cleanup 2019-08-09 11:30:18 -07:00
Eric Holscher
be6126ee3a Merge branch 'master' of github.com:rtfd/recommonmark into release/0.6.0 2019-08-09 11:20:11 -07:00
Eric Holscher
c4d575bd7b
Merge pull request #160 from tbeadle/auto_toc_maxdepth
Allow the Auto TOC maxdepth to be configurable.
2019-08-09 11:19:49 -07:00
Eric Holscher
04580aeb19
Merge pull request #166 from gibfahn/allow_overwriting_link_schemes
Add `accepted_url_schemes` option to allow toplevel refs
2019-08-09 11:18:54 -07:00
Eric Holscher
ce750519a3 Setup release 0.6.0 2019-08-09 11:16:58 -07:00
Eric Holscher
59dcaaab84
Merge pull request #162 from RaptorCZ/master
Process linebreaks and convert them to br element.
2019-08-09 11:08:55 -07:00
Gibson Fahnestock
0e96d97ef0
Add known_url_schemes option to allow toplevel refs
Fixes: https://github.com/readthedocs/recommonmark/issues/165
2019-07-29 11:40:21 +01:00
Raptor
357a732caf Process linebreaks and convert them to br element. 2019-06-30 13:44:30 +02:00
René Spišák
cbcfbff243
Merge pull request #1 from readthedocs/master
sync
2019-06-30 13:08:10 +02:00
Tommy Beadle
4bd0eab865 Allow the Auto TOC maxdepth to be configurable.
This adds the 'auto_toc_maxdepth' config option (defaults to 1) that
will set the max depth for the auto-generated table of contents.
2019-06-21 15:12:08 -04:00
Eric Holscher
98200fc475
Merge pull request #149 from annegentle/patch-1
Clarify the specifics of Auto Toc Tree
2019-06-14 07:09:05 -07:00
Eric Holscher
f748692b1d
Merge pull request #158 from gibfahn/fix_refs_with_spaces
Remove URL quoting from refs before passing to Sphinx
2019-06-14 07:08:35 -07:00
Eric Holscher
e23e30c5cf
Merge pull request #150 from dandersson/change-image-transformation
Use image description text as "alt", drop title
2019-06-05 15:59:01 -07:00
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
Daniel Andersson
6e1f4abba0 Handle quotes in alt texts
A bit of a brute force solution, but the parser splits the attribute
upon encountering a quote into multiple nodes. Walk through them,
collect strings and drop them from further parsing.
2019-04-07 00:17:16 +02:00
Daniel Andersson
816fc608e6 Add test cases for quotes in alt texts 2019-04-07 00:16:58 +02:00
Daniel Andersson
059e95d6f3 Use image description text as "alt", drop title
The current RecommonMark specification on images [0] says that:

    ![foo](/url "title")

should render as

    <p><img src="/url" alt="foo" title="title" /></p>

which means that "foo" should be the `alt` attribute, and "title" should
be the `title` attribute.

Currently, `recommonmark` will:

1. set the `alt` attribute to "title"
2. render "foo" as literal text following the image element.

Neither yields results in line with the RecommonMark standard, resulting
in the following when transformed to HTML:

    <p><img src="/url" alt="title" />foo</p>

While it might be surprising that `alt` is set to "title", the more
pressing issue is how the alt text becomes literal text within the
paragraph, typically not rendering well.

This commit instead makes `recommonmark`:

1. set the `alt` attribute to "foo"
2. drop "title" altogether since the `title` attribute is not supported
   in Docutils [1].

1 coincides with the specification, and 2 is in my mind the least
surprising solution within the capabilities of Docutils. The HTML will
now be:

    <p><img src="/url" alt="foo" /></p>

only differing in the missing `title` attribute when compared to the
specification.

[0]: https://spec.commonmark.org/0.28/#images
[1]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#image
2019-04-06 12:56:27 +02:00
Anne Gentle
4ad6e66e94
Clarify the specifics of Auto Toc Tree
Removes a double-up-on-the-verb situation.
2019-04-04 08:34:14 -05: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