Closed dominic-chang closed 4 months ago
your format should look like this:
format=DocumenterVitepress.MarkdownVitepress(
repo = "github.com/LuxDL/DocumenterVitepress.jl", # this must be the full URL!
devbranch = "master",
devurl = "dev";
could you try with that? please.
Sorry, I copied and pasted the incorrect make.jl
file. My formatter is actually this
format=DocumenterVitepress.MarkdownVitepress(
repo = "https://dchang10.github.io/Krang.jl", # this must be the full URL!
devbranch = "main",
devurl = "dev",
#clean_md_output = true
;
)
I've edited the original post to reflect this.
Here's an example of a markdown file. I generate these with Literate.jl
\`\`\`@meta
EditURL = "../../../examples/test_example.jl"
\`\`\`
\`\`\`\`@example test_example
using Krang
using CairoMakie
curr_theme = Theme(
Axis = (
xticksvisible = false,
xticklabelsvisible = false,
yticksvisible = false,
yticklabelsvisible = false,
),
)
set_theme!(merge!(curr_theme, theme_latexfonts()))
fig = Figure(resolution=(700, 700));
CairoMakie.heatmap!(Axis(fig[1,1]), rand(100,100))
save("test.png", fig)
\`\`\`\`
![image](test.png)
---
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
This results in a page that looks like this
while the equivalent page with the default Documenter.HTML
formatter looks like this:
As a temporary workaround you can split the codeblocks with the last line in the first block being fig
and then saving in a separate block. See https://lux.csail.mit.edu/dev/tutorials/intermediate/5_BayesianNN#prediction-visualization
Thanks, that works for the example case I gave, but I also use these images in other places in my docs. This method also doesn't seem to work for animations. I typically get around this by generating gifs to render.
recording = CairoMakie.record(fig, "radius.gif", range(0.0, π, length=180), framerate=12) do θs
draw!(axes, camera, observation, rmin, rmax, θs, flag)
end
# ![image](radius.gif)
Anyway of getting the other markdown pages to be able to render those images?
I think I understand the source of the error. The images are not rendering because Documenter.jl
replaces the ![](image.png)
markdown with its own Documenter.LocalImage("image.png")
which vite
does not recognize when building.
I believe this might be fix on the next release, could you please try master ?
Thanks. That worked!
I’m struggling to include images in markdown files with
DocumenterVitepress.jl
The final site renders with aDocumenter.LocalImage("image.png")
instead of the actual image.Here is my
config.mts
and my
make.jl