oxinabox / ipynb2literatejulia Goto Github PK
View Code? Open in Web Editor NEWNBConverter stuff to convert Jupyter Notebooks in to Julia Literate.jl files (This is the opposite of Literate.jl)
License: MIT License
NBConverter stuff to convert Jupyter Notebooks in to Julia Literate.jl files (This is the opposite of Literate.jl)
License: MIT License
If this repo is a package, you should generate a UUID and add it to Project.toml.
If this repo is not a package, you should uninstall TagBot. Otherwise, TagBot will keep erroring, e.g.: https://github.com/JuliaRegistries/TagBot/issues/78#issuecomment-591837422
This seems to fail on nbconvert 6.0.7:
jupyter nbconvert --to script "$1" --config literate_config.py --template=literate.tpl
(Same with --template-file=literate.tpl
)
Skipping the --template=literate.tpl
makes it run, but the markdown cells are dropped.
The changelog mentions changes to the template system
""
literate_run_nbconvert(;OutputDir="",ConfigDir="")
Convert all Julia ipynb notebooks to jl files, using nbconvert
# Input
- `OutputDir::String`: path to output folder
- `ConfigDir::String`: path to where literate_config.py and literate.tpl are
"""
function literate_run_nbconvert(;OutputDir="",ConfigDir="")
Files = filter(x->endswith(lowercase(x),".ipynb"), readdir())
ConfigFile = joinpath(ConfigDir,"literate_config.py")
TemplFile = joinpath(ConfigDir,"literate.tpl")
for i = 1:length(Files)
printstyled("\n\n-------------Converting $(Files[i])-------------\n",color=:blue)
run(`jupyter nbconvert --to script $(Files[i]) --output-dir $OutputDir --config $ConfigFile --template $TemplFile --Application.log_level='DEBUG'`)
end
end
(This is a great little utility BTW, so thanks for it!)
I think it would be nice to be able to do something like
bash literate_run_nbconvert.sh demo/ODEIntroduction.ipynb another_output_folder
to specify another_output_folder
๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.