Docs workspace from Project.toml targets and extras?

I feel that I shouldn’t need to maintain a separate environment (Project and Manifest files) for my documentation build, but rather should be able to do it using the target and extras entries in the root Project.toml.

I recently opened this issue Feature request: more flexibility for Project extras and targets · Issue #3297 · JuliaLang/Pkg.jl · GitHub with a suggestion that would facilitate this.

In the mean time, I’m experimenting with this in one of my packages: GitHub - MarkNahabedian/AnotherParser.jl.

It’s documentation make file,AnotherParser.jl/make.jl at master · MarkNahabedian/AnotherParser.jl · GitHub tries to use Pkg.Operations.gen_target_project to produce a workspace that includes the projects listed in AnotherParser’s deps and “docs” target. Unfortunately, that manifest is missing AnotherParser itself.

Yes, I’m using undocumented types and functions in the guts of Pkg.jl. Thi is an experiment.

Can someone advise me how to fix this?

Thanks.

This is a bit orthogonal to targets/extras, but I think it is actually be cleaner if you do have a separate Project.toml for the docs environment. However, it would be awesome if that environment would be an extension of the package’s environment, which is where sub-projects come in:

So my two cents would be that it might be worth seeing how hard it is to hack a proof-of-concept implementation together for sub-projects.

Hi again.

Thanks for pointing out that issue.

I still think that generalizing target’s/extras seems more straightforward.

This is a bit orthogonal to targets/extras, but I think it is actually be cleaner if you do have a separate Project.toml for the docs environment. However, it would be awesome if that environment would be an extension of the package’s environment, which is where sub-projects come in:

https://github.com/JuliaLang/Pkg.jl/issues/1233

So my two cents would be that it might be worth seeing how hard it is to hack a proof-of-concept implementation together for sub-projects.