feat(#121): add support for org files

This commit is contained in:
tdurieux
2022-07-22 09:14:33 +02:00
parent 604f7de0a0
commit 51d9aa7a17
4 changed files with 1740 additions and 35 deletions
+17
View File
@@ -1340,6 +1340,9 @@ angular
if (extension == "md") {
return "md";
}
if (extension == "org") {
return "org";
}
if (extension == "ipynb") {
return "IPython";
}
@@ -1380,6 +1383,20 @@ angular
$scope.content = marked(md, { baseUrl: $location.url() });
$scope.type = "html";
}
if ($scope.type == "org") {
const content = contentAbs2Relative(res.data);
const orgParser = new Org.Parser();
const orgDocument = orgParser.parse(content);
var orgHTMLDocument = orgDocument.convert(Org.ConverterHTML, {
headerOffset: 1,
exportFromLineNumber: false,
suppressSubScriptHandling: false,
suppressAutoLink: false,
});
$scope.content = orgHTMLDocument.toString();
$scope.type = "html";
}
setTimeout(() => {
Prism.highlightAll();
}, 50);
+1650
View File
File diff suppressed because it is too large Load Diff