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

ReadTheDocs edit link leads to readonly repo #2017

Closed
albe opened this issue May 27, 2020 · 13 comments
Closed

ReadTheDocs edit link leads to readonly repo #2017

albe opened this issue May 27, 2020 · 13 comments
Assignees

Comments

@albe
Copy link
Member

albe commented May 27, 2020

See #2016 (review)

Can we somehow fix this? Change RTD to pull from this collection repo instead?

@albe
Copy link
Member Author

albe commented May 27, 2020

See #2016 (comment)
There is a setting apparently:

html_context = {
    'source_url_prefix': "https://gitlab.com/anarcat/foo/blob/HEAD/doc/",
}
# this is the default....

@kdambekalns
Copy link
Member

kdambekalns commented Sep 15, 2020

Uh! That's interesting! According to the link in that link that should help. Let's try that…

@kdambekalns kdambekalns self-assigned this Sep 15, 2020
@kdambekalns
Copy link
Member

If this works "for real" (I tested it locally), I'll adjust the remaining branches and the Neos configuration as well. We'll know tomorrow. 🙂

@kdambekalns
Copy link
Member

For the record:

# Configure links to view/edit source to point to development collection
html_context = {
    'source_url_prefix': 'https://github.com/neos/flow-development-collection/blob/5.3/Neos.Flow/Documentation/',
    'github_user': 'neos',
    'github_repo': 'flow-development-collection',
    'github_version': '5.3',
    'conf_py_path': '/Neos.Flow/Documentation/',
}

@kdambekalns
Copy link
Member

kdambekalns commented Sep 18, 2020

Note: source_url_prefix is not used if the edit link is shown, it can go away.

That being said, this is how it works. Locally for me, and for hundreds of others using the theme but apparently not rendering it on RTD.

Yes, it's in the code (https://github.com/readthedocs/sphinx_rtd_theme/blob/fd83875eefbf1f99d7b6576bacb7d61ae2ac23bc/sphinx_rtd_theme/breadcrumbs.html#L47) – but the documentation only mentions github_url (https://github.com/readthedocs/sphinx_rtd_theme/blob/c04c214a8591a0290f30026b89bf3215fb1061b4/docs/configuring.rst#file-wide-metadata). 🤔 That setting forces a single URL, not really helpful.

I'll try again with the variables set as "file-wide metadata" – if that doesn't work, I'd guess RTD overrides those values. Then the next try would indeed be github_url… or maybe: Switch off "Edit on GitHub", display the link to the source instead (maybe the source_url_prefix works) and hope people will click on edit then…

kdambekalns added a commit that referenced this issue Sep 18, 2020
This moves the settings out of the `html_context` into file-wide
metadata, in the hope of making it work.

See #2017
kdambekalns added a commit that referenced this issue Sep 18, 2020
@albe albe closed this as completed in b1a06a6 Sep 30, 2020
@kdambekalns
Copy link
Member

@albe So it does work, after all… but you upmerged without adjusting the github_version for each branch! That was something I had planned, so the matching version is edited when someone follows that link…

@albe
Copy link
Member Author

albe commented Sep 30, 2020

Quickly fixed it in all branches 6.0+ - we need to remember adjusting this when branching off, so should probably go into our "release documentation" (I'm definitely the first one that would forget that 😆)

@kdambekalns
Copy link
Member

The link still points to neos/flow on GH in the latest rendered documentation…

@kdambekalns kdambekalns reopened this Oct 1, 2020
@albe
Copy link
Member Author

albe commented Oct 1, 2020

But wait, the changelog from the release tags yesterday isn't rendered yet?
https://flowframework.readthedocs.io/en/5.3/TheDefinitiveGuide/PartV/ChangeLogs/5318.html

@albe
Copy link
Member Author

albe commented Oct 2, 2020

yep... 😢

@albe
Copy link
Member Author

albe commented Mar 7, 2021

Coming back to this, did we actually have rerenders with the html_context {} and checked those? Because according to readthedocs/sphinx_rtd_theme#465 (comment) that should work.

Alternatively adding :github_url: https://github.com/... to every doc should also lead to the wanted effect?

@kdambekalns
Copy link
Member

Finally done by now…

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

No branches or pull requests

2 participants