LuxDL / DocumenterVitepress.jl

Documentation with Documenter.jl and VitePress
https://luxdl.github.io/DocumenterVitepress.jl/
MIT License
62 stars 9 forks source link

copy assets folder just before creating .documenter and final_site #159

Closed lazarusA closed 1 week ago

lazarusA commented 1 week ago

In the current implementation it looks like we copy the assets folders immediately. However, because I want to save some files coming from doctest blocks first, the build fails later, because those files were never copied, because they didnt' exist yet.

Where should I be looking? @asinghvi17

asinghvi17 commented 1 week ago

That shouldn't be the case...Markdown expansion (including explicit saving and doctests) is done in docs/build and only then are files copied to docs/build/.documenter. This is to say that all Documenter files are executed under cd(first(splitdir(page.path))).

Are you saving directly to assets or something? And are you sure doctests are being run during the build?

lazarusA commented 1 week ago

Working here: https://github.com/rafaqz/Rasters.jl/tree/la/new_vite_docs

in a .jl file from the. I have

savefig(a, "src/assets/api/mosaic_example_africa.png")
nothing
# output

Individual continents

![arica](assets/api/mosaic_example_africa.png)

which saves the output into docs/src/assets/api/. It does save things correctly there, but, then they are not copied to .documenter.

I tried several ways of saving things (like /assets/api/ directly), but none did work. Hints?

asinghvi17 commented 1 week ago

try using public instead of assets maybe?

lazarusA commented 1 week ago

thanks for the hint!

when doing doctests we need to save the output into docs/build/, namely, savefig(a, "build/my_ouput.png")

asinghvi17 commented 1 week ago

Huh, that's a bit strange. Possibly worth an issue on Documenter.jl, since doctests should be executed in the workdir.