You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting Rmarkdown files to .ipnb files, code cell language information eliminated. (It should be in code section metadata) The example file is attached:
A single Stencila document can have CodeChunks containing a variety of languages, but the .ipynb format only allows for a single language at the top level in kernelspec. So to solve this I think we need to iterate over all the CodeChunks and set the kernelspec.name to the most common language (in this case R).
Thanks for your answer @nokome, basically we have multi language .rmd files. We are looking for a way to extract the language blocks without loosing their language tag. We initially thought we could use encoda for this. We see now that going through .ipynb format is not suitable for this task. What format would you recommend we use? We already tried .json, .xml, .html but couldn't get any success.
When converting Rmarkdown files to .ipnb files, code cell language information eliminated. (It should be in code section metadata) The example file is attached:
The .rmd file which is wanted to convert------>
title: example
output: html_notebook
The .ipynb file which is converted by stencila/encoda------->
{
"nbformat": 4,
"nbformat_minor": 4,
"metadata": {
"title": "example"
},
"cells": [
{
"cell_type": "code",
"metadata": {},
"execution_count": 1,
"source": [
"print(1)"
],
"outputs": []
},
{
"cell_type": "code",
"metadata": {},
"execution_count": 1,
"source": [
"print(1)"
],
"outputs": []
}
]
}
Code language information in metadata expected like:
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
The text was updated successfully, but these errors were encountered: