1

I have autogenerated API docs at the top of my docs directory and a notebook in the notebooks subdirectory like this:

/src
  /mypkg
    -- modname.py
/docs
  -- index.rst  # includes mynotebook.ipyx
  -- mypkg.mymod.rst  # autogenerated
  /notebooks
    -- mynotebook.ipyx

In sphinx a reference to modname might look like this:

See also the :py:mod:`mypkg.modname` documentation.

My question is: how can I make a reference inside the notebook that links back to API docs for the module?

I am aware of this question which seemingly addressed the question with this syntax:

[link text](mypkg.mymod.rst#mymod.modname)

In my case, this just returns a "file is not found". I've tried adding ..

How do I this?

Eli S
  • 1,379
  • 4
  • 14
  • 35
  • I havte the same question. Here is the relevant documentation page, but I could not find the clear answer: https://nbsphinx.readthedocs.io/en/0.8.9/a-normal-rst-file.html – Mikko Ohtamaa Jun 09 '22 at 11:24
  • 1
    Thanks. I agree this seems like the right section, and the references from sphinx to the notebook seem to work well and are understandable. The reverse -- reference in jupyter to the module documentation in sphinx -- isn't covered in an obvious way. – Eli S Jun 09 '22 at 19:10
  • 1
    When you build the docs, what is the anchored link to your `modname`? You need to include the package, module, and class or function, not just the class or function. – Steve Piercy Jun 10 '22 at 06:37
  • 1
    Great point. I edited and changed the outer use of "mod" to "pkg" to reflect this. However, it was a nomenclature mistake. It is still anchored on mypkg. – Eli S Jun 10 '22 at 16:01

0 Answers0