mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(text-note): add Terraform HCL support for code blocks
This commit is contained in:
parent
b82634b39b
commit
65deec5861
@ -80,8 +80,4 @@ return {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = function(hljs) {
|
|
||||||
hljs.registerLanguage('terraform', hljsDefineTerraform);
|
hljs.registerLanguage('terraform', hljsDefineTerraform);
|
||||||
};
|
|
||||||
|
|
||||||
module.exports.definer = hljsDefineTerraform;
|
|
@ -107,8 +107,16 @@ const HIGHLIGHT_JS = {
|
|||||||
const scriptsToLoad = new Set();
|
const scriptsToLoad = new Set();
|
||||||
scriptsToLoad.add("node_modules/@highlightjs/cdn-assets/highlight.min.js");
|
scriptsToLoad.add("node_modules/@highlightjs/cdn-assets/highlight.min.js");
|
||||||
for (const mimeType of mimeTypes) {
|
for (const mimeType of mimeTypes) {
|
||||||
if (mimeType.enabled && mimeType.highlightJs) {
|
const id = mimeType.highlightJs;
|
||||||
scriptsToLoad.add(`node_modules/@highlightjs/cdn-assets/languages/${mimeType.highlightJs}.min.js`);
|
if (!mimeType.enabled || !id) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mimeType.highlightJsSource === "libraries") {
|
||||||
|
scriptsToLoad.add(`libraries/highlightjs/${id}.js`);
|
||||||
|
} else {
|
||||||
|
// Built-in module.
|
||||||
|
scriptsToLoad.add(`node_modules/@highlightjs/cdn-assets/languages/${id}.min.js`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +142,7 @@ const MIME_TYPES_DICT = [
|
|||||||
{ default: true, title: "Swift", mime: "text/x-swift" },
|
{ default: true, title: "Swift", mime: "text/x-swift" },
|
||||||
{ title: "SystemVerilog", mime: "text/x-systemverilog" },
|
{ title: "SystemVerilog", mime: "text/x-systemverilog" },
|
||||||
{ title: "Tcl", mime: "text/x-tcl", highlightJs: "tcl" },
|
{ title: "Tcl", mime: "text/x-tcl", highlightJs: "tcl" },
|
||||||
|
{ title: "Terraform (HCL)", mime: "text/x-hcl", highlightJs: "terraform", highlightJsSource: "libraries" },
|
||||||
{ title: "Textile", mime: "text/x-textile" },
|
{ title: "Textile", mime: "text/x-textile" },
|
||||||
{ title: "TiddlyWiki ", mime: "text/x-tiddlywiki" },
|
{ title: "TiddlyWiki ", mime: "text/x-tiddlywiki" },
|
||||||
{ title: "Tiki wiki", mime: "text/tiki" },
|
{ title: "Tiki wiki", mime: "text/tiki" },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user