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

Links to .md should translate to .html #60

Closed
fidian opened this issue Oct 20, 2012 · 7 comments
Closed

Links to .md should translate to .html #60

fidian opened this issue Oct 20, 2012 · 7 comments

Comments

@fidian
Copy link

fidian commented Oct 20, 2012

Let's say I have an index.md file and I want to point it to my FAQ page:

Go see my [FAQ](faq.md).

The problem is that this link is broken in the preview, but it can work just fine if you have a markdown-enabled browser of some sort.

I would like for the markdown version of my files to link to other markdown files and the HTML versions to link to HTML. Would you add the feature so the file extension is checked against what content plugins would parse and use the resulting file extension from after parsing?

@dashed
Copy link
Contributor

dashed commented Apr 20, 2013

Do you use an application that resolves url links targeting *.md files?

@fidian
Copy link
Author

fidian commented Apr 21, 2013

Yes, I use it for documentation on projects at work. It serves up the markdown as HTML, but since the URL contains "path/to/file.md", the *.md links work fine.

@jnordberg
Copy link
Owner

As of 2.0 you can write a generator plugin that adds the md files to the tree.

@fidian
Copy link
Author

fidian commented May 22, 2013

Can you explain what this means to me? I'm looking to write links with [some link](page.md) and have it translated into HTML as <a href="page.html">some link</a>. Your description of a generator plugin adding md files to the tree sounds like links to .md files would work, which is the flip side of what I was seeking.

Is there documentation on this somewhere?

@fidian
Copy link
Author

fidian commented May 23, 2013

Updated my above comment to escape the markdown and HTML examples. Unless your changes address this problem, I wouldn't consider this issue resolved. Can this issue be reopened? I can't do it. My only options are to create a new issue or have someone else reopen this one.

@jnordberg
Copy link
Owner

To get the url resolving you are looking for you would have to write a plugin that handles markdown and hook in to the markdown parser to get the urls so you can rewrite them. You can subclass the default markdown page plugin, it's exposed as env.plugins.MarkdownPage also check src/plugins/markdown.cofffe and src/plugins/page.cofffe

@fidian
Copy link
Author

fidian commented May 24, 2013

Thanks for pointing me in the right direction.

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

3 participants