-
Notifications
You must be signed in to change notification settings - Fork 119
Sphinx: use doc/ref directives for relative links #16
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
=======================================
- Coverage 96.04% 96% -0.05%
=======================================
Files 3 3
Lines 683 726 +43
=======================================
+ Hits 656 697 +41
- Misses 27 29 +2
Continue to review full report at Codecov.
|
Based on the way the tests run, I don't think it's going to be possible for me to hit the coverage required. The diff lines that aren't being covered are either 2/3 compat, or are when m2r is called outside of sphinx, which isn't being tested. |
Just ran into this problem, would be great to see this merged! |
@ryan-lane Quick question... was testing this branch and the anchor links do not appear to be working correctly. Well, they may be rendered to an rst ref as coded, but sphinx is having none of it.
The doc above generates a warning in sphinx:
The released version of m2r works fine with this kind of anchor link, so I think this would be a regression. Unless I'm doing something wrong, which is ultimately my "quick question". 😄 Is there a "correct" way to write the markdown such that sphinx will render the ref link properly? |
@lorengordon hm. that should work. I'll need to take a look. |
@lorengordon hm. that should work, but I've reproduced your issue. I'll fix that and push it in. |
What is required for this pull request to get merged? I would like to use this feature to get rid of recommonmark in my sphinx project... |
blocked on miyakogi/m2r#16
I'm sorry for late response. |
Awesome. Thanks for the merge! |
This change adds an option (m2r_parse_relative_links) that'll configure m2r to parse internal links into doc or ref directives. It uses urlparse to determine if a link is internal or not based on whether a scheme is detected. A ref is used if only an anchor is provided, otherwise the change assumes a doc is being linked to.
Change for issue #15.