jkitchin / ox-ipynb

org-mode exporter to Jupyter notebooks
170 stars 39 forks source link

Need for a publishing function #28

Closed bhugueney closed 3 years ago

bhugueney commented 3 years ago

Hi, Thank you for the great software which makes it a joy to work on Notebooks. I would like to have a git repository with org files that would be published (e.g. on gitlhub pages or gitlab pages) as Notebooks, in much the same way as html pages usually are. For that I would like to be able to use org-publish which takes a publishing function (among other parameters) as arguments. The org→html publishing function is org-html-publish-to-html , would it be possible to have an equivalent function for org→ipynb ?

What do you think ? Best Regards.

jkitchin commented 3 years ago

I pushed a function I have used for this in the last few weeks. Hopefully it works for you too.

bhugueney commented 3 years ago

Amazing ! Thank you for your fast helpful answer : I could already make a script (my first script in elisp called with emacs --script ! ☺) to convert a .org file to the corresponding .ipynb file. I guess I could make a Makefile, but I am still wondering about the org-publish thing. Is there any reason not to have an ipynb export backend to be used by a standard publishing function ?

jkitchin commented 3 years ago

I don't understand what you mean , this is a function you can use with org-publish. Here is an example of how I have used it.

("notebooks"
     :base-directory "/Users/jkitchin/Desktop/f19-06623/org/"
     :base-extension "org"
     :publishing-directory "/Users/jkitchin/Desktop/f19-06623/docs/notebooks"
     :recursive t
     :publishing-function ox-ipynb-publish-to-notebook
     :auto-preamble t)
bhugueney commented 3 years ago

Sorry for being dense, and thank you so much for the hand-holding ! I'm so happy to be able to publish my notebooks with your software.

Best Regards.