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

Use DocumenterTools as a dev dep in docs/ #1876

Merged
merged 6 commits into from
Jul 14, 2022
Merged

Conversation

mortenpi
Copy link
Member

This does a few things:

  1. The source links to the DocumenterTools docstrings do not work right now because we Pkg.add it, but we need the source files to be located in a Git repository for gitremote to determine the remote repository. We can work around that by making it a Pkg.develop dependency instead.

  2. If we add it as a dev dependency, we can use unreleased branches which declare support for newer Documenter versions, and so we can use the -DEV versions in the Documenter repository now. However, this requires checking out a particular commit (or tag) of DocumenterTools. Pkg.develop can not be used for this since it does not know how to check out specific branches, and will fail as it tries to check out master (which will not be compatible with e.g. 0.28.0-DEV).

  3. Since adding it as a local dev dependency is a slightly non-trivial, this creates a separate docs/instantiate.jl script which does the necessary cloning and Pkg environment manipulations, just to make life easier locally and in the CI config.

Handling a minor release will still be a little tricky. But what I reckon we can do is: (1) prepare the master branch of DocumenterTools, which declares compat with Documenter 0.28, (2) update docs/instantiate.jl here to that branch and tag Documenter, and (3) tag the previously prepared commit of DocumenterTools. This way we never have to register a package that depends on a future release of Documenter.

Rather than depending on a commit from a side branch, I think it would be better to push custom tags to DocumenterTools for this. That would ensure that the commit will stay around, even if branches get deleted, and so the git checkout here should never fail.

This will also function as a test case for #1808, since this is an uncommon edge case that we actually handle (including docstrings from a third package in the manual with working source links).

This does a few things:

1. The source links to the DocumenterTools docstrings do not work right
now because we Pkg.add it, but we need the source files to be located in
a Git repository for gitremote to determine the remote repository. We
can work around that by making it a Pkg.develop dependency instead.

2. If we add it as a dev dependency, we can use unreleased branches
which declare support for newer Documenter versions, and so we can use
the -DEV versions in the Documenter repository now. However, this
requires checking out a particular branch (or tag) of DocumenterTools.
Pkg.develop can not be used for this since it does not know how to check
out specific branches, and will fail as it tries to check out master
(which will not be compatible with e.g. 0.28.0-DEV).

3. Since adding it as a local dev dependency is a slightly non-trivial,
this creates a separate docs/instantiate.jl script which does the
necessary cloning and Pkg environment manipulations, just to make life
easier locally and in the CI config.
docs/instantiate.jl Outdated Show resolved Hide resolved
Co-authored-by: Fredrik Ekre <[email protected]>
else
run(`git clone -n https://github.com/JuliaDocs/DocumenterTools.jl.git dev/DocumenterTools`)
end
run(`git -C dev/DocumenterTools checkout documenter-v0.1.14+0.28.0-DEV`)
Copy link
Member Author

Choose a reason for hiding this comment

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

@mortenpi mortenpi marked this pull request as ready for review July 14, 2022 09:55
@mortenpi mortenpi merged commit def9568 into master Jul 14, 2022
@mortenpi mortenpi deleted the mp/docs-instantiate branch July 14, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants