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

Convert References to html Links for ipynb #399

Merged
merged 5 commits into from
Jun 2, 2023

Conversation

matteopilz
Copy link
Contributor

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").

@matteopilz matteopilz linked an issue May 31, 2023 that may be closed by this pull request
@jpfeuffer
Copy link
Contributor

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).

@matteopilz
Copy link
Contributor Author

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?

@jpfeuffer
Copy link
Contributor

Have you tried some print statements? I also am not sure what pandoc actually stores while parsing.

@matteopilz
Copy link
Contributor Author

It seems, that all attributes except code are empty. Maybe we can use a regex?

@jpfeuffer
Copy link
Contributor

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:
jgm/pandoc#3407
and the related commit:
jgm/pandoc@d1444b4
it feels like roles are parsed as "Span" with class attributes "role" and the name of the role (here "py:class" I think).

@jpfeuffer
Copy link
Contributor

Could be a Code nested in a Span, where the Span has the actual classes attached.

@matteopilz
Copy link
Contributor Author

I have tried to ask for key == 'Span', but it didn't work.

@jpfeuffer
Copy link
Contributor

Ok! I guess that is good enough for now then. Thanks.

@matteopilz
Copy link
Contributor Author

It's probably best to remove or redirect the glossary references as well.
image

@jpfeuffer
Copy link
Contributor

True. Do you think it makes sense in the same filter?
Could be Code sections as well.

@matteopilz
Copy link
Contributor Author

I don't think its Code. I'm going to make a new filter and will merge this PR.

@matteopilz matteopilz merged commit 8c1f161 into OpenMS:master Jun 2, 2023
@matteopilz matteopilz deleted the ipynb_links branch June 2, 2023 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double-check case sensitivity of anchor links
2 participants