Skip to content

Commit a52a8e0

Browse files
authored
Merge pull request #151 from Herb-AI/refactor/documentation-ci
Refactor documentation workflow
2 parents 751a9b4 + 69013bc commit a52a8e0

26 files changed

+1173
-2751
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Documentation
33
on:
44
push:
55
branches:
6-
- documentation # update to match your development branch (master, main, dev, trunk, ...)
6+
- master # update to match your development branch (master, main, dev, trunk, ...)
77
tags: '*'
88
pull_request:
99

@@ -14,14 +14,6 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up Python 3.10
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: "3.10"
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
python -m pip install --upgrade jupyterlab nbconvert
2517
- uses: julia-actions/setup-julia@v1
2618
with:
2719
version: '1'

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Herb"
22
uuid = "c09c6b7f-4f63-49de-90d9-97a3563c0f4a"
33
authors = ["Jaap de Jong <jaapdejong15@gmail.com>", "Tilman Hinnerichs <t.r.hinnerichs@tudelft.nl>", "Sebastijan Dumancic <s.dumancic@tudelft.nl>"]
4-
version = "0.6.0"
4+
version = "0.6.1"
55

66
[deps]
77
HerbConstraints = "1fa96474-3206-4513-b4fa-23913f296dfc"

docs/Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
DocumenterMermaid = "a078cd44-4d9c-4618-b545-3ab9d77f9177"
34
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
45
Herb = "c09c6b7f-4f63-49de-90d9-97a3563c0f4a"
56
HerbConstraints = "1fa96474-3206-4513-b4fa-23913f296dfc"
@@ -11,9 +12,7 @@ HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f"
1112
HerbSpecification = "6d54aada-062f-46d8-85cf-a1ceaf058a06"
1213
Kroki = "b3565e16-c1f2-4fe9-b4ab-221c88942068"
1314
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
14-
PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"
1515
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"
16-
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
1716
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
1817
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
1918
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

docs/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,33 @@ This documentation was created using [Documenter.jl](https://documenter.juliadoc
77
The majority of the documentation of automatically generated from the respective docstrings of each sub-package.
88
There are some pages that were added manually and can be edited likewise. New pages can 1. easily be written in markdown and 2. added to the site-tree by editing `docs/make.jl`.
99

10+
## Tutorial notebooks
11+
The tutorials are written as Pluto notebooks and can be found in `docs/src/tutorials/`. To ensure that both CI builds and manual execution use the same dependencies as defined in `docs/Project.toml`, each tutorial notebook should include the following cell at the top:
12+
```julia
13+
begin
14+
import Pkg
15+
Pkg.activate(Base.current_project())
16+
Pkg.instantiate()
17+
18+
# Your package imports ...
19+
end
20+
```
21+
Note that this disables Pluto's built-in package manager.
22+
1023
## Compiling the documentation
11-
Compiling is automatically triggered whenever pushing to this branch. If you want to run the documentation locally run `julia --project=. make.jl` in this directory.
24+
Compiling is automatically triggered whenever pushing to this branch.
25+
26+
If you want to run the documentation locally run `julia --project=. make.jl` from this directory.
27+
Once built successfully, the documentation is generated in the directory `docs/build`. You can preview it by either opening `docs/build/index.html` in a browser,
28+
or by using `LiveServer`:
29+
```
30+
julia --project=. -e 'using Pkg; Pkg.add("LiveServer"); using LiveServer; serve(dir="build")'
31+
```
32+
The documentation will be available at http://localhost:8000.
1233

1334
## Help!
1435

1536
If help is needed reach out to [THinnerichs](https://github.com/thinnerichs).
37+
38+
#### Note
39+
The `other` folder contains some old material that is not hosted on our website.

docs/build_notebooks.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
using PlutoStaticHTML
22

3+
"""
4+
Builds the Pluto notebooks in the specified directory.
5+
As part of the build, all notebooks are executed to make sure there is no
6+
deprecated code.
7+
"""
38
function build(tutorials_dir)
49
@info "Building notebooks in $tutorials_dir"
510
use_distributed = false
611
output_format = documenter_output
712
bopts = BuildOptions(tutorials_dir; use_distributed, output_format)
813
build_notebooks(bopts)
9-
end
14+
end

docs/make.jl

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Documenter: HTML, deploydocs, makedocs
2+
using DocumenterMermaid
23
using Herb
34
using Pkg
45
using PlutoStaticHTML
@@ -11,15 +12,22 @@ build(tutorials_dir)
1112

1213
# NOTE: tutorials should be added manually on the homepage (src/index.md)
1314
makedocs(
14-
modules=[HerbConstraints, HerbSearch, HerbGrammar, HerbSpecification, HerbInterpret, HerbCore],
15+
modules=[
16+
HerbConstraints,
17+
HerbSearch,
18+
HerbGrammar,
19+
HerbSpecification,
20+
HerbInterpret,
21+
HerbCore,
22+
],
1523
authors="PONYs",
1624
sitename="Herb.jl",
1725
pages=[
1826
"Basics" => [
1927
"index.md",
2028
"install.md",
21-
"get_started.md",
22-
"concepts.md"
29+
"Getting Started" => "tutorials/basic_getting_started.md",
30+
"concepts.md",
2331
],
2432
"Tutorials" => [
2533
"A more verbose getting started with Herb.jl" => "tutorials/getting_started_with_herb.md",
@@ -43,13 +51,13 @@ makedocs(
4351
sidebar_sitename=false,
4452
size_threshold=2^20,
4553
),
46-
warnonly=[:missing_docs, :cross_references, :doctest]
54+
warnonly=[:missing_docs, :cross_references, :doctest],
4755
)
4856

4957
deploydocs(;
5058
repo="github.com/Herb-AI/Herb.jl.git",
51-
devbranch="documentation",
59+
devbranch="master",
5260
# devurl="dev",
53-
push_preview=true
61+
push_preview=true,
5462
)
5563

224 KB
Loading
87.9 KB
Loading

docs/src/assets/julia_pkg.png

114 KB
Loading

docs/src/assets/julia_repl.png

19.4 KB
Loading

0 commit comments

Comments
 (0)