sphinx-contrib / matlabdomain

A Sphinx extension for documenting Matlab code
http://sphinxcontrib-matlabdomain.readthedocs.io/
Other
70 stars 45 forks source link

incompatibility with numref ? #46

Closed joeced closed 6 years ago

joeced commented 9 years ago

Originally reported by: Françoise Pinsard (Bitbucket: pinsardfr, GitHub: pinsardfr)


Hi

Using Sphinx 1.3.1, when I add 'sphinxcontrib.matlab' to extension in a conf.py where numfig = True, I have the message

ERROR: Unknown interpreted text role "numref".

I installed sphinxcontrib-matlabdomain (0.2.7) using pip.

numref has been added in 1.3 see http://sphinx-doc.org/markup/inline.html?highlight=numref

My primary_domain is now the default one (:py:) and my next version will be "None" because I will mix python and matlab documentation

Regards


joeced commented 7 years ago

Original comment by Mark Mikofski (Bitbucket: bwanamarko, GitHub: Unknown):


cc7a4124aa72f75e6859ae8f8aa89d128ca250c9

joeced commented 7 years ago

Original comment by Mark Mikofski (Bitbucket: bwanamarko, GitHub: Unknown):


I've removed the standard domain, so I think that should resolve this issue - reopen if not

joeced commented 9 years ago

Original comment by Mark Mikofski (Bitbucket: bwanamarko, GitHub: Unknown):


@pinsardfr well, since I may not get to this for awhile, then they answer may be to comment out L715 in matlab.py where it overrides the standard domain. The only reason the std domain is overridden is because it used to duplicate the links in the navigation. IE There is always a Python modules link, even if you had none, so you would see both MATLAB modules and Python modules links in the navbar. It was annoying so I just nixed the std domain to get rid of the py:modules. Commenting out that line forces matlab domain to use the std domain in whatever version of Sphinx you have. Try it and let me know what happens and maybe we can make the change permanent.

joeced commented 9 years ago

Original comment by Françoise Pinsard (Bitbucket: pinsardfr, GitHub: pinsardfr):


I never went so far inside the code ... learn many things.

What I understand is that there is a shift between sphinx and sphinxcontrib roles definitions because you create your extension a long time ago.

so until both share the same sets of role we won't be able to use your contribution if I want to keep :numref:.

I did not manage to patch on my platform so I am far from being able to send a pull request...

Sorry for not being more helpful

joeced commented 9 years ago

Original comment by Mark Mikofski (Bitbucket: bwanamarko, GitHub: Unknown):


@pinsardfr see there it is in std.py L471 and L496 in Sphinx-1.3, I think the whole standard domain needs to be updated. :numref: is defined after L630.

joeced commented 9 years ago

Original comment by Mark Mikofski (Bitbucket: bwanamarko, GitHub: Unknown):


@pinsardfr thanks for the report. Any chance you can diff the new standard & python domains in Sphinx-1.3.1 and send a pull request or patch to add the new :numref: directive to either std.py or matlab.py. I think the appropriate place might be matlab.py around L588 or in `std.py after L398. Thanks!