0

My RST directory looks like this:

.
|-- Makefile
|-- build
|   |-- doctrees
|   `-- html
|       |-- codecov          <-- Generated by coverage.py
|          |-- index.html
|       | ....               <-- Generated by Sphinx
|-- make.bat
`-- source
    |-- _static
    |-- changelog.rst
    |-- conf.py
    |-- contact.rst
    |-- getting_started.rst
    |-- index.rst
    `-- introduction.rst

In my index.rst, I would like to create a relative link titled Code Coverage that points to codecov/index.html. I am not sure how to do that because it is outside my source folder. The 'codecov' folder is auto generated when I run code coverage in python. How to accomplish this?

.. toctree::
   :caption: Table of Contents
   :maxdepth: 2

   introduction
   getting_started
   changelog
   contact


Indices and tables
==================

* :ref:`genindex`
* :ref:`search`
bad_coder
  • 11,289
  • 20
  • 44
  • 72
user4979733
  • 3,181
  • 4
  • 26
  • 41

1 Answers1

2

You have at least two options.

  1. Use an external link.
`Code Coverage <../_build/codecov/index.html>`_
  1. Put this in a toctree directive.
.. toctree::

    Code Coverage <https://www.example.com/_build/codecov/index.html>

There may be other options, but let's see if either satisfies your need.

Steve Piercy
  • 13,693
  • 1
  • 44
  • 57