Links in Markdown¶

By default, if your ReST documents has internal links, then generated Markdown output like the Notebook files or the Python code files drop these links, replacing them with some suitable text.

Internal links can be internal to the document, via the :ref: role, or to other ReST pages, using the :doc: role. Links can also be to files to download, such as conf.py.

It’s often the case that you have built HTTP pages on the web somewhere, so it would make sense for the built Markdown to point to the HTTP versions of these links, rather than dropping them.

You can tell nb2plots where your built HTTP docs are, by setting the markdown_http_base value in your conf.py file, like this:

markdown_http_base = 'https://example.com'

If you set this value to any string other than the empty string, the Markdown builders will use this base URL to resolve internal links.

In fact, I’ve set that option in the conf.py for this project, like this:

markdown_http_base = 'https://matthew-brett.github.io/nb2plots'

Have a look at the generated Python code and Notebook code for this page, via the links below. You should see that the Markdown links resolve to the HTTP pages at https://matthew-brett.github.io/nb2plots.

  • Download this page as a Python code file;
  • Download this page as a Jupyter notebook (no outputs);
  • Download this page as a Jupyter notebook (with outputs).

Related Topics

  • Documentation overview
    • Previous: Using the code-links directive
    • Next: Improving the ReST to Markdown conversion

This Page

  • Show Source

Quick search

©2016-2018, Matthew Brett. | Powered by Sphinx 1.6.3 & Alabaster 0.7.10 | Page source