-
Notifications
You must be signed in to change notification settings - Fork 71
Make building the package docs more convenient #2173
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# | ||
# Usage: from the package root directory, run | ||
# | ||
# julia --proj=docs docs/make.jl | ||
# | ||
# To fix doctests instead of merely running them, use | ||
# | ||
# DOCTEST=fix julia --proj=docs docs/make.jl | ||
# | ||
# To disable doctests, run | ||
# | ||
# DOCTEST=off julia --proj=docs docs/make.jl | ||
# | ||
using Pkg | ||
Pkg.update() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is debatable I guess, and perhaps indeed clearly bad (as it may e.g. hinder CI). The main reason I put it in is because I feel forgetting to run Perhaps it should be changed to Or, we could keep it, but add a way to control it via a command argument and/or environment var, just like the doctest. (And what the default value would be could be debated). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the past, I used to |
||
|
||
# parse some options | ||
doctest_arg = true | ||
if "--fix" in ARGS | ||
doctest_arg = :fix | ||
else | ||
tmp = get(ENV, "DOCTEST", "true") | ||
Comment on lines
+19
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is overkill to use both an env variable and and a command line argument to turn on "fix" mode. Thing is, I started with the idea of adding a command line argument, and just I think overall I'd find a command line argument nicer, and would be willing to implement it properly, but before I spend effort on it, I'd like to find out what others think. |
||
if tmp == "true" || tmp == "on" || tmp == "yes" | ||
doctest_arg = true | ||
elseif tmp == "false" || tmp == "off" || tmp == "no" | ||
doctest_arg = false | ||
elseif tmp == "fix" | ||
doctest_arg = :fix | ||
else | ||
error("invalid DOCTEST env var") | ||
end | ||
end | ||
|
||
using Documenter, AbstractAlgebra | ||
|
||
DocMeta.setdocmeta!(AbstractAlgebra, :DocTestSetup, AbstractAlgebra.doctestsetup(); recursive = true) | ||
|
@@ -10,7 +43,7 @@ makedocs( | |
sitename = "AbstractAlgebra.jl", | ||
modules = [AbstractAlgebra], | ||
clean = true, | ||
doctest = true, | ||
doctest = doctest_arg, | ||
checkdocs = :none, | ||
pages = [ | ||
"index.md", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is an unambiguous win and can be merged.