-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Update Documenter 0.27.23 => 1.2.1 #47105
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
Changes from 22 commits
b24944a
fdcbbdf
d64539f
c0e8bcc
44d2b51
260b543
c906cc9
551d1ce
3a4bbc0
785b992
6adff0f
8a51395
8b92c66
d26fa71
3cfa052
1b1e3c0
e84df37
e381d5e
8bb645e
be67eb4
6a63130
64cb40f
b91849c
317d3d8
816b5b5
608bb07
c407135
a78d2dd
4532811
81a3f81
305c51d
2b621de
a9018b4
e433597
f0b7302
121bdc9
3da55b3
ff0da64
369685e
2eeeac1
012cf21
d272c96
0db360d
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 |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ using Pkg | |
| Pkg.instantiate() | ||
|
|
||
| using Documenter | ||
| import LibGit2 | ||
|
|
||
| baremodule GenStdLib end | ||
|
|
||
|
|
@@ -42,6 +43,62 @@ cd(joinpath(@__DIR__, "src")) do | |
| end | ||
| end | ||
|
|
||
| # Because we have standard libraries that are hosted outside of the julia repo, | ||
| # but their docs are included in the manual, we need to populate the remotes argument | ||
| # of makedocs(), to make sure that Documenter knows how to resolve the directories | ||
| # in stdlib/ to the correct remote Git repositories (for source and edit links). | ||
| # | ||
| # This function parses the *.version files in stdlib/, returning a dictionary with | ||
| # all the key-value pairs from those files. *_GIT_URL and *_SHA1 fields are the ones | ||
| # we will actually be interested in. | ||
| function parse_stdlib_version_file(path) | ||
| values = Dict{String,String}() | ||
| for line in readlines(path) | ||
| m = match(r"^([A-Z0-9_]+)\s+:?=\s+(\S+)\s?$", line) | ||
| if isnothing(m) | ||
| @warn "Unable to parse line in $(path)" line | ||
| else | ||
| values[m[1]] = m[2] | ||
| end | ||
| end | ||
| return values | ||
| end | ||
| # This generates the value that will be passed to the `remotes` argument of makedocs(), | ||
| # by looking through all *.version files in stdlib/. | ||
| documenter_stdlib_remotes = let stdlib_dir = realpath(joinpath(@__DIR__, "..", "stdlib")) | ||
LilithHafner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Get a list of all *.version files in stdlib/.. | ||
| version_files = filter(readdir(stdlib_dir)) do fname | ||
| isfile(joinpath(stdlib_dir, fname)) && endswith(fname, ".version") | ||
| end | ||
| # .. and then parse them, each becoming an entry for makedocs's remotes. | ||
| # The values for each are of the form path => (remote, sha1), where | ||
| # - path: the path to the stdlib package's root directory, i.e. "stdlib/$PACKAGE" | ||
| # - remote: a Documenter.Remote object, pointing to the Git repository where package is hosted | ||
| # - sha1: the SHA1 of the commit that is included with the current Julia version | ||
| remotes_list = map(version_files) do version_fname | ||
| package = match(r"(.+)\.version", version_fname)[1] | ||
| versionfile = parse_stdlib_version_file(joinpath(stdlib_dir, version_fname)) | ||
| # From the (all uppercase) $(package)_GIT_URL and $(package)_SHA1 fields, we'll determine | ||
| # the necessary information. If this logic happens to fail for some reason for any of the | ||
| # standard libraries, we'll crash the documentation build, so that it could be fixed. | ||
| remote = let git_url_key = "$(uppercase(package))_GIT_URL" | ||
| haskey(versionfile, git_url_key) || error("Missing $(git_url_key) in $version_fname") | ||
| m = match(LibGit2.GITHUB_REGEX, versionfile[git_url_key]) | ||
| isnothing(m) && error("Unable to parse $(git_url_key)='$(versionfile[git_url_key])' in $version_fname") | ||
| Documenter.Remotes.GitHub(m[2], m[3]) | ||
| end | ||
| package_sha = let sha_key = "$(uppercase(package))_SHA1" | ||
| haskey(versionfile, sha_key) || error("Missing $(sha_key) in $version_fname") | ||
| versionfile[sha_key] | ||
| end | ||
| # Construct the absolute (local) path to the stdlib package's root directory | ||
| package_root_dir = joinpath(stdlib_dir, "$(package)-$(package_sha)") | ||
| isdir(package_root_dir) || error("Missing stdlib: $(package_root_dir)") | ||
|
||
| package_root_dir => (remote, package_sha) | ||
| end | ||
| Dict(remotes_list) | ||
| end | ||
|
|
||
| # Check if we are building a PDF | ||
| const render_pdf = "pdf" in ARGS | ||
|
|
||
|
|
@@ -290,6 +347,8 @@ else | |
| collapselevel = 1, | ||
| sidebar_sitename = false, | ||
| ansicolor = true, | ||
| size_threshold = 800 * 2^10, # 800 KiB | ||
| size_threshold_warn = 200 * 2^10, # the manual has quite a few large pages, so we warn at 200+ KiB only | ||
| ) | ||
| end | ||
|
|
||
|
|
@@ -301,12 +360,12 @@ makedocs( | |
| doctest = ("doctest=fix" in ARGS) ? (:fix) : ("doctest=only" in ARGS) ? (:only) : ("doctest=true" in ARGS) ? true : false, | ||
| linkcheck = "linkcheck=true" in ARGS, | ||
| linkcheck_ignore = ["https://bugs.kde.org/show_bug.cgi?id=136779"], # fails to load from nanosoldier? | ||
| strict = true, | ||
mortenpi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| checkdocs = :none, | ||
| format = format, | ||
| sitename = "The Julia Language", | ||
| authors = "The Julia Project", | ||
| pages = PAGES, | ||
| remotes = documenter_stdlib_remotes, | ||
| ) | ||
|
|
||
| # Update URLs to external stdlibs (JuliaLang/julia#43199) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.