diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c0c38b0a5..5532c8a99 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -13,9 +13,9 @@ jobs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@latest - - uses: actions/cache@v1 + - uses: actions/cache@v3 env: cache-name: cache-artifacts with: @@ -30,6 +30,7 @@ jobs: using Pkg Pkg.Registry.add(RegistrySpec(url="https://github.com/NQCD/NQCRegistry")) Pkg.Registry.add(RegistrySpec(url="https://github.com/JuliaMolSim/MolSim")) + Pkg.Registry.add(RegistrySpec(url="https://github.com/ACEsuit/ACEregistry")) Pkg.Registry.add(RegistrySpec(name="General")) shell: julia {0} @@ -43,9 +44,10 @@ jobs: Pkg.instantiate() shell: julia --project=docs/ {0} - - uses: julia-actions/julia-docdeploy@latest + - name: Build and deploy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988 + run: julia --project=docs/ docs/make.jl diff --git a/docs/Project.toml b/docs/Project.toml index ecea436ed..d0c942a01 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -28,3 +28,4 @@ UnitfulRecipes = "42071c24-d89e-48dd-8a24-8a12d9b8861f" [compat] Documenter = "0.27" +DocumenterCitations = "1" diff --git a/docs/make.jl b/docs/make.jl index b97888de7..ea8565109 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -7,7 +7,7 @@ DocMeta.setdocmeta!(NQCDynamics, :DocTestSetup, :(using NQCDynamics); recursive= DocMeta.setdocmeta!(NQCModels, :DocTestSetup, :(using NQCModels, Symbolics); recursive=true) DocMeta.setdocmeta!(NQCBase, :DocTestSetup, :(using NQCBase); recursive=true) -bib = CitationBibliography(joinpath(@__DIR__, "references.bib"), sorting=:nyt) +bib = CitationBibliography(joinpath(@__DIR__, "references.bib")) function find_all_files(directory) map( @@ -18,17 +18,17 @@ end @time makedocs( bib, - sitename = "NQCDynamics.jl", - modules = [NQCDynamics, NQCDistributions, NQCModels, NQCBase, CubeLDFAModel], - strict = true, - format = Documenter.HTML( - prettyurls = get(ENV, "CI", nothing) == "true", - canonical = "https://nqcd.github.io/NQCDynamics.jl/stable/", - assets = ["assets/favicon.ico"], - ansicolor = true, - ), - authors = "James Gardner and contributors.", - pages = [ + sitename="NQCDynamics.jl", + modules=[NQCDynamics, NQCDistributions, NQCModels, NQCBase, CubeLDFAModel], + strict=true, + format=Documenter.HTML( + prettyurls=get(ENV, "CI", nothing) == "true", + canonical="https://nqcd.github.io/NQCDynamics.jl/stable/", + assets=["assets/favicon.ico", "assets/citations.css"], + ansicolor=true, + ), + authors="James Gardner and contributors.", + pages=[ "Introduction" => "index.md" "Getting started" => "getting_started.md" "Atoms" => "atoms.md" @@ -64,7 +64,7 @@ end if get(ENV, "CI", nothing) == "true" deploydocs( - repo = "github.com/NQCD/NQCDynamics.jl", + repo="github.com/NQCD/NQCDynamics.jl", push_preview=true ) end diff --git a/docs/src/assets/citations.css b/docs/src/assets/citations.css new file mode 100644 index 000000000..4c6af0bb2 --- /dev/null +++ b/docs/src/assets/citations.css @@ -0,0 +1,18 @@ +.citation dl { + display: grid; + grid-template-columns: max-content auto; } +.citation dt { + grid-column-start: 1; } +.citation dd { + grid-column-start: 2; + margin-bottom: 0.75em; } +.citation ul { + padding: 0 0 2.25em 0; + margin: 0; + list-style: none;} +.citation ul li { + text-indent: -2.25em; + margin: 0.33em 0.5em 0.5em 2.25em;} +.citation ol li { + padding-left:0.75em;} +