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

Enable edit and show source buttons in docs #3381

Merged
merged 4 commits into from
Feb 19, 2024
Merged

Conversation

lgoettgens
Copy link
Member

@lgoettgens lgoettgens commented Feb 16, 2024

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 a git_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 instead cp to for the import makes it possible for Documenter to guess where a file comes from as the symlink gets resolved using realpath.)

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/

@lgoettgens lgoettgens added documentation Improvements or additions to documentation backport 1.0.x Should be backported to the release 1.0 branch labels Feb 16, 2024
@lgoettgens lgoettgens changed the title Typos Enable edit and show source buttons in docs Feb 16, 2024
@benlorenz benlorenz mentioned this pull request Feb 16, 2024
33 tasks
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

Merging #3381 (32e993b) into master (fbd34b8) will not change coverage.
The diff coverage is n/a.

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           

@lgoettgens lgoettgens marked this pull request as ready for review February 18, 2024 14:25
Copy link
Member

@benlorenz benlorenz left a 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")
Copy link
Member

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?

Copy link
Member Author

@lgoettgens lgoettgens Feb 19, 2024

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 😂

docs/make_work.jl Outdated Show resolved Hide resolved
@fingolfin fingolfin enabled auto-merge (squash) February 19, 2024 11:42
@fingolfin fingolfin merged commit 56b8182 into master Feb 19, 2024
21 checks passed
@fingolfin fingolfin deleted the lg/documenter-links branch February 19, 2024 11:48
benlorenz pushed a commit that referenced this pull request Feb 21, 2024
* Typos
* Make the "show source" buttons in the docs work again
* Enable the "Edit page on GitHub" buttons

(cherry picked from commit 56b8182)
@benlorenz benlorenz removed the backport 1.0.x Should be backported to the release 1.0 branch label Feb 21, 2024
benlorenz added a commit that referenced this pull request Feb 23, 2024
### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

links to source code in the Oscar documentation
3 participants