Skip to content

Building doc (Documenter.jl)

Olivier Cots edited this page Aug 11, 2024 · 5 revisions

While it does not seem possible to add a dependence towards the current package when building the doc with GitHub CI, it is needed to build the doc locally. The following works (note the dev to enforce using the local version):

julia> Pkg.develop(path="/home/jcaillau/OptimalControl.jl"); include("make.jl"); Pkg.rm("OptimalControl")

If your package's name is MyPackage.jl and is contained in the root directory MyPackage or MyPackage.jl, you can make a macro to do the documentation:

macro documentation()
    Pkg.activate("docs")
    Pkg.develop(path=pwd())
    include("docs/make.jl")
    package=split(split(pwd(), "/")[end], ".")[1]
    Pkg.rm(package)
end

Just put the macro in the file: ~/julia/config/startup.jl don't forgetting a using Pkg. The macro is called in the root package.

@documentation
Clone this wiki locally