-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Seamless interoperability with jupytext #131
Comments
Can you post an example of the jupytext output? |
https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/blob/2d84c74da733ab74665c141b0698da01a08cd1f2/examples/gaussianprocesspriors.jl and https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/blob/2d84c74da733ab74665c141b0698da01a08cd1f2/examples/kernel_ridge_regression.jl though I already made some changes to get it to play along a bit better. Notable differences are that Literate.jl exclusively uses |
The rendered (Literate.jl/Documenter.jl) output is here: https://juliagaussianprocesses.github.io/KernelFunctions.jl/previews/PR234/examples/gaussianprocesspriors/ and https://juliagaussianprocesses.github.io/KernelFunctions.jl/previews/PR234/examples/kernel_ridge_regression/ (I'm not sure why the first one doesn't actually render the figures, whereas it works fine for the second one 🤔) |
Thanks. It is strange that some math work and other don't. |
To get rid of the function remove_header(str)
str = replace(str, r"^(.*coding: utf-8.*)$"m => ""; count=1)
end should work I think. |
Handling |
Thank you. This workaround could get rid off |
Note that it is also easy to parse Jupyter notebooks and output See this discourse post for example — replace Would it be possible to support this directly in Literate.jl, e.g. allowing one to use Jupyter notebooks directly as the input format? |
I've been writing some examples as jupyter notebooks, saved using jupytext as .jl files. I find it helpful to write equations in the jupyter notebook to get instant rendering - but unfortunately I can't directly get this and use Literate.jl because of the discrepancy between using
$$ $$
or```math ```
for display maths, and the extra-- coding: utf-8 --
at the top of the .jl file that doesn't get stripped away. Would you be willing to consider including something like a `jupytext::Bool`` flag that would handle these minor discrepancies and allow seamless use of the same file both for editing in jupyter and for turning into documentation? If you're up for this in general, I'd be happy to discuss how this could look & contribute a PR.The text was updated successfully, but these errors were encountered: