Problem
When used with Jupytext, Voila can be configured to render many different file types. However, the preview extension only allows notebooks. I can configure JupyterLab to open markdown in Voila preview by default, but it does not work, because the preview factory does not allow it.
{
"@jupyterlab/docmanager-extension:plugin": {
"defaultViewers": {
"notebook": "Voila Preview"
}
}
}
Proposed Solution
Add markdown to the list of allowed file types.
Jupytext notebooks can also be saved as code. Other than listing all possible file types, which might have undesirable side effects, I'm not sure how to handle those formats. Perhaps look at how the Jupytext extension does it? Nonetheless, even if markdown was the only format added, it would be an improvement.
Additional context
As a workaround, I tried patching extension assets to add markdown to allowed file types, which does work.
grep -Fl '{name:"Voila Preview",fileTypes:["notebook"],modelName:"notebook"}' share/jupyter/labextensions/@voila-dashboards/jupyterlab-preview/static/*.js | xargs sed -i 's/name:"Voila Preview",fileTypes:\["notebook"\],modelName:"notebook"}/{name:"Voila Preview",fileTypes:\["notebook","markdown"\],modelName:"notebook"}/'
Problem
When used with Jupytext, Voila can be configured to render many different file types. However, the preview extension only allows notebooks. I can configure JupyterLab to open markdown in Voila preview by default, but it does not work, because the preview factory does not allow it.
{ "@jupyterlab/docmanager-extension:plugin": { "defaultViewers": { "notebook": "Voila Preview" } } }voila/packages/jupyterlab-preview/src/index.ts
Line 146 in 3c9d384
Proposed Solution
Add
markdownto the list of allowed file types.Jupytext notebooks can also be saved as code. Other than listing all possible file types, which might have undesirable side effects, I'm not sure how to handle those formats. Perhaps look at how the Jupytext extension does it? Nonetheless, even if markdown was the only format added, it would be an improvement.
Additional context
As a workaround, I tried patching extension assets to add
markdownto allowed file types, which does work.