Skip to content

Commit c124bf9

Browse files
adigitoleoViralBShah
authored andcommitted
docs: Add headers for easier Core, Base and stdlib reference (#55311)
This adds one new section (h2) and a nested subsection (h3) to the landing page of the Julia documentation website and associated PDF file. The new section provides a quick overview of the differences between `Core`, `Base` and the standard library, as well as a list of links to standard library packages. The list of standard library packages is thus duplicated in the website sidebar, but I don't think this is an issue because the sidebar is primarily intended for navigation, whereas this list is primarily intended to be used for referencing purposes. Partially addresses #28712, although I don't provide short descriptions of each standard library package. I think the appropriate place for that would be in module-level docstrings of the packages themselves, which are not currently available. --------- Co-authored-by: Viral B. Shah <[email protected]> (cherry picked from commit abb104c)
1 parent 05fb4a1 commit c124bf9

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

doc/src/base/base.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ where
112112
[]
113113
```
114114

115-
## Standard Modules
115+
## [Standard Modules](@id standard-modules)
116116
```@docs
117117
Main
118118
Core
119119
Base
120120
```
121121

122-
## Base Submodules
122+
## [Base Submodules](@id base-submodules)
123123
```@docs
124124
Base.Broadcast
125125
Base.Docs

doc/src/index.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ and [Ruby](https://en.wikipedia.org/wiki/Ruby_(programming_language)).
7676

7777
The most significant departures of Julia from typical dynamic languages are:
7878

79-
* The core language imposes very little; Julia Base and the standard library are written in Julia itself, including
79+
* The core language imposes very little; [Julia Base and the standard library](@ref man-core-base-and-stdlib) are written in Julia itself, including
8080
primitive operations like integer arithmetic
8181
* A rich language of types for constructing and describing objects, that can also optionally be
8282
used to make type declarations
@@ -126,3 +126,40 @@ language. In addition to the above, some advantages of Julia over comparable sys
126126
* Call C functions directly (no wrappers or special APIs needed)
127127
* Powerful shell-like capabilities for managing other processes
128128
* Lisp-like macros and other metaprogramming facilities
129+
130+
## [Julia Standard Modules and the Standard Library](@id man-standard-modules-stdlib)
131+
132+
The Julia runtime comes with [standard modules](@ref standard-modules),
133+
which are essential namespaces that are usually loaded automatically.
134+
135+
```@docs; canonical=false
136+
Core
137+
Base
138+
```
139+
140+
Julia's `Base` module contains various [useful submodules](@ref base-submodules).
141+
142+
### [The Standard Library](@id man-stdlib)
143+
144+
The Julia standard library contains additional, commonly used packages that are installed alongside the Julia runtime by default.
145+
To use a standard library package, it is first necessary to load the package with a [`using`](@ref) or [`import`](@ref) statement.
146+
Links to available standard library packages are provided below,
147+
and may also be found in the website sidebar.
148+
Their source code is available in the `Sys.STDLIB` directory of a Julia installation.
149+
150+
```@eval
151+
import Markdown
152+
list = sort(filter(x -> match(r"_jll$", x) === nothing, readdir(Sys.STDLIB)))
153+
Markdown.parse(join("- [`" .* list .* "`](stdlib/" .* list .* ".html)", "\n"))
154+
```
155+
156+
Julia also provides various standard, pre-built binary libraries
157+
of established software that is written in other languages.
158+
By convention, these packages have names that end with `_jll`.
159+
The [`using`](@ref) statement can load symbol names from these binary libraries:
160+
161+
```@eval
162+
import Markdown
163+
list = sort(filter(x -> match(r"_jll$", x) !== nothing, readdir(Sys.STDLIB)))
164+
Markdown.parse(join("- [`" .* list .* "`](stdlib/" .* list .* ".html)", "\n"))
165+
```

0 commit comments

Comments
 (0)