Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Markdown file, with links to other markdown files: how to make these links work? #108

Closed
aborruso opened this issue Jul 8, 2018 · 4 comments

Comments

@aborruso
Copy link

aborruso commented Jul 8, 2018

Hi,
I'm building a RTD manual markdown based. Than first of all thank you for recommonmark!

I have a lot of md files, with this kind of links [my text](myfile.md).

But when I compile my RTD project, these link remain linked to the md files. I have in example <a href="myfile.md">my text</a> and not <a href="myfile.html">my text</a>.

Do I must change [my text](myfile.md) in [my text](myfile.html)? Is it the only way to use links to other markdown files in the repo?

Thank you

@aborruso aborruso changed the title File markdown, with links to other markdown files: how to make these links work= Markdown file, with links to other markdown files: how to make these links work= Jul 8, 2018
@aborruso aborruso changed the title Markdown file, with links to other markdown files: how to make these links work= Markdown file, with links to other markdown files: how to make these links work? Jul 8, 2018
@pfultz2
Copy link
Contributor

pfultz2 commented Jul 9, 2018

The links(which are not urls) in markdown are resolved by sphinx :any: role, which lets you reference :doc::

Link to the specified document; the document name can be specified in absolute or relative fashion. For example, if the reference :doc:parrot occurs in the document sketches/index, then the link refers to sketches/parrot. If the reference is :doc:/people or :doc:../people, the link refers to people.

If no explicit link text is given (like usual: :doc:Monty Python members </people>), the link caption will be the title of the given document.

@aborruso
Copy link
Author

aborruso commented Jul 9, 2018

Hi @pfultz2 it's the first time I'm using sphinx, than I have a stupid question: in a markdown file, how do I must write links to other markdown files?

In this way [Link text](:doc:/myMDfile)?

Thank you

@pfultz2
Copy link
Contributor

pfultz2 commented Jul 9, 2018

There is no need to put the role. It should just be [Link text](/myMDfile) or the relative path with [Link text](myMDfile).

@aborruso
Copy link
Author

aborruso commented Jul 9, 2018

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants