-
Notifications
You must be signed in to change notification settings - Fork 254
Add support for cross-referencing #8
Comments
I'd like to implement this as generic syntax, as discussed here: We had a basic implementation of it on a previous branch, but there are On Wed, Aug 12, 2015 at 3:25 PM, Sidharth Kapur notifications@github.com
Eric Holscher |
This is supported already by auto structify component, see http://recommonmark.readthedocs.org/en/latest/auto_structify.html#auto-doc-ref |
In the parser, if we add the reference nodes as |
Ok, so I updated the parser to use For links that use Once the pull request is merged into sphinx, I can send a pull request for this as well(although sphinx has yet to respond to my pull request). |
I just converted a Jekyll site written with Markdown to Sphinx and kept files in
Hope that helps anyone else who stumbles upon here, and is trying to get their Markdown cross-referencing to work. |
What I'm having trouble doing is linking from an RST file to a markdown file. Anyone able to do this? |
AutoStructify doesn't seem able to link to an anchor in the target page. Works:
Doesn't work:
If that is supposed to work, anyone know the magic incantation (syntax)? |
Its probably better to have sphinx resolve the links by having recommonmark generate a |
@pfultz2 looks like your pull request was merged into sphinx and released in v1.5. Perhaps open a pull request to merge your |
Got it, I sent PR #61 to update this. |
Thanks Mizzao for your working example.
No links are produced in the HTML output My expectation is to write
I'm not able to obtain a working link to By the way,
In the function Any idea? |
@redihokuto Try installing my fork instead with |
@pfultz2 Thanks a ton! Exactly what I wanted (be treated as |
@pfultz2
The same for refrence links: |
That makes sense. I'll try to update it. |
@pfultz2 |
Hi, I couldn't make the referencing work correctly.
I made an extension to Sphinx, which collects information about local links and then just reconstructs the links according to what I need. The code is Open Source. It might be naïve, but it works for me. As a bonus, if the local reference (including anchors) doesn't exist, my extension breaks the build. Ideally, my work wouldn't be necessary at all - I'd love to have this somehow incorporated in recommonmark. Would the recommonmark project be interested in something like this? I'm happy to contribute, to rewrite it into sth more robust, but I need to know it would be desired and I need guidance. Also, if anyone wants to use that code themselves or get inspired by it, here you are. |
@ maintainers: may I ask what the state is regarding the Is there some decision on whether this will be fixed/implemented, or is there another recommended style that works? (that would be odd though, pretty sure that's the most common one) Or is the official recommendation to use @honzajavorek 's extension? It would be neat to know if this will be made to work because for documents also written to work on GitHub, this is the expected way to link to sub sections inside documents |
Not a maintainer, but I found that for linking to sections within files the easiest way to do it is to use For linking to files themselves you can use the path/to/file.md: # Page Title
## Section Heading in Page To link to the page you'd do There is one issue with this right now, see #165 |
…-majax DONTBUILD The link `GC and CC logs </performance/memory/gc_and_cc_logs.html>`_ is different because it is a markdown page and we cannot cross reference them (I KNOW). See: readthedocs/recommonmark#8 Differential Revision: https://phabricator.services.mozilla.com/D127117
…-majax DONTBUILD The link `GC and CC logs </performance/memory/gc_and_cc_logs.html>`_ is different because it is a markdown page and we cannot cross reference them (I KNOW). See: readthedocs/recommonmark#8 Differential Revision: https://phabricator.services.mozilla.com/D127117
It would be nice to have something like http://sphinx-doc.org/markup/inline.html
In rST you can do
rST supports other directives as well, but I think referencing documents is the most important.
Github Wiki supports something like this with the Mediawiki syntax: (see https://help.github.com/articles/adding-links-to-wikis/)
I'm not a huge fan of this syntax. I think the syntax should be more similar to the ordinary markdown link syntax. Maybe something like:
(here we assume that any link beginning with
/
is a cross-reference to another page in the Sphinx directory, relative to the source directory. In sphinx, a link starting with/
is considered a path from the root.)Does something like this seem like a good idea? In general, adding syntax rules to Markdown is frowned upon, but this one might be worth it. I can't see how you could make an entire readthedocs site in markdown with using relative references.
The text was updated successfully, but these errors were encountered: