-
-
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
WIP: Output Pluto-flavored notebooks. #120
base: master
Are you sure you want to change the base?
Conversation
This is not recorded in the file from what I can tell, so not sure how that would be possible. |
Folding of cells (if I correctly understand what is meant by that) does appear to be encoded in the file - compare the following two lines
The first is folded and the second is unfolded. Thanks for doing this, I'm looking forward to being able to use it! |
Oh wow, that is extremely subtle. I was also looking at the wrong place, it was in the list of UUIDs and not for the cells. |
Okay, you can now fold cells with cell metadata. I set the default to fold markdown (why would you ever want to show it?) and to show for code. |
Yes, I ended up reading the notebook loading code in Pluto to find out how it was storing the folded state! |
Hey @fredrikekre, thanks for working on this! I don't mean to push you, but I'd really love to use Pluto flavored notebooks in my homepage using |
I think it works, please try it. |
Worked for me with Julia 1.5 , https://juliaclimate.github.io/IndividualDisplacements.jl/dev/basics/random_flow_field/ , on macOS Super useful feature that I will frequently use to turn doc examples into interactive demos. Sometimes As I first tried to run this in the very folder where the original file is (i.e. Thanks @fredrikekre !!! |
Is the reverse (i.e. Pluto to Documenter/Literate ingestion) also feasible? I feel it should be and I would use that too. Maybe that case is already treated or planned? |
What work needs to be done here to merge? I'd be happy to help with finishing touches. |
Does it work? I have not really tested this with anything fancy. |
since this has been in the works for a while and has been requested by many people, maybe it would be good to merge now and fix residual problems as they come up |
I can try this next week, I'll be away from my computer until then. |
Again this would be great to have merged so we can use it, even if incomplete or a bit buggy. But it seems to work fine for me. |
Since this comment, I realized that I could just use PlutoSliderServer.jl as part of building the docs and move files in place as needed. In case that helps someone else with their use case, there is an example in ClimateModels.jl |
What is currently blocking merging this as-is - Is it just a rebase and getting the tests passing? |
Basically I just lack self-interest in this feature since I am not such a huge fan of Pluto notebooks. It is quite a different format and requires quite a lot of special casing in my experience so not so easy to map directly between formats. But if people still like this I can rebase and merge, but help with maintanence would certainly be appreciated. |
I'll probably use this in a low-key way for documentation going forward, so I'd be happy to fix any bugs I find with it. |
I'm encountering strange behaviour when generating a markdown file within the same script. So this works fine: # Literate.markdown(@__FILE__, DIR_OUTPUT, execute=false) #src
Literate.notebook(@__FILE__, DIR_OUTPUT, execute=true) #src
Literate.notebook(@__FILE__, DIR_OUTPUT, execute=false, flavor=:pluto) #src But this Literate.markdown(@__FILE__, DIR_OUTPUT, execute=false) #src
Literate.notebook(@__FILE__, DIR_OUTPUT, execute=true) #src
Literate.notebook(@__FILE__, DIR_OUTPUT, execute=false, flavor=:pluto) #src throws an error, even though the keyword "flavor=:pluto" is not specified in
|
Are you using Literate from within Literate? |
Do you mean, am I calling the conversion from within the script I want converted? Yes. It's a convenient workflow. Should I not do this? |
Okay, recent changes seem to have broken something. Now I can't get pluto converter to work at all. Here's a MWE using Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/fredrikekre/Literate.jl", rev="fe/pluto")
#-
x = 1:100
#-
y = rand(100)
using Literate #src
const DIR_OUTPUT = joinpath(DIR, "..") #src
Literate.notebook(@__FILE__, DIR_OUTPUT, flavor=:pluto) #src If I execute this file I get
If I create a separate file to generate the conversion I get the same error. |
I updated from using a symbol to use |
I wonder if a better design would be to regard Pluto notebooks and Juptyer notebooks as completely separate, rather than two "notebook" flavours. The reason is they require different processing because of differences in figure handling and package management, for example. With a single filter added Mmm. It actually seems that #nb only signals a contribution to the Juptyer notebooks, and not the Pluto ones?? |
Pluto.jl output would be a great feature to have, I think, esp. to offer tutorials and the like in script, Jupyter and Pluto format. |
No description provided.