Skip to content

Update hyperlinks in documentation#2495

Open
evagroenendijk wants to merge 8 commits into
masterfrom
documentation-links
Open

Update hyperlinks in documentation#2495
evagroenendijk wants to merge 8 commits into
masterfrom
documentation-links

Conversation

@evagroenendijk

Copy link
Copy Markdown
Contributor

No description provided.

@evagroenendijk evagroenendijk linked an issue Jul 7, 2026 that may be closed by this pull request
@evagroenendijk
evagroenendijk marked this pull request as draft July 7, 2026 13:01
@evagroenendijk

Copy link
Copy Markdown
Contributor Author

@felixhekhorn I decided to also fix the equation references in https://docs.nnpdf.science/theory/PTevol.html so in the end it will still take some time

@felixhekhorn

Copy link
Copy Markdown
Contributor

wait a moment: I suggest to drop that page as is and instead point to https://eko.readthedocs.io, where all of this is already explained in great detail

@scarlehoff do you agree?

@felixhekhorn

Copy link
Copy Markdown
Contributor

cc #2288

@scarlehoff

Copy link
Copy Markdown
Member

It's the information exactly the same?

If yes, ok from me.

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

@felixhekhorn Ah ok, I had not seen that in #2288 this stuff is already being done. Shall I check if the info is the same & drop it if yes, or leave it to #2288?

@felixhekhorn

Copy link
Copy Markdown
Contributor

It's the information exactly the same?

@felixhekhorn Ah ok, I had not seen that in #2288 this stuff is already being done. Shall I check if the info is the same & drop it if yes, or leave it to #2288?

all the evolution information is covered by EKO - and actually this page here is severely outdated, e.g. it does not discuss QED, that we use exact these days, or SV scheme B, so better we drop it. And yes, @evagroenendijk please drop it here and then tick off the relevant box over there

Instead, TMC - which has nothing to do with evolution - should point to https://yadism.readthedocs.io/en/latest/implementation/TMC.html ... aaand then that page is empty, but then we should fix that there, where it belongs. The current content can not be simply transferred since it uses Mellin space (which yadism is not doing). Also the implementation in yadism is more complex as we allow, e.g., different levels (/orders) if TMC. Note that the code documentation does have some explanation ...

Any way, don't forget the main purpose of this PR 🙃

@felixhekhorn felixhekhorn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I already said: updating the documentation is nice and good - but was not the intended task for this PR

Comment thread doc/sphinx/source/external-code/pdf-codes.rst Outdated
Comment thread doc/sphinx/source/theory/PTevol.rst Outdated
Comment thread doc/sphinx/source/external-code/pdf-codes.rst
@felixhekhorn felixhekhorn added the documentation Issues and PRs related to documentation label Jul 9, 2026
@evagroenendijk

Copy link
Copy Markdown
Contributor Author

As I already said: updating the documentation is nice and good - but was not the intended task for this PR

Sure! That's why I did not look at the text, I just updated the links. Actually as far as the nnpdf documentation goes, I pushed all the changes I made already (I did not find any other deprecated links)

@felixhekhorn

felixhekhorn commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

As I already said: updating the documentation is nice and good - but was not the intended task for this PR

ehm, actually, looking at 28ae19b let me ask to be sure: is it clear what #572 wants to do? Specifically, we are not talking about any explicitly written URL in our documentation (like the ones you change in that commit) - we are talking about the automatic link generated by sphinx

I did not find any other deprecated links

(maybe this indicates we are not talking about the same thing 🙈 )

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

As I already said: updating the documentation is nice and good - but was not the intended task for this PR

ehm, actually, looking at 28ae19b let me ask to be sure: is it clear what #572 wants to do? Specifically, we are not talking about any explicitly written URL in our documentation (like the ones you change in that commit) - we are talking about the automatic link generated by sphinx

I did not find any other deprecated links

(maybe this indicates we are not talking about the same thing 🙈 )

Ah okay, then indeed I misunderstood the issue...

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

@felixhekhorn I think I can use this https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html then to solve the issue, would you agree? It can then point to the n3fit and validphys directories in the repository

@felixhekhorn

Copy link
Copy Markdown
Contributor

@felixhekhorn I think I can use this https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html then to solve the issue, would you agree? It can then point to the n3fit and validphys directories in the repository

not sure - this is the right direction, but then you would need to provide the mapping between name of "the thing" (function, class) and the URL yourself. I hope there are better solutions out there, which are already targeted at GitHub and do all the magic for you

@scarlehoff

Copy link
Copy Markdown
Member

Any way, don't forget the main purpose of this PR 🙃

Indeed.

I was thinking something like this: https://github.com/TDKorn/sphinx-github-style not sure whether it is the best option (we can check what numpy is doing exactly I guess) but something like this.

RE linking yadism or EKO. Whenever the information is there, I'm happy with just linking it. But if it is not, better to leave porting the content for later (ideally, open an issue so that it gets assigned later!)

@felixhekhorn

Copy link
Copy Markdown
Contributor

I was thinking something like this: https://github.com/TDKorn/sphinx-github-style not sure whether it is the best option (we can check what numpy is doing exactly I guess) but something like this.

that's better, but maybe still not the best way - which I would agree is the numpy way. It might be worth checking their implementation explicitly

RE linking yadism or EKO. Whenever the information is there, I'm happy with just linking it. But if it is not, better to leave porting the content for later (ideally, open an issue so that it gets assigned later!)

NNPDF/yadism#386 - however, I would remove the current stuff since at best it is confusing (we're surely not doing it in Mellin space) and at worst it is just wrong

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

@felixhekhorn @scarlehoff it looks like numpy is directly using sphinx.ext.linkcode (https://github.com/numpy/numpy/blob/main/doc/source/conf.py#L496C1-L598C1). I'll check what would be easiest for us

@felixhekhorn

Copy link
Copy Markdown
Contributor

@felixhekhorn @scarlehoff it looks like numpy is directly using sphinx.ext.linkcode (https://github.com/numpy/numpy/blob/main/doc/source/conf.py#L496C1-L598C1). I'll check what would be easiest for us

if that works, that's just fine - but then we should take some heavy inspiration (a.k.a. copying) from what they do ... I was mostly worried that mapping would be complicated, but if we can just copy, that is fine

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

@felixhekhorn @scarlehoff it looks like numpy is directly using sphinx.ext.linkcode (https://github.com/numpy/numpy/blob/main/doc/source/conf.py#L496C1-L598C1). I'll check what would be easiest for us

if that works, that's just fine - but then we should take some heavy inspiration (a.k.a. copying) from what they do ... I was mostly worried that mapping would be complicated, but if we can just copy, that is fine

I think roughly copying what they do should work.

But I'm only wondering one thing, namely why do we care about doing all this if we have exclude_patterns = ['modules/**'] (

exclude_patterns = ['modules/**']
)? Won't that just ignore all these modules when building the actual documentation? Or am I missing something?

@scarlehoff

Copy link
Copy Markdown
Member

We are currently not linking the docs into the documentation. We want to start linking the docs, so it might be necessary to change conf.py (I haven't looked at this exclude pattern in particular but yes, it might be that it needs to be changed)

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

@felixhekhorn @scarlehoff I implemented the changes in conf.py. I basically copied the numpy method. The only things I changed in their implementation are:

  • changed "numpy" -> n3fit, evolven3fit, validphys, nnpdf_data and changed the corresponding github repo
  • removed lines where they account for the fact that some of their code is in c

Then I tested it by asking codex to run it and provide me with a table that shows the modules and corresponding github links, which were the correct ones.

Note two things:

  1. it's possible now to also provide the links for nnpdf_data, but it's not compiled in the Makefile at the moment
  2. if we want to start linking the docs as Juan commented there are some extra changes to be made but the setup is there

Let me know if it looks ok to you!

@felixhekhorn

Copy link
Copy Markdown
Contributor

Then I tested it by asking codex to run it

please test at least once yourself, i.e. build the documentation yourself and click on a link

And this maybe will help you also to fix the action https://github.com/NNPDF/nnpdf/actions/runs/29324443681/job/87057256138?pr=2495 (which you still need to do of course) (I had a brief glance there but I don't know what actually is failing ...)

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

Then I tested it by asking codex to run it

please test at least once yourself, i.e. build the documentation yourself and click on a link

And this maybe will help you also to fix the action https://github.com/NNPDF/nnpdf/actions/runs/29324443681/job/87057256138?pr=2495 (which you still need to do of course) (I had a brief glance there but I don't know what actually is failing ...)

Ok, will do!

I think the failing action has something to do with the rust files that I adjusted, I'll fix it when I finish that!

Comment thread doc/sphinx/source/theory/PTevol.rst Outdated
@evagroenendijk

Copy link
Copy Markdown
Contributor Author

@felixhekhorn I'm finished making the changes.

About testing the links, it's not possible to click a link in the generated documentation since they are currently not explicitly used inside the documentation (see comment by Juan). But I generated a test file containing one of the links, and this worked fine.

@evagroenendijk
evagroenendijk marked this pull request as ready for review July 17, 2026 09:23
@felixhekhorn

Copy link
Copy Markdown
Contributor

About testing the links, it's not possible to click a link in the generated documentation since they are currently not explicitly used inside the documentation (see comment by Juan).

I'm not sure I understand - why is it not working? which comment do you mean? are we not linking to our code? (in which case this whole issue and PR would be void, so I don't think that can be the case, can it?) or are the link targets not there? then we need to provide them of course ...

@evagroenendijk

Copy link
Copy Markdown
Contributor Author

About testing the links, it's not possible to click a link in the generated documentation since they are currently not explicitly used inside the documentation (see comment by Juan).

I'm not sure I understand - why is it not working? which comment do you mean? are we not linking to our code? (in which case this whole issue and PR would be void, so I don't think that can be the case, can it?) or are the link targets not there? then we need to provide them of course ...

That is also what I was wondering, if I understood @scarlehoff correctly we are now not linking in the docs, but at some point we want to and that's why we have to make this change. In any case I think

exclude_patterns = ['modules/**']

makes sure that at the moment these modules are ignored by the makefile. Did I understand you correctly @scarlehoff ?

@scarlehoff

Copy link
Copy Markdown
Member

At the moment what we have in the docs is this https://docs.nnpdf.science/_modules/index.html
and what we would like is to have instead the a
structure linked with github.

I haven't been able to follow the discussion so not sure what the issue is in the PR. But the issue to be solved is that one.

@felixhekhorn

Copy link
Copy Markdown
Contributor

At the moment what we have in the docs is this https://docs.nnpdf.science/_modules/index.html and what we would like is to have instead the a structure linked with github.

do we have a link somewhere which actually points there @scarlehoff ?

@evagroenendijk

evagroenendijk commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

https://docs.nnpdf.science/_modules/index.html

Ok, then I think we have to make some more changes as well. I.e. remove the modules from exclude_pattern and I think add some other things as well. Because as far as I understand, this sphinx viewcode makes this page, but linkcode (which I've implemented now) does not automatically

(I think we have to make a dedicated rst file for it then)

@scarlehoff

Copy link
Copy Markdown
Member

do we have a link somewhere which actually points there @scarlehoff ?

I think we removed it? It used to be in the main page.
(Not sure whether some are left in there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Issues and PRs related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate github with the documentation

3 participants