-
Notifications
You must be signed in to change notification settings - Fork 126
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
Enable edit and show source buttons in docs #3381
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #3381 +/- ##
=======================================
Coverage 82.06% 82.06%
=======================================
Files 557 557
Lines 73975 73975
=======================================
Hits 60706 60706
Misses 13269 13269 |
9faad7a
to
32e993b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I checked a few pages and it seems to work very well.
@@ -166,12 +166,30 @@ function doit( | |||
end | |||
src = normpath(root, file) | |||
dst = normpath(dstbase, relpath(root, srcbase), file) | |||
cp(src, dst; force=true) | |||
if endswith(file, ".md") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an objection, just wondering: why not just symlink all the files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had it first with only symlinks, but that leaded to a red wall on https://github.com/oscar-system/Oscar.jl/actions/workflows/pages/pages-build-deployment on the weekend, so it basically blocked all updates to the docs from being published.
How I try to explain it: In the building stage (converting md to HTML), Documenter is fine with files not in the project folder it is called on. However, in later stages (where e.g. *.js
are still there), it does not like symlinks outside of the project folder anymore. And thinking again about it, that would be kind of hard to check-in into git anyway 😂
* Typos * Make the "show source" buttons in the docs work again * Enable the "Edit page on GitHub" buttons (cherry picked from commit 56b8182)
### Backported PRs - [x] #3367 - [x] #3379 - [x] #3369 - [x] #3291 - [x] #3325 - [x] #3350 - [x] #3351 - [x] #3365 - [x] #3366 - [x] #3382 - [x] #3373 - [x] #3341 - [x] #3346 - [x] #3381 - [x] #3385 - [x] #3387 - [x] #3398 - [x] #3399 - [x] #3374 - [x] #3406 - [x] #2823 - [x] #3298 - [x] #3386 - [x] #3412 - [x] #3392 - [x] #3415 - [x] #3394 - [x] #3391
Resolves #588.
In the upgrade to Documenter.jl version 1.0 in #2927, the Documenter cross-referencing features were disabled due to issues with the imported doc pages from AA/Nemo/Hecke.
This PR enables the "show source" buttons in all docstring blocks and resolves the URL for non-oscar docstrings based on some heuristic with
Pkg.jl
internals (if agit_revision
is known take that, otherwise a version is known and we can take the corresponding git tag).Furthermore, it enables the "edit page on github" buttons in the top navigation bar, which now point to the markdown file in the correct project (again based on the same heuristic). (For reviewers: Using a
symlink
insteadcp
to for the import makes it possible for Documenter to guess where a file comes from as the symlink gets resolved usingrealpath
.)Note that the links behind these buttons may be broken/useless in a local build with non-released (dev'ed) versions of dependencies. Anyway, I think this is a great addition.
A preview is available here: https://docs.oscar-system.org/previews/PR3381/