@@ -41,113 +41,132 @@ cd(joinpath(@__DIR__, "src")) do
41
41
end
42
42
end
43
43
44
+ # Check if we are building a PDF
45
+ const render_pdf = " pdf" in ARGS
46
+
44
47
# Generate a suitable markdown file from NEWS.md and put it in src
45
48
str = read (joinpath (@__DIR__ , " .." , " NEWS.md" ), String)
46
49
splitted = split (str, " <!--- generated by NEWS-update.jl: -->" )
47
50
@assert length (splitted) == 2
48
51
replaced_links = replace (splitted[1 ], r" \[\# ([0-9]*?)\] " => s " [#\g <1>](https://github.com/JuliaLang/julia/issues/\g <1>)" )
49
52
write (joinpath (@__DIR__ , " src" , " NEWS.md" ), replaced_links)
50
53
51
- const PAGES = [
52
- " Home" => " index.md" ,
53
- hide (" NEWS.md" ),
54
- " Manual" => [
55
- " manual/getting-started.md" ,
56
- " manual/variables.md" ,
57
- " manual/integers-and-floating-point-numbers.md" ,
58
- " manual/mathematical-operations.md" ,
59
- " manual/complex-and-rational-numbers.md" ,
60
- " manual/strings.md" ,
61
- " manual/functions.md" ,
62
- " manual/control-flow.md" ,
63
- " manual/variables-and-scoping.md" ,
64
- " manual/types.md" ,
65
- " manual/methods.md" ,
66
- " manual/constructors.md" ,
67
- " manual/conversion-and-promotion.md" ,
68
- " manual/interfaces.md" ,
69
- " manual/modules.md" ,
70
- " manual/documentation.md" ,
71
- " manual/metaprogramming.md" ,
72
- " manual/arrays.md" ,
73
- " manual/missing.md" ,
74
- " manual/networking-and-streams.md" ,
75
- " manual/parallel-computing.md" ,
76
- " manual/asynchronous-programming.md" ,
77
- " manual/multi-threading.md" ,
78
- " manual/distributed-computing.md" ,
79
- " manual/running-external-programs.md" ,
80
- " manual/calling-c-and-fortran-code.md" ,
81
- " manual/handling-operating-system-variation.md" ,
82
- " manual/environment-variables.md" ,
83
- " manual/embedding.md" ,
84
- " manual/code-loading.md" ,
85
- " manual/profile.md" ,
86
- " manual/stacktraces.md" ,
87
- " manual/performance-tips.md" ,
88
- " manual/workflow-tips.md" ,
89
- " manual/style-guide.md" ,
90
- " manual/faq.md" ,
91
- " manual/noteworthy-differences.md" ,
92
- " manual/unicode-input.md" ,
93
- ],
94
- " Base" => [
95
- " base/base.md" ,
96
- " base/collections.md" ,
97
- " base/math.md" ,
98
- " base/numbers.md" ,
99
- " base/strings.md" ,
100
- " base/arrays.md" ,
101
- " base/parallel.md" ,
102
- " base/multi-threading.md" ,
103
- " base/constants.md" ,
104
- " base/file.md" ,
105
- " base/io-network.md" ,
106
- " base/punctuation.md" ,
107
- " base/sort.md" ,
108
- " base/iterators.md" ,
109
- " base/c.md" ,
110
- " base/libc.md" ,
111
- " base/stacktraces.md" ,
112
- " base/simd-types.md" ,
113
- ],
114
- " Standard Library" =>
115
- [stdlib. targetfile for stdlib in STDLIB_DOCS],
116
- " Developer Documentation" => [
117
- " devdocs/reflection.md" ,
118
- " Documentation of Julia's Internals" => [
119
- " devdocs/init.md" ,
120
- " devdocs/ast.md" ,
121
- " devdocs/types.md" ,
122
- " devdocs/object.md" ,
123
- " devdocs/eval.md" ,
124
- " devdocs/callconv.md" ,
125
- " devdocs/compiler.md" ,
126
- " devdocs/functions.md" ,
127
- " devdocs/cartesian.md" ,
128
- " devdocs/meta.md" ,
129
- " devdocs/subarrays.md" ,
130
- " devdocs/isbitsunionarrays.md" ,
131
- " devdocs/sysimg.md" ,
132
- " devdocs/llvm.md" ,
133
- " devdocs/stdio.md" ,
134
- " devdocs/boundscheck.md" ,
135
- " devdocs/locks.md" ,
136
- " devdocs/offset-arrays.md" ,
137
- " devdocs/require.md" ,
138
- " devdocs/inference.md" ,
139
- " devdocs/ssair.md" ,
140
- " devdocs/gc-sa.md" ,
141
- ],
142
- " Developing/debugging Julia's C code" => [
143
- " devdocs/backtraces.md" ,
144
- " devdocs/debuggingtips.md" ,
145
- " devdocs/valgrind.md" ,
146
- " devdocs/sanitizers.md" ,
147
- ]
54
+ Manual = [
55
+ " manual/getting-started.md" ,
56
+ " manual/variables.md" ,
57
+ " manual/integers-and-floating-point-numbers.md" ,
58
+ " manual/mathematical-operations.md" ,
59
+ " manual/complex-and-rational-numbers.md" ,
60
+ " manual/strings.md" ,
61
+ " manual/functions.md" ,
62
+ " manual/control-flow.md" ,
63
+ " manual/variables-and-scoping.md" ,
64
+ " manual/types.md" ,
65
+ " manual/methods.md" ,
66
+ " manual/constructors.md" ,
67
+ " manual/conversion-and-promotion.md" ,
68
+ " manual/interfaces.md" ,
69
+ " manual/modules.md" ,
70
+ " manual/documentation.md" ,
71
+ " manual/metaprogramming.md" ,
72
+ " manual/arrays.md" ,
73
+ " manual/missing.md" ,
74
+ " manual/networking-and-streams.md" ,
75
+ " manual/parallel-computing.md" ,
76
+ " manual/asynchronous-programming.md" ,
77
+ " manual/multi-threading.md" ,
78
+ " manual/distributed-computing.md" ,
79
+ " manual/running-external-programs.md" ,
80
+ " manual/calling-c-and-fortran-code.md" ,
81
+ " manual/handling-operating-system-variation.md" ,
82
+ " manual/environment-variables.md" ,
83
+ " manual/embedding.md" ,
84
+ " manual/code-loading.md" ,
85
+ " manual/profile.md" ,
86
+ " manual/stacktraces.md" ,
87
+ " manual/performance-tips.md" ,
88
+ " manual/workflow-tips.md" ,
89
+ " manual/style-guide.md" ,
90
+ " manual/faq.md" ,
91
+ " manual/noteworthy-differences.md" ,
92
+ " manual/unicode-input.md" ,
93
+ ]
94
+
95
+ BaseDocs = [
96
+ " base/base.md" ,
97
+ " base/collections.md" ,
98
+ " base/math.md" ,
99
+ " base/numbers.md" ,
100
+ " base/strings.md" ,
101
+ " base/arrays.md" ,
102
+ " base/parallel.md" ,
103
+ " base/multi-threading.md" ,
104
+ " base/constants.md" ,
105
+ " base/file.md" ,
106
+ " base/io-network.md" ,
107
+ " base/punctuation.md" ,
108
+ " base/sort.md" ,
109
+ " base/iterators.md" ,
110
+ " base/c.md" ,
111
+ " base/libc.md" ,
112
+ " base/stacktraces.md" ,
113
+ " base/simd-types.md" ,
114
+ ]
115
+
116
+ StdlibDocs = [stdlib. targetfile for stdlib in STDLIB_DOCS]
117
+
118
+ DevDocs = [
119
+ " devdocs/reflection.md" ,
120
+ " Documentation of Julia's Internals" => [
121
+ " devdocs/init.md" ,
122
+ " devdocs/ast.md" ,
123
+ " devdocs/types.md" ,
124
+ " devdocs/object.md" ,
125
+ " devdocs/eval.md" ,
126
+ " devdocs/callconv.md" ,
127
+ " devdocs/compiler.md" ,
128
+ " devdocs/functions.md" ,
129
+ " devdocs/cartesian.md" ,
130
+ " devdocs/meta.md" ,
131
+ " devdocs/subarrays.md" ,
132
+ " devdocs/isbitsunionarrays.md" ,
133
+ " devdocs/sysimg.md" ,
134
+ " devdocs/llvm.md" ,
135
+ " devdocs/stdio.md" ,
136
+ " devdocs/boundscheck.md" ,
137
+ " devdocs/locks.md" ,
138
+ " devdocs/offset-arrays.md" ,
139
+ " devdocs/require.md" ,
140
+ " devdocs/inference.md" ,
141
+ " devdocs/ssair.md" ,
142
+ " devdocs/gc-sa.md" ,
148
143
],
144
+ " Developing/debugging Julia's C code" => [
145
+ " devdocs/backtraces.md" ,
146
+ " devdocs/debuggingtips.md" ,
147
+ " devdocs/valgrind.md" ,
148
+ " devdocs/sanitizers.md" ,
149
+ ]
149
150
]
150
151
152
+
153
+ if render_pdf
154
+ const PAGES = [
155
+ " Manual" => [" index.md" , Manual... ],
156
+ " Base" => BaseDocs,
157
+ " Standard Library" => StdlibDocs,
158
+ " Developer Documentation" => DevDocs
159
+ ]
160
+ else
161
+ const PAGES = [
162
+ " Julia Documentation" => " index.md" ,
163
+ " Manual" => Manual,
164
+ " Base" => BaseDocs,
165
+ " Standard Library" => StdlibDocs,
166
+ " Developer Documentation" => DevDocs
167
+ ]
168
+ end
169
+
151
170
for stdlib in STDLIB_DOCS
152
171
@eval using $ (stdlib. stdlib)
153
172
# All standard library modules get `using $STDLIB` as their global
@@ -161,7 +180,6 @@ DocMeta.setdocmeta!(UUIDs, :DocTestSetup, :(using UUIDs, Random), recursive=true
161
180
DocMeta. setdocmeta! (Pkg, :DocTestSetup , :(using Pkg, Pkg. Artifacts), recursive= true , warn= false )
162
181
DocMeta. setdocmeta! (Pkg. BinaryPlatforms, :DocTestSetup , :(using Pkg, Pkg. BinaryPlatforms), recursive= true , warn= false )
163
182
164
- const render_pdf = " pdf" in ARGS
165
183
let r = r" buildroot=(.+)" , i = findfirst (x -> occursin (r, x), ARGS )
166
184
global const buildroot = i === nothing ? (@__DIR__ ) : first (match (r, ARGS [i]). captures)
167
185
end
0 commit comments