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

Old: Bump Documenter.jl to v1.0 #2922

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"

[compat]
Documenter = "0.27.0"
DocumenterCitations = "~1.1, ~1.2"
Documenter = "1.1"
DocumenterCitations = "~1.2"
4 changes: 2 additions & 2 deletions docs/citation_style.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import DocumenterCitations

# we use some (undocumented) internal helper functions for formatting...
using DocumenterCitations: format_names, tex2unicode, italicize_md_et_al
using DocumenterCitations: format_names, tex2unicode

const oscar_style = :oscar

Expand Down Expand Up @@ -66,7 +66,7 @@ function DocumenterCitations.format_citation(
)
end
capitalize && (names = uppercasefirst(names))
link_text = italicize_md_et_al("$names $link_text")
link_text = "$names $link_text"
end
return link_text
end
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Documenter, Oscar

include(normpath(joinpath(Oscar.oscardir, "docs", "make_work.jl")))

BuildDoc.doit(Oscar; strict=true, local_build=false, doctest=false)
BuildDoc.doit(Oscar; warnonly=false, local_build=false, doctest=false)

deploydocs(
repo = "github.com/oscar-system/Oscar.jl.git",
Expand Down
17 changes: 12 additions & 5 deletions docs/make_work.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ end

function doit(
Oscar::Module;
strict::Bool=true,
warnonly=false,
local_build::Bool=false,
doctest::Union{Bool,Symbol}=true,
)
Expand Down Expand Up @@ -182,16 +182,23 @@ function doit(
Documenter.doctest(Oscar, fix = doctest === :fix)
end

makedocs(
bib;
format=Documenter.HTML(; prettyurls=!local_build, collapselevel=1),
makedocs(;
format=Documenter.HTML(;
prettyurls=!local_build,
collapselevel=1,
size_threshold=409600,
size_threshold_warn=204800,
size_threshold_ignore=["manualindex.md"],
),
sitename="Oscar.jl",
modules=[Oscar, Oscar.Hecke, Oscar.Nemo, Oscar.AbstractAlgebra, Oscar.Singular],
clean=true,
doctest=false,
strict=strict,
warnonly=warnonly,
checkdocs=:none,
pages=doc,
remotes=nothing, # TODO: make work with Hecke, Nemo, AbstractAlgebra, see https://github.com/oscar-system/Oscar.jl/issues/588
plugins=[bib],
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ For $g=0$ we obtain a Klee-Minty cube,
in particular for $e=g=0$ we obtain the standard cube.

# Example
The following produces a $3$-dimensional Klee-Minty cube for $e=\frac{1}{3}.
The following produces a $3$-dimensional Klee-Minty cube for $e=\frac{1}{3}$.
```jldoctest
julia> c = goldfarb_cube(3,1//3,0)
Polyhedron in ambient dimension 3
Expand Down
17 changes: 9 additions & 8 deletions src/utils/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
end

@doc raw"""
build_doc(; doctest=false, strict=false, open_browser=true, start_server=false)
build_doc(; doctest=false, warnonly=true, open_browser=true, start_server=false)

Build the manual of `Oscar.jl` locally and open the front page in a
browser.
Expand All @@ -149,9 +149,11 @@
errors in some parts of Oscar, so please be careful, especially when setting
`doctest=:fix`.

The optional parameter `strict` is passed on to `makedocs` of `Documenter.jl`
and if set to `true` then according to the manual of `Documenter.jl` "a
The optional parameter `warnonly` is passed on to `makedocs` of `Documenter.jl`
and if set to `false` then according to the manual of `Documenter.jl` "a
doctesting error will always make makedocs throw an error in this mode".
Alternatively, one can pass a list of symbols to `warnonly` to suppress
errors for the given error types.

To prevent the opening of the browser at the end, set the optional parameter
`open_browser` to `false`.
Expand All @@ -177,19 +179,18 @@
The first run of `build_doc` will take the usual few minutes, subsequent runs
will be significantly faster.
"""
function build_doc(; doctest::Union{Symbol, Bool} = false, strict::Bool = false, open_browser::Bool = true, start_server::Bool = false)
function build_doc(; doctest::Union{Symbol, Bool} = false, warnonly = true, open_browser::Bool = true, start_server::Bool = false)

Check warning on line 182 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L182

Added line #L182 was not covered by tests
versioncheck = (VERSION.major == 1) && (VERSION.minor >= 7)
versionwarn =
"The Julia reference version for the doctests is 1.7 or later, but you are using
$(VERSION). Running the doctests will produce errors that you do not expect."
versionwarn = """The Julia reference version for the doctests is 1.7 or later, but you are using

Check warning on line 184 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L184

Added line #L184 was not covered by tests
$(VERSION). Running the doctests will produce errors that you do not expect."""
if doctest != false && !versioncheck
@warn versionwarn
end
if !isdefined(Main, :BuildDoc)
doc_init()
end
Pkg.activate(docsproject) do
Base.invokelatest(Main.BuildDoc.doit, Oscar; strict=strict, local_build=true, doctest=doctest)
Base.invokelatest(Main.BuildDoc.doit, Oscar; warnonly=warnonly, local_build=true, doctest=doctest)

Check warning on line 193 in src/utils/docs.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/docs.jl#L193

Added line #L193 was not covered by tests
end
if start_server
start_doc_preview_server(open_browser = open_browser)
Expand Down
Loading