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

Work around linkcheck errors in docs #22201

Merged
merged 1 commit into from
Jun 4, 2017

Conversation

mortenpi
Copy link
Contributor

@mortenpi mortenpi commented Jun 3, 2017

Switch the cross-references introduced in #22048 to @ref links so that linkcheck would pass.

This is just a workaround to get this fixed quickly. In the long-term, Documenter should handle relative links properly (JuliaDocs/Documenter.jl#509).

@tkelman tkelman added backport pending 0.6 docs This change adds or pertains to documentation labels Jun 3, 2017
Copy link
Contributor

@tkelman tkelman left a comment

Choose a reason for hiding this comment

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

works for me thanks

@KristofferC KristofferC merged commit 39777e7 into JuliaLang:master Jun 4, 2017
tkelman pushed a commit that referenced this pull request Jun 6, 2017
@mortenpi mortenpi deleted the linkcheck-workaround branch July 7, 2019 03:49
bors bot added a commit to CliMA/EnsembleKalmanProcesses.jl that referenced this pull request Jul 20, 2022
166: Bugfixes to Documenter config, docs links r=tsj5 a=tsj5

This PR fixes two separate bugs which raise warnings when building documentation, as described in issue #167. Thanks to `@charleskawczynski` for helping me debug this issue!

1) The first bug is that relative paths are not supported as targets of Documenter ``@ref`` links (Documenter issue [509](JuliaDocs/Documenter.jl#509) -- I *think* the link is generated correctly but doesn't pass the linkcheck stage, but don't quote me on that.)
The fix implemented here is the same as [what was used](JuliaLang/julia#22201) for the julialang docs: the link targets are explicitly marked with an [``@id`` tag](https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#Duplicate-Headers), and the ``@ref`` tag is changed to refer to that ``@id`` tag, rather than the file's path. 
Ironcially, this could be better documented in the Documenter docs themselves...

2) The second bug only takes place when building docs locally, and results in missing file warnings for files that exist. This is due to Literate.jl, which generates non-functional URLs (containing the string [`<unkown>`](https://github.com/fredrikekre/Literate.jl/blob/cec2506d22f1367bf03fc3487f14009eff2fd03b/src/Literate.jl#L204-L206)) if the config variable [`repo_root_url`](https://fredrikekre.github.io/Literate.jl/v2/outputformats/#Configuration) is not set. Literate.jl's default configuration picks this up correctly when run under common CI services (eg. GH Actions), but not when built locally. 
The fix implemented here is to manually set this path in make.jl only when being run outside of CI (which we test for by testing the existence of a shell environment variable named `CI`).

With the two fixes above, documentation builds locally without raising any warnings, and manually checking confirms the links in question are generated correctly.

Co-authored-by: Thomas Jackson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants