Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand links properly when cross linking to other .md files #588

Closed
udoprog opened this issue Jan 26, 2018 · 3 comments
Closed

Expand links properly when cross linking to other .md files #588

udoprog opened this issue Jan 26, 2018 · 3 comments

Comments

@udoprog
Copy link

udoprog commented Jan 26, 2018

Hey,

It seems like mdbook doesn't translate links in chapters (like [link to chapter2](../chapter2.md)) to the resulting html file. To work around this, you have to use a link relative to the output folder, like chapter2.html`.

This breaks markdown links which are hosted on GitHub, and generally also means that a mdbook author needs to understand the topology of the generated book, instead of its sources when cross linking.

Examples:

I was not able to find an existing issue that mentioned this, but I didn't look super close. At least this should help in future searching.

@Michael-F-Bryan
Copy link
Contributor

I was not able to find an existing issue that mentioned this, but I didn't look super close. At least this should help in future searching.

I believe this is the same as #431. The idea is you should be able to link to the source file (e.g. foo.md) and then a Preprocessor will go through and rewrite the md extension to html before it gets sent to the renderer.

Now Preprocessors have landed we can make progress on implementing this properly, instead of hacking something on top of markdown-to-html rendering.

mdbook author needs to understand the topology of the generated book, instead of its sources when cross linking

The generated book is guaranteed to have the same structure as the source documents. So you should be able to use *.html instead of *.md and everything will work.

@Michael-F-Bryan
Copy link
Contributor

I think I'll close this as a duplicate of #431.

@udoprog
Copy link
Author

udoprog commented Jan 27, 2018

Ok. Thanks!

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

No branches or pull requests

2 participants