Closed matteopilz closed 1 year ago
Nice. If possible I would probably go via the classes of the Code object though:
[[ident, classes, keyvals], code] = value
if "py:class" in classes or "py:meth" in classes:
Regarding methods/classes from submodules, I guess you have to use the full path in RST to be able to distinguish them. Or you link to search results for this function on ReadTheDocs (instead of a direct link).
The references in the rst still work with pyopenms.plotting.plot_spectrum
, but testing for the classes is not working. Do you have an idea, how to see how the classes are stored?
Have you tried some print statements? I also am not sure what pandoc actually stores while parsing.
It seems, that all attributes except code are empty. Maybe we can use a regex?
Hmm.. I can't check right now but did you check that "Code" is the correct name of those classes? From what I saw in: https://github.com/jgm/pandoc/issues/3407 and the related commit: https://github.com/jgm/pandoc/commit/d1444b4ecdd7bc2f3b6180ceb2635d51382c4ab8 it feels like roles are parsed as "Span" with class attributes "role" and the name of the role (here "py:class" I think).
Could be a Code nested in a Span, where the Span has the actual classes attached.
I have tried to ask for key == 'Span'
, but it didn't work.
Ok! I guess that is good enough for now then. Thanks.
It's probably best to remove or redirect the glossary references as well.
True. Do you think it makes sense in the same filter? Could be Code sections as well.
I don't think its Code. I'm going to make a new filter and will merge this PR.
We still need to differentiate between pyopenms & pyopenms.plotting. E.g. :py:func:
~.plot_spectrum
in fragment spectrum generation belongs to plotting, but there is no indication to that (Except for checking if it contains "plot").