Skip to content

Commit

Permalink
Merge pull request #5 from cecoeco/main
Browse files Browse the repository at this point in the history
docs
  • Loading branch information
cecoeco authored Oct 27, 2024
2 parents 1fcc90f + 528368d commit 58876ba
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- uses: julia-actions/cache@v1
with:
cache-registries: "true"
- name: Install HTTR package # use this since HTTR is not in the registry
run: julia -e 'using Pkg; Pkg.add(url="https://github.com/TidierOrg/HTTR.jl")'
- name: Install documentation dependencies
run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate()'
- name: Build and deploy
Expand Down
6 changes: 6 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterMarkdown = "997ab1e6-3595-5248-9280-8efb232c3433"
HTTR = "4055d0b1-be8f-4929-99f5-a1ae5cc18666"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"

[compat]
Documenter = "0.27"
DocumenterMarkdown = "0.2"
HTTR = "0.0.1"
Literate = "2"
27 changes: 14 additions & 13 deletions docs/genfiles.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
using Documenter, DocumenterMarkdown, Literate

get_example_path(p) = joinpath(@__DIR__, ".", "examples", p)
OUTPUT = joinpath(@__DIR__, "src", "examples", "generated")

folders = readdir(joinpath(@__DIR__, ".", "examples"))
function get_example_path(p)
return joinpath(@__DIR__, ".", "examples", p)
end

function getfiles()
srcsfiles = []
for f in folders
names = readdir(joinpath(@__DIR__, ".", "examples", f))
fpaths = "$(f)/" .* names
for folder in readdir(joinpath(@__DIR__, ".", "examples"))
names = readdir(joinpath(@__DIR__, ".", "examples", folder))
fpaths = "$(folder)/" .* names
srcsfiles = vcat(srcsfiles, fpaths...)
end

return srcsfiles
end

srcsfiles = getfiles()

for (d, paths) in (("tutorial", srcsfiles),)
for p in paths
Literate.markdown(get_example_path(p), joinpath(OUTPUT, dirname(p));
documenter=true)
for (d, paths) in ("tutorial", getfiles())
for path in paths
Literate.markdown(
get_example_path(path),
joinpath(@__DIR__, "src", "examples", "generated", dirname(path)),
documenter=true
)
end
end
32 changes: 16 additions & 16 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DocTestMeta = quote
end
DocMeta.setdocmeta!(HTTR, :DocTestSetup, DocTestMeta; recursive=true)

Documenter.makedocs(
makedocs(
modules=[HTTR],
clean=true,
doctest=false,
Expand All @@ -22,31 +22,31 @@ Documenter.makedocs(
# Other available options are
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block,
# :footnote, :meta_block, :missing_docs, :setup_block
],
checkdocs=:all,
format=DocumenterMarkdown.Markdown(),
],
checkdocs=:all,
format=Markdown(),
draft=false,
build=joinpath(@__DIR__, "docs")
)

Documenter.deploydocs(
devurl="latest",
repo="https://github.com/TidierOrg/HTTR.jl",
deploydocs(
devurl="latest",
repo="https://github.com/TidierOrg/HTTR.jl",
push_preview=true,
deps=Deps.pip(
"mkdocs",
"pygments",
"python-markdown-math",
"mkdocs",
"pygments",
"python-markdown-math",
"mkdocs-material",
"pymdown-extensions",
"mkdocstrings",
"mkdocstrings",
"mknotebooks",
"pytkdocs_tweaks",
"mkdocs_include_exclude_files",
"jinja2",
"pytkdocs_tweaks",
"mkdocs_include_exclude_files",
"jinja2",
"mkdocs-video"
),
make=() -> Base.run(`mkdocs build`),
target="site",
make=() -> Base.run(`mkdocs build`),
target="site",
devbranch="main"
)
6 changes: 3 additions & 3 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ theme:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: crimson
accent: teal
accent: crimson
toggle:
icon: material/weather-sunny
name: Switch to dark mode
Expand All @@ -39,7 +39,7 @@ theme:
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: crimson
accent: teal
accent: crimson
toggle:
icon: material/weather-night
name: Switch to light mode
Expand Down Expand Up @@ -116,4 +116,4 @@ plugins:
#- mkdocs-video
nav:
- "Home": "index.md"
- "Reference" : "reference.md"
- "Reference": "reference.md"

0 comments on commit 58876ba

Please sign in to comment.