Skip to content

Commit 35dac2e

Browse files
committed
split out a part of stdlib into a Base category in docs
1 parent 3d1886f commit 35dac2e

39 files changed

+84
-111
lines changed

doc/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
deps/
22
_build/
33
UnicodeData.txt
4-
4+
src/stdlib/

doc/make.jl

Lines changed: 45 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,23 @@ end
1919
symlink_q(tgt, link) = isfile(link) || symlink(tgt, link)
2020
cp_q(src, dest) = isfile(dest) || cp(src, dest)
2121

22-
# make links for stdlib package docs
23-
if Sys.iswindows()
24-
cp_q("../stdlib/DelimitedFiles/docs/src/index.md", "src/stdlib/delimitedfiles.md")
25-
cp_q("../stdlib/Test/docs/src/index.md", "src/stdlib/test.md")
26-
cp_q("../stdlib/Mmap/docs/src/index.md", "src/stdlib/mmap.md")
27-
cp_q("../stdlib/SharedArrays/docs/src/index.md", "src/stdlib/sharedarrays.md")
28-
cp_q("../stdlib/Profile/docs/src/index.md", "src/stdlib/profile.md")
29-
cp_q("../stdlib/Base64/docs/src/index.md", "src/stdlib/base64.md")
30-
cp_q("../stdlib/FileWatching/docs/src/index.md", "src/stdlib/filewatching.md")
31-
cp_q("../stdlib/CRC32c/docs/src/index.md", "src/stdlib/crc32c.md")
32-
cp_q("../stdlib/Dates/docs/src/index.md", "src/stdlib/dates.md")
33-
cp_q("../stdlib/IterativeEigensolvers/docs/src/index.md", "src/stdlib/iterativeeigensolvers.md")
34-
cp_q("../stdlib/Unicode/docs/src/index.md", "src/stdlib/unicode.md")
35-
cp_q("../stdlib/Distributed/docs/src/index.md", "src/stdlib/distributed.md")
36-
cp_q("../stdlib/Printf/docs/src/index.md", "src/stdlib/printf.md")
37-
else
38-
symlink_q("../../../stdlib/DelimitedFiles/docs/src/index.md", "src/stdlib/delimitedfiles.md")
39-
symlink_q("../../../stdlib/Test/docs/src/index.md", "src/stdlib/test.md")
40-
symlink_q("../../../stdlib/Mmap/docs/src/index.md", "src/stdlib/mmap.md")
41-
symlink_q("../../../stdlib/SharedArrays/docs/src/index.md", "src/stdlib/sharedarrays.md")
42-
symlink_q("../../../stdlib/Profile/docs/src/index.md", "src/stdlib/profile.md")
43-
symlink_q("../../../stdlib/Base64/docs/src/index.md", "src/stdlib/base64.md")
44-
symlink_q("../../../stdlib/FileWatching/docs/src/index.md", "src/stdlib/filewatching.md")
45-
symlink_q("../../../stdlib/CRC32c/docs/src/index.md", "src/stdlib/crc32c.md")
46-
symlink_q("../../../stdlib/Dates/docs/src/index.md", "src/stdlib/dates.md")
47-
symlink_q("../../../stdlib/IterativeEigensolvers/docs/src/index.md", "src/stdlib/iterativeeigensolvers.md")
48-
symlink_q("../../../stdlib/Unicode/docs/src/index.md", "src/stdlib/unicode.md")
49-
symlink_q("../../../stdlib/Distributed/docs/src/index.md", "src/stdlib/distributed.md")
50-
symlink_q("../../../stdlib/Printf/docs/src/index.md", "src/stdlib/printf.md")
22+
# make links for stdlib package docs, this is needed until #522 in Documenter.jl is finished
23+
const STDLIB_DOCS = []
24+
const STDLIB_DIR = joinpath(@__DIR__, "..", "stdlib")
25+
for dir in readdir(STDLIB_DIR)
26+
sourcefile = joinpath(STDLIB_DIR, dir, "docs", "src", "index.md")
27+
if isfile(sourcefile)
28+
cd(joinpath(@__DIR__, "src")) do
29+
isdir("stdlib") || mkdir("stdlib")
30+
targetfile = joinpath("stdlib", dir * ".md")
31+
push!(STDLIB_DOCS, (stdlib = Symbol(dir), targetfile = targetfile))
32+
if Sys.iswindows()
33+
cp_q(sourcefile, targetfile)
34+
else
35+
symlink_q(sourcefile, targetfile)
36+
end
37+
end
38+
end
5139
end
5240

5341
const PAGES = [
@@ -93,42 +81,31 @@ const PAGES = [
9381
"manual/noteworthy-differences.md",
9482
"manual/unicode-input.md",
9583
],
96-
"Standard Library" => [
97-
"stdlib/base.md",
98-
"stdlib/collections.md",
99-
"stdlib/math.md",
100-
"stdlib/numbers.md",
101-
"stdlib/strings.md",
102-
"stdlib/arrays.md",
103-
"stdlib/parallel.md",
104-
"stdlib/distributed.md",
105-
"stdlib/multi-threading.md",
106-
"stdlib/linalg.md",
107-
"stdlib/constants.md",
108-
"stdlib/file.md",
109-
"stdlib/delimitedfiles.md",
110-
"stdlib/io-network.md",
111-
"stdlib/punctuation.md",
112-
"stdlib/sort.md",
113-
"stdlib/pkg.md",
114-
"stdlib/dates.md",
115-
"stdlib/iterators.md",
116-
"stdlib/test.md",
117-
"stdlib/c.md",
118-
"stdlib/libc.md",
119-
"stdlib/libdl.md",
120-
"stdlib/profile.md",
121-
"stdlib/stacktraces.md",
122-
"stdlib/simd-types.md",
123-
"stdlib/base64.md",
124-
"stdlib/mmap.md",
125-
"stdlib/sharedarrays.md",
126-
"stdlib/filewatching.md",
127-
"stdlib/crc32c.md",
128-
"stdlib/iterativeeigensolvers.md",
129-
"stdlib/unicode.md",
130-
"stdlib/printf.md",
84+
"Base" => [
85+
"base/base.md",
86+
"base/collections.md",
87+
"base/math.md",
88+
"base/numbers.md",
89+
"base/strings.md",
90+
"base/arrays.md",
91+
"base/parallel.md",
92+
"base/multi-threading.md",
93+
"base/linalg.md",
94+
"base/constants.md",
95+
"base/file.md",
96+
"base/io-network.md",
97+
"base/punctuation.md",
98+
"base/sort.md",
99+
"base/pkg.md",
100+
"base/iterators.md",
101+
"base/c.md",
102+
"base/libc.md",
103+
"base/libdl.md",
104+
"base/stacktraces.md",
105+
"base/simd-types.md",
131106
],
107+
"Standard Library" =>
108+
[stdlib.targetfile for stdlib in STDLIB_DOCS],
132109
"Developer Documentation" => [
133110
"devdocs/reflection.md",
134111
"Documentation of Julia's Internals" => [
@@ -162,13 +139,13 @@ const PAGES = [
162139
],
163140
]
164141

165-
using DelimitedFiles, Test, Mmap, SharedArrays, Profile, Base64, FileWatching, CRC32c,
166-
Dates, IterativeEigensolvers, Unicode, Distributed, Printf
142+
for stdlib in STDLIB_DOCS
143+
@eval using $(stdlib.stdlib)
144+
end
167145

168146
makedocs(
169147
build = joinpath(pwd(), "_build/html/en"),
170-
modules = [Base, Core, BuildSysImg, DelimitedFiles, Test, Mmap, SharedArrays, Profile,
171-
Base64, FileWatching, Dates, IterativeEigensolvers, Unicode, Distributed, Printf],
148+
modules = [Base, Core, BuildSysImg, [Module(stdlib.stdlib) for stdlib in STDLIB_DOCS]...],
172149
clean = false,
173150
doctest = "doctest" in ARGS,
174151
linkcheck = "linkcheck" in ARGS,
File renamed without changes.

doc/src/stdlib/base.md renamed to doc/src/base/base.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Introduction
44

5-
The Julia standard library contains a range of functions and macros appropriate for performing
5+
Julia Base contains a range of functions and macros appropriate for performing
66
scientific and numerical computing, but is also as broad as those of many general purpose programming
77
languages. Additional functionality is available from a growing collection of available packages.
88
Functions are grouped by topic below.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)