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

sphinx cross referencing in markdown cell? #89

Open
arsenovic opened this issue Jan 12, 2017 · 6 comments
Open

sphinx cross referencing in markdown cell? #89

arsenovic opened this issue Jan 12, 2017 · 6 comments
Labels

Comments

@arsenovic
Copy link
Contributor

arsenovic commented Jan 12, 2017

is there a way to use inline sphinx cross references?

like

.. currentmodule:: myPackage.myModule

This is narrative text in a markdown cell, and then i  want to link to a 
specific  :class:`MyClass` object, and keep on talking.
@mgeier
Copy link
Member

mgeier commented Jan 12, 2017

You mean in a Markdown cell in a notebook?

No, that's currently not possible. I'm planning to implement this once #36 is done (which might take a long time, probably forever).

In the meantime, you can try if it works for you to use "raw" cells: http://nbsphinx.readthedocs.io/en/latest/raw-cells.html.
In raw reST cells all Sphinx features should work.

@arsenovic
Copy link
Contributor Author

ok thanks for the info. i will keep an eye on #36 because i'd like to be able to reference classes within the markdown cells. otherwise its too cumbersome.

@arsenovic arsenovic changed the title sphinx cross referencing? sphinx cross referencing in markdown cell? Jan 14, 2017
@mgeier
Copy link
Member

mgeier commented Jan 14, 2017

You might also want to have a look at the documentation of music21. They use Jupyter notebooks with a custom converter that allows them to use Sphinx cross references.

Example docs page: http://web.mit.edu/music21/doc/usersGuide/usersGuide_03_pitches.html
Source notebook: https://github.com/cuthbertLab/music21/blob/master/music21/documentation/source/usersGuide/usersGuide_03_pitches.ipynb

@arsenovic
Copy link
Contributor Author

thats exactly what i was referring to. i would use it if it where included in this project or jupyter or sphinx (i dont know where it should go).

@mgeier
Copy link
Member

mgeier commented Jan 15, 2017

If that's doing what you need, you can just use the stuff from music21.

I don't think it makes sense to include this feature in either Jupyter or Sphinx. It makes more sense to have it in an extension, like e.g. nbsphinx!

As I said, I won't implement this before #36, but if somebody else (for example you?) implements it and makes a PR, I wouldn't have to wait for that.

@mgeier mgeier added the wishlist label Feb 8, 2017
@mgeier
Copy link
Member

mgeier commented Oct 11, 2018

@arsenovic If you still need this: In the meantime it is possible to link to your class documentation, but not (yet) with the reST syntax you are using.

Instead, you'll have to find out how the HTML anchor of your class is named and then use something like this in a Markdown cell:

[link to my class](my-api-docs.rst#mymodule.MyClass)

See https://nbsphinx.readthedocs.io/en/0.3.5/markdown-cells.html#Links-to-Domain-Objects.

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

No branches or pull requests

2 participants