Skip to content

Commit f487350

Browse files
committed
Add basic documentation
1 parent 95c3f79 commit f487350

File tree

7 files changed

+381
-3
lines changed

7 files changed

+381
-3
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
name: CI
22
on:
3-
- push
4-
- pull_request
3+
push:
4+
branches:
5+
- 'master'
6+
tags: '*'
7+
paths-ignore:
8+
- 'README.md'
9+
- '.github/workflows/**'
10+
pull_request:
11+
paths-ignore:
12+
- 'README.md'
13+
- '.github/workflows/**'
514
jobs:
615
test:
16+
if: "!contains(github.event.head_commit.message, 'skip ci')"
717
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
818
runs-on: ${{ matrix.os }}
919
strategy:
1020
fail-fast: false
1121
matrix:
1222
version:
1323
- '1.0' # earliest supported
14-
- '1.5' # latest release
24+
- '1' # latest release
1525
- 'nightly'
1626
os:
1727
- ubuntu-latest
@@ -40,3 +50,13 @@ jobs:
4050
${{ runner.os }}-
4151
- uses: julia-actions/julia-buildpkg@latest
4252
- uses: julia-actions/julia-runtest@latest
53+
docs:
54+
name: Documentation
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v2
58+
- uses: julia-actions/julia-buildpkg@latest
59+
- uses: julia-actions/julia-docdeploy@latest
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/Manifest.toml
2+
/docs/build/
3+
/docs/Manifest.toml

docs/Project.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[deps]
2+
BitFlags = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
3+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
5+
UnixMmap = "674b2976-56af-439b-a2b1-837be4a3d087"
6+
7+
[compat]
8+
Documenter = "0.25.2"

docs/make.jl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using Documenter, UnixMmap
2+
include(joinpath(@__DIR__, "sys_override.jl"))
3+
4+
doctest = "--fix" in ARGS ? :fix :
5+
"--test" in ARGS ? true : false
6+
7+
DocMeta.setdocmeta!(UnixMmap, :DocTestSetup, :(using UnixMmap); recursive=true)
8+
9+
makedocs(
10+
sitename = "UnixMmap.jl",
11+
authors = "Justin Willmert",
12+
doctest = doctest,
13+
doctestfilters = Regex[
14+
r"Ptr{0x[0-9a-f]+}",
15+
r"[0-9\.]+ seconds \(.*\)"
16+
],
17+
format = Documenter.HTML(;
18+
prettyurls = get(ENV, "CI", "false") == "true",
19+
canonical = "https://jmert.github.io/UnixMmap.jl",
20+
assets = String[],
21+
mathengine = Documenter.MathJax3(),
22+
),
23+
pages = [
24+
"Home" => "index.md",
25+
"API Reference" => [
26+
"Public" => "lib/public.md",
27+
]
28+
],
29+
repo = "https://github.com/jmert/UnixMmap.jl/blob/{commit}{path}#L{line}",
30+
)
31+
32+
deploydocs(
33+
repo = "github.com/jmert/UnixMmap.jl",
34+
push_preview = true,
35+
)

docs/src/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# UnixMmap.jl Documentation
2+
3+
## Library API Reference
4+
```@contents
5+
Pages = [
6+
"lib/public.md",
7+
]
8+
Depth = 1
9+
```

docs/src/lib/public.md

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
```@meta
2+
CurrentModule = UnixMmap
3+
```
4+
# Public Documentation
5+
6+
## Functions
7+
8+
The following functions are available on all Unix systems.
9+
10+
```@docs
11+
UnixMmap.mmap
12+
UnixMmap.mincore
13+
UnixMmap.madvise!
14+
```
15+
16+
OS-specific constants for use with [`mmap`](@ref) and [`madvise!`](@ref) are defined at
17+
(pre)compile time. The following systems are supported based on the available OS
18+
predicates via Julia's `Base.Sys.KERNEL` and `Base.Sys.is*` functions (some of which are
19+
only available for Julia v1.1+).
20+
21+
## Constants — Linux
22+
23+
```@example Linux
24+
import ..LinuxMmap: UnixMmap # hide
25+
import Main._flag_docs # hide
26+
```
27+
```@raw html
28+
<table>
29+
<thead>
30+
<tr><td><code>MmapProtection</code></td>
31+
<td><code>MmapFlags</code></td>
32+
<td><code>AdviseFlags</code></td>
33+
</tr>
34+
</thead>
35+
<tbody>
36+
<tr>
37+
<td>
38+
```
39+
```@example Linux
40+
_flag_docs(UnixMmap.MmapProtection) # hide
41+
```
42+
```@raw html
43+
</td>
44+
<td>
45+
```
46+
```@example Linux
47+
_flag_docs(UnixMmap.MmapFlags) # hide
48+
```
49+
```@raw html
50+
</td>
51+
<td>
52+
```
53+
```@example Linux
54+
_flag_docs(UnixMmap.AdviseFlags) # hide
55+
```
56+
```@raw html
57+
</td>
58+
</tr>
59+
</tbody>
60+
</table>
61+
```
62+
63+
## Constants — Apple
64+
65+
```@example Apple
66+
import ..AppleMmap: UnixMmap # hide
67+
import Main._flag_docs # hide
68+
```
69+
```@raw html
70+
<table>
71+
<thead>
72+
<tr><td><code>MmapProtection</code></td>
73+
<td><code>MmapFlags</code></td>
74+
<td><code>AdviseFlags</code></td>
75+
</tr>
76+
</thead>
77+
<tbody>
78+
<tr>
79+
<td>
80+
```
81+
```@example Apple
82+
_flag_docs(UnixMmap.MmapProtection) # hide
83+
```
84+
```@raw html
85+
</td>
86+
<td>
87+
```
88+
```@example Apple
89+
_flag_docs(UnixMmap.MmapFlags) # hide
90+
```
91+
```@raw html
92+
</td>
93+
<td>
94+
```
95+
```@example Apple
96+
_flag_docs(UnixMmap.AdviseFlags) # hide
97+
```
98+
```@raw html
99+
</td>
100+
</tr>
101+
</tbody>
102+
</table>
103+
```
104+
105+
## Constants — DragonFly BSD
106+
107+
```@example DragonFly
108+
import ..DragonFlyMmap: UnixMmap # hide
109+
import Main._flag_docs # hide
110+
```
111+
```@raw html
112+
<table>
113+
<thead>
114+
<tr><td><code>MmapProtection</code></td>
115+
<td><code>MmapFlags</code></td>
116+
<td><code>AdviseFlags</code></td>
117+
</tr>
118+
</thead>
119+
<tbody>
120+
<tr>
121+
<td>
122+
```
123+
```@example DragonFly
124+
_flag_docs(UnixMmap.MmapProtection) # hide
125+
```
126+
```@raw html
127+
</td>
128+
<td>
129+
```
130+
```@example DragonFly
131+
_flag_docs(UnixMmap.MmapFlags) # hide
132+
```
133+
```@raw html
134+
</td>
135+
<td>
136+
```
137+
```@example DragonFly
138+
_flag_docs(UnixMmap.AdviseFlags) # hide
139+
```
140+
```@raw html
141+
</td>
142+
</tr>
143+
</tbody>
144+
</table>
145+
```
146+
147+
## Constants — FreeBSD
148+
149+
```@example FreeBSD
150+
import ..FreeBSDMmap: UnixMmap # hide
151+
import Main._flag_docs # hide
152+
```
153+
```@raw html
154+
<table>
155+
<thead>
156+
<tr><td><code>MmapProtection</code></td>
157+
<td><code>MmapFlags</code></td>
158+
<td><code>AdviseFlags</code></td>
159+
</tr>
160+
</thead>
161+
<tbody>
162+
<tr>
163+
<td>
164+
```
165+
```@example FreeBSD
166+
_flag_docs(UnixMmap.MmapProtection) # hide
167+
```
168+
```@raw html
169+
</td>
170+
<td>
171+
```
172+
```@example FreeBSD
173+
_flag_docs(UnixMmap.MmapFlags) # hide
174+
```
175+
```@raw html
176+
</td>
177+
<td>
178+
```
179+
```@example FreeBSD
180+
_flag_docs(UnixMmap.AdviseFlags) # hide
181+
```
182+
```@raw html
183+
</td>
184+
</tr>
185+
</tbody>
186+
</table>
187+
```
188+
189+
## Constants — NetBSD
190+
191+
```@example NetBSD
192+
import ..NetBSDMmap: UnixMmap # hide
193+
import Main._flag_docs # hide
194+
```
195+
```@raw html
196+
<table>
197+
<thead>
198+
<tr><td><code>MmapProtection</code></td>
199+
<td><code>MmapFlags</code></td>
200+
<td><code>AdviseFlags</code></td>
201+
</tr>
202+
</thead>
203+
<tbody>
204+
<tr>
205+
<td>
206+
```
207+
```@example NetBSD
208+
_flag_docs(UnixMmap.MmapProtection) # hide
209+
```
210+
```@raw html
211+
</td>
212+
<td>
213+
```
214+
```@example NetBSD
215+
_flag_docs(UnixMmap.MmapFlags) # hide
216+
```
217+
```@raw html
218+
</td>
219+
<td>
220+
```
221+
```@example NetBSD
222+
_flag_docs(UnixMmap.AdviseFlags) # hide
223+
```
224+
```@raw html
225+
</td>
226+
</tr>
227+
</tbody>
228+
</table>
229+
```
230+
231+
## Constants — OpenBSD
232+
233+
```@example OpenBSD
234+
import ..OpenBSDMmap: UnixMmap # hide
235+
import Main._flag_docs # hide
236+
```
237+
```@raw html
238+
<table>
239+
<thead>
240+
<tr><td><code>MmapProtection</code></td>
241+
<td><code>MmapFlags</code></td>
242+
<td><code>AdviseFlags</code></td>
243+
</tr>
244+
</thead>
245+
<tbody>
246+
<tr>
247+
<td>
248+
```
249+
```@example OpenBSD
250+
_flag_docs(UnixMmap.MmapProtection) # hide
251+
```
252+
```@raw html
253+
</td>
254+
<td>
255+
```
256+
```@example OpenBSD
257+
_flag_docs(UnixMmap.MmapFlags) # hide
258+
```
259+
```@raw html
260+
</td>
261+
<td>
262+
```
263+
```@example OpenBSD
264+
_flag_docs(UnixMmap.AdviseFlags) # hide
265+
```
266+
```@raw html
267+
</td>
268+
</tr>
269+
</tbody>
270+
</table>
271+
```
272+

0 commit comments

Comments
 (0)