-
Notifications
You must be signed in to change notification settings - Fork 386
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
md to ipynb conversion does not create kernelspec in ipynb #230
Comments
Hello Tony, thanks for asking. Can you give a try at the jupytext README.md --to ipynb --update-metadata '{"kernelspec": {"display_name": "", "language": "", "name": ""}}' -o - | tail -n 18
|
That seems to work - thanks... I think there is also a PR going defensive on the Jupyter-book side. |
Thanks Tony. By the way, please let me know if you need more adjustments for interoperability with Jupyter-book, that's a great project. Is it correct that Jupytext + Jupyter-book will convert a (source) Markdown file to an Markdown file with outputs ? Do you think it would be interesting to mark the outputs in the Markdown file (say, with HTML comments), so that the source and output can be the same file ? I was considering trying something like this for #220... |
Jupyter Book converts ipynb or md to md thence html as part of a Jekyll publishing workflow. I think it just renders what you give it rather than executing notebooks (I really should read the docs!). I had a possible use case today around code outputs converting from a structured content (XML) format to md [about]. If the structured markup had been done right there would have been code and code output elements represented that would have been good to retain semantically in the md export, and thence render as such in a notebook generated from the md. Generally, though, pretty much anything can appear as code output (also need to distinguish Out [] elements from eg I need to play w/ Jupyter Book more esp. in context of Jupytext. eg if a Binder repo has ipynb,md Jupytext dualling enabled, it should emit md that could be copied straight into a github pages/jekyll Which is to say, there could be interesting publishing/editing worflows possible? |
@mwouts (Re: Jupyter Book, I'm just a user! (I'm never very sure about who's "allowed" to post to Github issues, so, erm, I increasingly do...)) |
@mwouts "Is it correct that Jupytext + Jupyter-book will convert a (source) Markdown file to an Markdown file with outputs ?" My workflow was:
What might be interesting would be a Jupyter Book switch to allow Jupyter Book to use Jupytext to turn md into ipynb, execute the ipynb, generate some md with code cell outputs, then publish the static site? |
In this project at least, issues are welcome! With them I've learnt so much, people told me about there use case, overall the interaction has been extremely positive... By the way I still do not have contributing guidelines here, so maybe I should make it clear that issues and PR are welcome... I will do that soon.
I agree, there's a series of cases in which we want to convert a text file to a notebook, and execute it. I plan to see what we can do at #231 - stay tuned ! |
I am hitting the same issue for #231... Papermill will not take a notebook with no kernel information. It should be reasonable to set the kernel that matches the current python env if the notebook is a Python notebook, and otherwise set the first kernel for the language being used. Let's see if we can do that... |
Just recall that |
@psychemedia , Version 1.1.4 will have a new
@nathancarter , thanks for your comment. Jupytext creates a Jupyter notebook from the |
Oh, right, I had forgotten that a notebook is associated with one kernel. Thanks. |
Version 1.1.4 is available on pypi, and has the |
i've been exploring using Jupyter Book for publishing from either
.md
or.ipynb
files.When using
.ipynb
files created from simple.md
files on commandline usingjupytext --to notebook *.md
, Jupyter Book throws an error from not findingkernelspec
data in the.ipynb
(jupyter-book/jupyter-book#195).If I load and save the notebook using Jupyter notebooks, a kernelspec element is saved into the
.ipynb
. Even if no specific kernel info is saved, should the Jupytext conversion from.md
create emptykernelspec
elements?The text was updated successfully, but these errors were encountered: