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
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
using Pkg
Pkg.instantiate()
Pkg.develop(PackageSpec(path=pwd()))
Pkg.add(["IOCapture", "DocumenterMarkdown", "tectonic_jll"])'
Pkg.add(["IOCapture", "tectonic_jll"])'
- run: julia --project=test/examples --code-coverage test/examples/tests_latex.jl
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
Expand All @@ -76,12 +76,10 @@ jobs:
with:
version: '1'
- uses: julia-actions/cache@v1
- run: |
julia --project=test/themes/ -e '
using Pkg
Pkg.instantiate()
Pkg.develop(PackageSpec(path=pwd()))'
- run: julia --project=test/themes test/themes/themes.jl
- name: Install dependencies
run: julia --color=yes --project=test/themes/ docs/instantiate.jl test/themes/
- name: Verify theme CSS files
run: julia --project=test/themes test/themes/themes.jl

prerender:
name: "NodeJS for prerender"
Expand Down Expand Up @@ -118,12 +116,10 @@ jobs:
with:
version: '1'
- uses: julia-actions/cache@v1
- run: |
julia --color=yes --project=docs/ -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --color=yes --project=docs/ docs/make.jl ${{ matrix.format }}
- name: Install dependencies
run: julia --color=yes --project=docs/ docs/instantiate.jl
- name: Build the manual
run: julia --color=yes --project=docs/ docs/make.jl ${{ matrix.format }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
Expand Down Expand Up @@ -154,7 +150,7 @@ jobs:
with:
version: '1.6'
- name: Install dependencies
run: julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
run: julia --color=yes --project=docs/ docs/instantiate.jl
- name: Build and check documentation
run: julia --color=yes --project=docs/ docs/make.jl linkcheck

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ test/missingdocs/build/
test/nongit/build/
test/errors/build/
test/prerender/build/
test/themes/dev/
test/workdir/builds/
docs/dev/
docs/build/
docs/build-pdf/
docs/site/
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Documenter"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.27.18"
version = "0.28.0-DEV"

[deps]
ANSIColoredPrinters = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
Expand Down
3 changes: 0 additions & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"

[compat]
DocumenterTools = "=0.1.14"
22 changes: 22 additions & 0 deletions docs/instantiate.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This script can be used to quickly instantiate the docs/Project.toml enviroment.
using Pkg
documenter_directory = joinpath(@__DIR__, "..")
project_directory = isempty(ARGS) ? @__DIR__() : joinpath(pwd(), ARGS[1])
cd(project_directory) do
Pkg.activate(project_directory)
# Install a DocumenterTools version that declares compatibility with Documenter 0.28,
# but from an unreleased tag.
# https://github.com/JuliaDocs/DocumenterTools.jl/releases/tag/documenter-v0.1.14%2B0.28.0-DEV
if isdir("dev/DocumenterTools")
@info "DocumenterTools already cloned to dev/DocumenterTools"
run(`git -C dev/DocumenterTools fetch origin`)
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.

Pkg.develop([
PackageSpec(path = documenter_directory),
PackageSpec(path = "dev/DocumenterTools"),
])
Pkg.instantiate()
end
3 changes: 2 additions & 1 deletion src/Utilities/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ function getremote(dir::AbstractString)
return get!(GIT_REMOTE_CACHE, dir) do
remote = try
readchomp(setenv(`$(git()) config --get remote.origin.url`; dir=dir))
catch
catch e
@error "getremote failed" dir exception = (e, catch_backtrace())
""
end
m = match(LibGit2.GITHUB_REGEX, remote)
Expand Down
1 change: 0 additions & 1 deletion test/themes/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
libsass_jll = "47bcb7c8-5119-555a-9eeb-0afcc36cd728"

[compat]
DocumenterTools = "=0.1.12"
libsass_jll = "~3.6"