From a258427130fe7af61bc87c19bc0c2f47503e74af Mon Sep 17 00:00:00 2001 From: webofceco Date: Fri, 23 Aug 2024 21:51:32 -0400 Subject: [PATCH 1/2] docs update --- .github/workflows/Documenter.yml | 2 ++ docs/Project.toml | 6 ++++++ docs/make.jl | 32 ++++++++++++++++---------------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 7bd6425..217b672 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -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 diff --git a/docs/Project.toml b/docs/Project.toml index 7d0a02c..ad8d580 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -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" \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index 0e932e0..636dad3 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -7,7 +7,7 @@ DocTestMeta = quote end DocMeta.setdocmeta!(HTTR, :DocTestSetup, DocTestMeta; recursive=true) -Documenter.makedocs( +makedocs( modules=[HTTR], clean=true, doctest=false, @@ -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" ) \ No newline at end of file From 528368d4fb3e78fe4451d24c0ddba615581180cb Mon Sep 17 00:00:00 2001 From: webofceco Date: Sat, 24 Aug 2024 16:26:11 -0400 Subject: [PATCH 2/2] docs update --- docs/genfiles.jl | 27 ++++++++++++++------------- docs/mkdocs.yml | 6 +++--- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/genfiles.jl b/docs/genfiles.jl index a19d31e..62134bb 100644 --- a/docs/genfiles.jl +++ b/docs/genfiles.jl @@ -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 \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index e133fe1..794a590 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -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 @@ -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 @@ -116,4 +116,4 @@ plugins: #- mkdocs-video nav: - "Home": "index.md" - - "Reference" : "reference.md" \ No newline at end of file + - "Reference": "reference.md" \ No newline at end of file