Skip to content

Commit 90ba7e9

Browse files
authored
Merge pull request #3229 from ERGO-Code/od/update-docs
[docs] update to Documenter@1 and Clang@0.19
2 parents 7a425e4 + 3750126 commit 90ba7e9

8 files changed

Lines changed: 45 additions & 67 deletions

File tree

.github/workflows/documentation.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v6
12+
- uses: actions/checkout@v7
1313
- uses: julia-actions/setup-julia@latest
1414
with:
15-
version: '1.9'
15+
version: '1.12'
16+
- name: Install dependencies
17+
shell: julia --color=yes --project=docs/ {0}
18+
run: |
19+
using Pkg
20+
Pkg.instantiate()
1621
- name: Build and deploy
22+
run: julia --project=docs/ --color=yes docs/make.jl
1723
env:
1824
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
run: julia --project=docs/ docs/make.jl

docs/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Manifest.toml
2-
c_api_gen/libhighs.jl
2+
libhighs.jl

docs/Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44

55
[compat]
6-
#Clang = "0.14, 0.17, 0.18"
7-
Documenter = "0.27"
6+
Clang = "0.19"
7+
Documenter = "1"
8+
julia = "1.12"

docs/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ To edit the documentation, checkout a branch and edit the Markdown files in the
99

1010
## Building the documentation
1111

12-
To build locally, [install Julia](https://julialang.org/downloads/), then (from the `docs` directory) run:
12+
To build locally, [install Julia](https://julialang.org/downloads/), then, from
13+
the repository root, run:
1314

1415
``` bash
15-
$ julia make.jl
16+
$ julia --project=docs -e 'using Pkg; Pkg.instantiate()'
17+
$ julia --project=docs docs/make.jl
1618
```
1719

1820
The first time you run this command, Julia will download and install the

docs/c_api_gen/HConfig.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/c_api_gen/build.jl

Lines changed: 0 additions & 48 deletions
This file was deleted.

docs/make.jl

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,35 @@
66
* *
77
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *=#
88

9-
import Pkg
10-
Pkg.activate(@__DIR__)
11-
Pkg.instantiate()
12-
139
import Documenter
1410

1511
# ==============================================================================
1612
# Parse and build docstrings from the C API
1713
# ==============================================================================
1814

19-
const libhighs = ""
20-
include(joinpath(@__DIR__, "c_api_gen", "build.jl"))
21-
include(joinpath(@__DIR__, "c_api_gen", "libhighs.jl"))
15+
import Clang
16+
17+
let
18+
highs = joinpath(dirname(@__DIR__), "highs")
19+
c_api = joinpath(highs, "interfaces", "highs_c_api.h")
20+
ctx = Clang.Generators.create_context(
21+
[c_api, joinpath(highs, "util", "HighsInt.h")],
22+
vcat(Clang.Generators.get_default_args(), "-I$highs"),
23+
Dict(
24+
"general" => Dict(
25+
"library_name" => "libhighs",
26+
"output_file_path" => joinpath(@__DIR__, "libhighs.jl"),
27+
"print_using_CEnum" => false,
28+
"extract_c_comment_style" => "doxygen",
29+
),
30+
),
31+
)
32+
Clang.Generators.build!(ctx)
33+
include(joinpath(@__DIR__, "libhighs.jl"))
34+
end
35+
36+
# Add a docstring for HighsInt
37+
@doc " HighsInt\n\nThe constant `Cint`." HighsInt
2238

2339
# ==============================================================================
2440
# Make the documentation
@@ -33,16 +49,15 @@ Documenter.makedocs(
3349
prettyurls = get(ENV, "CI", nothing) == "true",
3450
highlights = ["yaml"],
3551
),
36-
strict = !("strict=false" in ARGS),
3752
doctest = ("doctest=only" in ARGS) ? :only : true,
3853
repo = "https://github.com/ERGO-Code/HiGHS/tree/latest{path}",
3954
linkcheck = false,
4055
linkcheck_ignore = [
4156
"https://crates.io/crates/highs",
4257
"https://crates.io/crates/good_lp",
4358
"https://link.springer.com/article/10.1007/s12532-017-0130-5",
44-
"https://link.springer.com/article/10.1007/s12532-020-00181-8",
45-
"https://github.com/ERGO-Code/HiGHS/blob/master/highs/Highs.h"
59+
"https://link.springer.com/article/10.1007/s12532-020-00181-8",
60+
"https://github.com/ERGO-Code/HiGHS/blob/master/highs/Highs.h"
4661
],
4762
pages = [
4863
"About" => "index.md",

docs/src/interfaces/c_api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# [C](@id c-api)
22

3+
```@docs
4+
HighsInt
5+
```
6+
37
```@autodocs
48
Modules = [Main]
59
Filter = t -> startswith("$t", "Highs")

0 commit comments

Comments
 (0)