diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ac1560a..d486ff7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,7 +2,7 @@ version: 2 updates: - - package-ecosystem: "github-actions" + - package-ecosystem: github-actions directory: "/" schedule: interval: "weekly" diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 9b00c12..e4ee926 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -19,7 +19,7 @@ jobs: uses: julia-actions/setup-julia@latest with: version: '1' - arch: ${{ runner.arch }} + # arch: ${{ runner.arch }} if: steps.julia_in_path.outcome != 'success' - name: "Add the General registry via Git" run: | @@ -43,3 +43,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + +# based on: +# https://github.com/JuliaRegistries/CompatHelper.jl diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index debd2c6..390476b 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -20,7 +20,7 @@ jobs: - uses: julia-actions/setup-julia@latest with: version: '1' - - name: Cache artifacts + - name: CacheArtifacts uses: actions/cache@v4 env: cache-name: cache-artifacts @@ -31,7 +31,7 @@ jobs: ${{ runner.os }}-test-${{ env.cache-name }}- ${{ runner.os }}-test- ${{ runner.os }}- - - name: Install dependencies + - name: InstallDependencies run: | julia --project=docs/ -e ' ENV["JULIA_PKG_SERVER"] = "" diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml new file mode 100644 index 0000000..c344f6d --- /dev/null +++ b/.github/workflows/SpellCheck.yml @@ -0,0 +1,13 @@ +name: Spell Check + +on: [pull_request] + +jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@master diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index f49313b..6d2efc1 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,9 +1,11 @@ name: TagBot + on: issue_comment: types: - created workflow_dispatch: + jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' diff --git a/Project.toml b/Project.toml index c565f47..57571fa 100644 --- a/Project.toml +++ b/Project.toml @@ -7,5 +7,5 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" [compat] -Polynomials = "1, 2, 3" +Polynomials = "1, 2, 3, 4" julia = "1.6" diff --git a/docs/inc/reproduce.jl b/docs/inc/reproduce.jl new file mode 100644 index 0000000..8b64f28 --- /dev/null +++ b/docs/inc/reproduce.jl @@ -0,0 +1,9 @@ + +# ### Reproducibility + +# This page was generated with the following version of Julia: +using InteractiveUtils: versioninfo +io = IOBuffer(); versioninfo(io); split(String(take!(io)), '\n') + +# And with the following package versions +import Pkg; Pkg.status() diff --git a/docs/inc/urls.jl b/docs/inc/urls.jl new file mode 100644 index 0000000..0aab175 --- /dev/null +++ b/docs/inc/urls.jl @@ -0,0 +1,14 @@ + +#= +This page comes from a single Julia file: +[`@__NAME__.jl`](xxxrepo/@__NAME__.jl). + +You can access the source code +for such Julia documentation +using the 'Edit on GitHub' link in the top right. +You can view the corresponding notebook in +[nbviewer](https://nbviewer.org/) here: +[`@__NAME__.ipynb`](xxxnb/@__NAME__.ipynb), +or open it in [binder](https://mybinder.org/) here: +[`@__NAME__.ipynb`](xxxbinder/@__NAME__.ipynb). +=# diff --git a/docs/lit/examples/1-overview.jl b/docs/lit/examples/1-overview.jl index 1b119b4..5bb2965 100644 --- a/docs/lit/examples/1-overview.jl +++ b/docs/lit/examples/1-overview.jl @@ -17,6 +17,9 @@ supports Toeplitz, Hankel, and circulant matrices. =# +#srcURL + + # ### Setup # Packages needed here. @@ -88,6 +91,7 @@ Kahan(5, 3, 0.5, 0) # Kahan(3, 5, 0.5, 1e-3) + #= ## `Riemann` matrix @@ -140,3 +144,6 @@ V \ a # V' \ V[3,:] + + +include("../../../inc/reproduce.jl") diff --git a/docs/make.jl b/docs/make.jl index 0ee5bed..c6c10bf 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -2,8 +2,8 @@ execute = isempty(ARGS) || ARGS[1] == "run" org, reps = :JuliaLinearAlgebra, :SpecialMatrices eval(:(using $reps)) -using Documenter -using Literate +import Documenter +import Literate # https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#@example-block ENV["GKSwstype"] = "100" @@ -15,8 +15,7 @@ src = joinpath(@__DIR__, "src") gen = joinpath(@__DIR__, "src/generated") base = "$org/$reps.jl" -repo_root_url = - "https://github.com/$base/blob/main" +repo_root_url = "https://github.com/$base/blob/main" nbviewer_root_url = "https://nbviewer.org/github/$base/tree/gh-pages/dev/generated/examples" binder_root_url = @@ -24,16 +23,43 @@ binder_root_url = repo = eval(:($reps)) -DocMeta.setdocmeta!(repo, :DocTestSetup, :(using $reps); recursive=true) +Documenter.DocMeta.setdocmeta!(repo, :DocTestSetup, :(using $reps); recursive=true) + +# preprocessing +inc1 = "include(\"../../../inc/reproduce.jl\")" + +function prep_markdown(str, root, file) + inc_read(file) = read(joinpath("docs/inc", file), String) + repro = inc_read("reproduce.jl") + str = replace(str, inc1 => repro) + urls = inc_read("urls.jl") + file = joinpath(splitpath(root)[end], splitext(file)[1]) + tmp = splitpath(root)[end-3:end] # docs lit demos 00 + urls = replace(urls, + "xxxrepo" => joinpath(repo_root_url, tmp...), + "xxxnb" => joinpath(nbviewer_root_url, tmp[end]), + "xxxbinder" => joinpath(binder_root_url, tmp[end]), + ) + str = replace(str, "#srcURL" => urls) +end + +function prep_notebook(str) + str = replace(str, inc1 => "", "#srcURL" => "") +end for (root, _, files) in walkdir(lit), file in files splitext(file)[2] == ".jl" || continue # process .jl files only ipath = joinpath(root, file) opath = splitdir(replace(ipath, lit => gen))[1] - Literate.markdown(ipath, opath; documenter = execute, # run examples - repo_root_url, nbviewer_root_url, binder_root_url) - Literate.notebook(ipath, opath; execute = false, # no-run notebooks - repo_root_url, nbviewer_root_url, binder_root_url) + Literate.markdown(ipath, opath; + repo_root_url, + preprocess = str -> prep_markdown(str, root, file), + documenter = execute, # run examples + ) + Literate.notebook(ipath, opath; + preprocess = prep_notebook, + execute = false, # no-run notebooks + ) end @@ -48,10 +74,10 @@ format = Documenter.HTML(; prettyurls = isci, edit_link = "main", canonical = "https://$org.github.io/$repo.jl/stable/", -# assets = String[], + assets = ["assets/custom.css"], ) -makedocs(; +Documenter.makedocs(; modules = [repo], sitename = "$repo.jl", format, @@ -63,7 +89,7 @@ makedocs(; ) if isci - deploydocs(; + Documenter.deploydocs(; repo = "github.com/$base", devbranch = "main", devurl = "dev", diff --git a/docs/src/assets/custom.css b/docs/src/assets/custom.css new file mode 100644 index 0000000..31e6549 --- /dev/null +++ b/docs/src/assets/custom.css @@ -0,0 +1,3 @@ +.docs-sourcelink { + opacity:1 !important; +}