-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Pluto notebooks with Quarto files #279
base: main
Are you sure you want to change the base?
Conversation
Can you pin point me to the cell that provides the issue? Variant 1: If possible one could write a show method that outputs markdown instead (or an additional show method for that)? Variant 2, either in the corresponding code block or a new (hidden) one (you can hide quarto code blocks in rendering):
this way the output of this quarto code block is a raw html block for documenter. Though I would personally prefer something like variant 1 if possible. |
I tried to look at this locally, but could not get it to work.
I am not sure how to resolve this, since I am not sure where this messages – it seems to be even 2? – come from. So I can no say much more than my generic posts from before. |
Thanks for looking at this!
This is the cell in quarto: ArviZ.jl/docs/src/quickstart.qmd Lines 122 to 129 in 3e54ecf
InferenceData object has an HTML show method defined here: https://github.com/arviz-devs/InferenceObjects.jl/blob/12c402d7e06cf8fe404f418ffc958c8c9c20ac89/src/inference_data.jl#L192-L203
The desired HTML result uses interactive dropdown elements (using the HTML struct RawOutput
content
type::String
end
function Base.show(io::IO, ::MIME"text/markdown", o::RawOutput)
print(io, "````@raw $(o.type)")
show(io, "text/$(o.type)", o.content)
println(io)
println(io, "````")
return nothing
end
RawOutput(idata_turing_post, "html") but quarto ends up escaping the backticks, so Documenter can't recognize this as a valid
An awful hack would be to post-process all Quarto-rendered markdown files in
Yes, this is necessary when building docs for unregistered breaking releases.
Looks like you've installed ArviZ before, so your Conda.jl environment has an outdated version of the Python package installed. You'll need to update ArviZ. If using Conda for Python deps installations, do using Conda
Conda.add("arviz>=0.13.0"; channel="conda-forge") (this all used to happen with interactive messages at load time, but since v1.9 seems to happen during precompilation, where interactivity is not possible, so it just errors) |
So I have now fought with Conda for a while and I just give up, I can vary the error message quite a bit, but it never installs arviz, some dependencies might be wrong? I mean, my usual experiences with Python are: I have more python versions installed than I have ever run python (no, I reduced that to just one again by now) and that what ever I follow in python installation ideas is the same as bash: It works exactly on the machine of the person that wrote the tutorial. But usually not on mine. You could try wrapping the raw html in a (even longer back-ticked) raw common mark block as
We already do that for Concerning the show method – this is not a real markdown, since it is a raw-html-markdown-encapsulation, but I am not sure to what to translate the outer div or the inner details tag, the pre-code combination is of course just a backticks block. |
My idea for a markdown (ignoring basically the summary and details tags) would be something like
|
I tried different ways of using
For me this would not be acceptable. Most of the time one doesn't need or want to inspect the contents of an I think I'll try my bad solution of post-processing the MD files, and if that doesn't work abandon using Quarto until Documenter (Julia?) has better support for CommonMark. |
Hm, that is not a common mark problem but a problem that markdown does not have any notation to fold something (which I suppose the details tag does?)., but then sure, modifying the html output and wrap it in If the code is a bit ugly you can hide this display code and only show the output (and omit the output of the current cell). It seems that if you are that dependent on html output, maybe some other method that does more HTML-like output is preferable here. |
Oh, nice fix :) |
Yeah it's a little more general than what we need (it handles nested divs, but we don't nest them), but I wrote it this way to point others to the solution. Basically, it assumes
The nice thing about handling it this way is that the quarto file as a standalone still will render correctly. |
```{julia} | ||
df = DataFrame(idata.posterior) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this block does not render the table due to quarto-dev/quarto-cli#6134 (see https://arviz-devs.github.io/ArviZ.jl/previews/PR279/creating_custom_plots/)
Loosely follows https://forem.julialang.org/kellertuer/render-quarto-tutorials-in-documenterjl-with-github-actions-3fo.
This has the benefit that the markdown part of the examples is parsed using Documenter, so we can reference docstrings in the same docs build. It has the downside that Julia's markdown parses does not parse the HTML representation of
InferenceData
, which is probably a dealbreaker for this PR unless we can find a workaround.