Skip to content

Commit

Permalink
literate actions on getting started and slight changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbanse committed Oct 19, 2023
1 parent 4e549f3 commit 5a448b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
19 changes: 9 additions & 10 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
using Dionysos
using Documenter, Literate

const EXAMPLES_DIR = joinpath(@__DIR__, "src", "examples")
const EXAMPLES_SOLVERS_DIR = joinpath(@__DIR__, "src", "examples", "solvers")
const EXAMPLES_UTILS_DIR = joinpath(@__DIR__, "src", "examples", "utils")

const REFERENCE_DIR = joinpath(@__DIR__, "src", "reference")
const OUTPUT_DIR = joinpath(@__DIR__, "src", "generated")

const EXAMPLES = readdir(EXAMPLES_DIR)
const EXAMPLES_SOLVERS = readdir(EXAMPLES_SOLVERS_DIR)
const EXAMPLES_UTILS = readdir(EXAMPLES_UTILS_DIR)
const REFERENCE = readdir(REFERENCE_DIR)

function literate_actions(file, output_dir)
Literate.markdown(file, output_dir)
Literate.notebook(file, output_dir)
return Literate.script(file, output_dir)
end

for example in EXAMPLES_SOLVERS
example_filepath = joinpath(EXAMPLES_SOLVERS_DIR, example)
Literate.markdown(example_filepath, OUTPUT_DIR)
Literate.notebook(example_filepath, OUTPUT_DIR)
Literate.script(example_filepath, OUTPUT_DIR)
literate_actions(joinpath(EXAMPLES_SOLVERS_DIR, example), OUTPUT_DIR)
end
for example in EXAMPLES_UTILS
example_filepath = joinpath(EXAMPLES_UTILS_DIR, example)
Literate.markdown(example_filepath, OUTPUT_DIR)
Literate.notebook(example_filepath, OUTPUT_DIR)
Literate.script(example_filepath, OUTPUT_DIR)
literate_actions(joinpath(EXAMPLES_UTILS_DIR, example), OUTPUT_DIR)
end
literate_actions(joinpath(@__DIR__, "src", "Getting Started.jl"), OUTPUT_DIR)

const _PAGES = [
"Index" => "index.md",
Expand Down
13 changes: 7 additions & 6 deletions docs/src/developers/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@ julia> using Revise

If you don't plan to test the examples, comment out the Literate part in `docs/make.jl`:
```julila
11 #for example in EXAMPLES
12 # example_filepath = joinpath(EXAMPLES_DIR, example)
13 # Literate.markdown(example_filepath, OUTPUT_DIR)
14 # Literate.notebook(example_filepath, OUTPUT_DIR)
15 # Literate.script(example_filepath, OUTPUT_DIR)
16 #end
20 # for example in EXAMPLES_SOLVERS
21 # literate_actions(joinpath(EXAMPLES_SOLVERS_DIR, example), OUTPUT_DIR)
22 # end
23 # for example in EXAMPLES_UTILS
24 # literate_actions(joinpath(EXAMPLES_UTILS_DIR, example), OUTPUT_DIR)
25 # end
26 # literate_actions(joinpath(@__DIR__, "src", "Getting Started.jl"), OUTPUT_DIR)
```
This will speed up building the documentation quite a lot.

Expand Down

0 comments on commit 5a448b0

Please sign in to comment.