Documenter.jl - how to add package

I’m developing a package called UnitfulAstrodynamics, which is hosted on GitHub. I’m using Documenter.jl for documentation, and I have a docs/ folder at the top level of the package.

The GitHub action julia-actions/julia-docdeploy@latest uses docs/Project.toml to instantiate all the dependencies for makeing the documentation.

The documentation requires UnitfulAstrodynamics, but I’m not sure how to best include all UnitfulAstrodynamics/Project.toml dependencies in UnitfulAstrodynamics/docs/Project.toml.

So far, I’ve used:

cd UnitfulAstrodynamics/docs
julia --project # activates UnitfulAstrodynamics/docs/Project.toml
]add Documenter
]add ..

This seems to track the version of my project that is stored in Github (as defined by UnitfulAstrodynamics/Manifest.toml). That’s often fine, but when I define new types locally, and then try to make and serve the documentation locally for testing, the documentation doesn’t recognize the new types because they’re not yet pushed to GitHub.

Other packages that use Documenter.jl seem to include the top level package in docs/Project.toml. One example is ControlSystems.jl/docs/Project.toml. Are other developers running into the same issue I am? Otherwise, how should I best ]add UnitfulAstrodynamics to UnitfulAstrodynamics/docs/Project.toml?

1 Like

The problem is ]add .. which should be ]dev ..; you want to track the path, not the most recent commit. You will get something like https://github.com/fredrikekre/Literate.jl/blob/5db8c22fcfe74470d1ab836d566afbc8a9e86d9f/docs/Manifest.toml#L193 in the manifest.

6 Likes