Nbdev for julia

Wondering if there is anything with similar functionality as nbdev (GitHub - fastai/nbdev: Create delightful python projects using Jupyter Notebooks) for Julia or if it might make sense to get this working for Julia?

1 Like

I don’t know which functionality your are looking for, but https://github.com/fredrikekre/Literate.jl might be worth a try.

2 Likes

Thanks for the link. This definitely looks very useful. It does seem different in that it starts from a julia file and can generate markdown, notebooks or cleaned julia script whereas nbdev is based around the notebook as the starting point. nbdev also helps out with boiler plate tasks like creating package (setup.py for python), CI and documentation generation.

for package templates, see

1 Like

I would also look at Steven Johnson’s NBInclude.jl which lets you import code from Jupyter notebooks like so:

using NBInclude
@nbinclude("myfile.ipynb")
4 Likes

nbdev seems to be built on top of `jupyter notebook (as far as I can tell it is all client-side modifications). It might just work with the existing IJulia kernel if you select the kernel in a new notebook – have you tried that?

3 Likes

Hi @nmoran I am not sure if you are still looking out for something similar to nbdev for Julia. I was also looking for something similar but I found that the closest thing to nbdev in Julia world is Litrate.jl. However in Litrate.jl it’s the reverse i.e. the source is a Julia file and then you can generate markadown, scripts or notebook from there.

I have worked in nbdev and wanted something similar to nbdev, so I was thinking about leveraging Litrate,jl and existing tooling in ipython to build a Julia version of nbdev.

It would be great if people in the community can join me in developing this idea further.

4 Likes

I’m also interested in using something like nbdev in julia, @satyabrata_pal any success on finding something similar to it? Like everyone said, Literate.jl does the reverse.

GitHub - fonsp/Pluto.jl: 🎈 Simple reactive notebooks for Julia has arguably a much better editing environment and storage format than nbdev. IMO it would be the best place to start from if you wanted an nbdev equivalent.

3 Likes

Did anyone try this?

Hi @satyabrata_pal , I haven’t found something that really replaces nbdev but have started using Literate.jl in some of my workflows. I’d definitely be willing to help out and contribute to this though.

@EvoArt, no I haven’t tried using nbdev with the existing IJulia kernel. This could be a good starting point if it worked well could create a package which automatically sets up nbdev in the same python environment that IJulia uses for jupyter.

@ToucheSir Pluto.jl does look like the future. Seemed to lack some basic features when I tried it a while back like the ability to use packages from specific environment, but maybe these have been addressed.

@sgaseretto @ToucheSir @EvoArt @nmoran

As a matter of fact I am working on a project to bring nbdev to Julia. My project(nbdev.jl) starts with a pluto notebook as base, from here a Julia project can be generated. I am using MKdocs as the document generator.

Currently I am successful in generating markdown documents and source code files. As next steps I am working on automatic generation of table of contents, mkdocs yaml file. The task of automatic deployment to github pages and package creation is in roadmap.

I would love to have contributors on this project as I have fairly new to Julia and having more experienced people would make the project better and would speed up things.

Those who are interested can take a peek here. This is the repository for Nbdev.jl.

I must say that the current code here is not in the best possible shape considering my experience in Julia and also I started this project as an MVP. I believe that the involvement of more minds can definitely prove to be useful.

4 Likes

Great! I’ll take a look at it and try to contribute!

Thanks. I will try to update the readme this week ro give a clear picture of the roadmap , docs etc.

1 Like

In general, you can use Pkg in Pluto for environment management.
Additionally, in the next Pluto release (or current main branch) there is a new automatic package managment which guarantees reproducible notebooks.
More information about both points is here:

3 Likes

Just made a quick update to the project README.

2 Likes

@satyabrata_pal great, will keep track of progress and contribute if I can.

@lungben the new package management features look great. Will try these out.

3 Likes

I am trying to automate the process of creating the Mkdocs.yml file. This would be used to lay down instructions for Mkdocs like theme and other configurations.

I was planning to use python’s yaml package to parse the Mkdocs.yml file and then write the configurations to it. Anyone have any idea about any package in Julia which can parse and write yaml?

Or on second thought would it be better not to generate the contents of the Mkdocs.yml file but let the user to edit the file.

Nbdev.jl now has the following abilities →

  • Create source files from pluto notebooks.
  • Create documentation from pluto notebooks(by using mkdocs)
  • Create README from index file.

Next I am trying to add automatic deployment of the documents to github pages and creating a short tutorial to get started with whatever is available so far in this project.

Also, if enough people here are interested in the progress of this project then I would create a separate thread in the forum to update regarding the progress of nbdev.jl.

9 Likes

Have you tried Documenter.jl, we might have to automate some of the processes to suite our needs though. If you are ok, I can try it out and create a PR.