Closed prudhomm closed 1 year ago
Jupyter supports various kernels for different languages eg C++ Julia, Rust ...
Is it configurable? I wonder if we should make it configurable? If the kernel is not available/enabled then I guess it would be preferable to generate a Markdown cell?
@prudhomm could you please provide a notebook which uses a Jupyter kernel for the C++ programming language? I want to check the value of the metadata
field in the ipynb
file.
Currently, we are using:
{
"metadata":{
"language_info": {
"name": "python",
"version": "3.9.1"
}
}
}
I found an example file at: https://github.com/jupyter-xeus/xeus-cling
{
"metadata": {
"kernelspec": {
"name": "xcpp17",
"display_name": "C++17",
"language": "C++17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "17"
}
}
}
By default, we should probably set the kernelspec
as follows:
{
"metadata": {
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
}
}
}
Great you found the information. Do you need something else?
@ggrossetie le notebook is ok under vscode but not in jupyter an extra space is probably needly after/before code blocks
notebook is ok under vscode but not in jupyter an extra space is probably needly after/before code blocks
This should be fixed by https://github.com/neo4j-documentation/asciidoctor-jupyter/pull/28
Great you found the information. Do you need something else?
We need to decide how to configure the kernel. Currently, we are using:
:jupyter-language-name:
-> metadata.language_info.name
:jupyter-language-version:
-> metadata.language_info.version
I think we should introduce two additional attributes:
:jupyter-kernel-name:
-> metadata.kernelspec.name
:jupyter-kernel-language:
-> metadata.kernelspec.language
We should probably use :jupyter-language-name:
to decide which code blocks we should convert to code cells. For backward compatiblity, if :jupyter-language-name:
is equals to python
, we will convert both python
and py
code blocks to code cells.
this seems to be a good plan !
Jupyter supports various kernels for different languages eg C++ Julia, Rust ... it would nice to generate code cells automatically when we have
here is an example https://deploy-preview-9--cours-cpp-incandescent-llama-63edb8.netlify.app/cours-cpp/cours1/#_les_flux_dentr%C3%A9essorties
you can. download the jupyter file asciidoctor-jupyter does not generate a code cell but rather a markdown cell with code. I generated it by hand after and show the image below