From e98bee23d226bcb629e4fb5b5dde6c3644cf2bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 18 Sep 2023 03:15:12 +0200 Subject: [PATCH] [docs] update to Documenter@1 (#2266) --- .github/workflows/documentation.yml | 8 +++++++- .gitignore | 1 + docs/Project.toml | 2 +- docs/make.jl | 18 ++++++++++++++++-- docs/src/assets/custom.sty | 7 ------- 5 files changed, 25 insertions(+), 11 deletions(-) delete mode 100644 docs/src/assets/custom.sty diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a6ab731926..1123f295ba 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -24,7 +24,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key - run: julia --project=docs/ docs/make.jl + DOCUMENTER_LATEX_DEBUG: ${{ github.workspace }}/latex-debug-logs + run: julia --color=yes --project=docs/ docs/make.jl + - uses: actions/upload-artifact@v3 + if: ${{ always() }} + with: + name: PDF build logs + path: ${{ github.workspace }}/latex-debug-logs - uses: errata-ai/vale-action@reviewdog with: files: docs/src diff --git a/.gitignore b/.gitignore index 1da8dace7b..dba455fa46 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ test/Benchmarks/*.json Manifest.toml *.swp docs/src/release_notes.md +docs/src/MathOptInterface.pdf diff --git a/docs/Project.toml b/docs/Project.toml index 6c594cc34a..0c18617ad0 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -5,6 +5,6 @@ JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" [compat] -Documenter = "0.27.10" +Documenter = "1" JSON = "0.21" JSONSchema = "1" diff --git a/docs/make.jl b/docs/make.jl index cca95433be..c17691ed5c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -120,6 +120,10 @@ end # Build the HTML docs # ============================================================================== +# Needed to make Documenter think that there is a PDF in the right place when +# link checking. Inn production we replace this by running the LaTeX build. +write(joinpath(@__DIR__, "src", "MathOptInterface.pdf"), "") + @time Documenter.makedocs( sitename = "MathOptInterface", authors = "The JuMP core developers and contributors", @@ -128,9 +132,18 @@ end prettyurls = get(ENV, "CI", nothing) == "true", mathengine = Documenter.MathJax2(), collapselevel = 1, + # Do no check for large pages. + size_threshold_ignore = [ + "changelog.md", + "release_notes.md", + "reference/models.md", + "reference/standard_form.md", + "submodules/Bridges/list_of_bridges.md", + "submodules/Bridges/reference.md", + "submodules/Utilities/reference.md", + ], ), clean = true, - strict = true, linkcheck = true, linkcheck_ignore = [ # Ignore the PDF link, because it hasn't been built yet. @@ -168,7 +181,8 @@ if _PDF # includes lots of extraneous LaTeX files. cp( joinpath(@__DIR__, "latex_build", "MathOptInterface.pdf"), - joinpath(@__DIR__, "build", "MathOptInterface.pdf"), + joinpath(@__DIR__, "build", "MathOptInterface.pdf"); + force = true, ) end diff --git a/docs/src/assets/custom.sty b/docs/src/assets/custom.sty deleted file mode 100644 index ee34fc36de..0000000000 --- a/docs/src/assets/custom.sty +++ /dev/null @@ -1,7 +0,0 @@ -% Override the default styling of {minted} in LaTeX output -\usepackage{minted,xcolor} -\definecolor{codeblock-color}{gray}{0.96} -\definecolor{codeblock-color2}{gray}{0.8} -\setminted{bgcolor=codeblock-color,frame=none} -\lstset{rulecolor=\color{codeblock-color2},frame=single} -%