mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
Support highlighting Elixir code notes.
This commit is contained in:
parent
4da7fd2c87
commit
9c45e9fa1a
@ -16,6 +16,7 @@ const CODE_MIME_TYPES = new Set([
|
|||||||
"text/x-c++src",
|
"text/x-c++src",
|
||||||
"text/x-csrc",
|
"text/x-csrc",
|
||||||
"text/x-dockerfile",
|
"text/x-dockerfile",
|
||||||
|
"text/x-elixir",
|
||||||
"text/x-erlang",
|
"text/x-erlang",
|
||||||
"text/x-feature",
|
"text/x-feature",
|
||||||
"text/x-go",
|
"text/x-go",
|
||||||
@ -55,6 +56,8 @@ const EXTENSION_TO_MIME = new Map<string, string>([
|
|||||||
[".cs", "text/x-csharp"],
|
[".cs", "text/x-csharp"],
|
||||||
[".clj", "text/x-clojure"],
|
[".clj", "text/x-clojure"],
|
||||||
[".erl", "text/x-erlang"],
|
[".erl", "text/x-erlang"],
|
||||||
|
[".ex", "text/x-elixir"],
|
||||||
|
[".exs", "text/x-elixir"],
|
||||||
[".hrl", "text/x-erlang"],
|
[".hrl", "text/x-erlang"],
|
||||||
[".feature", "text/x-feature"],
|
[".feature", "text/x-feature"],
|
||||||
[".go", "text/x-go"],
|
[".go", "text/x-go"],
|
||||||
|
@ -98,7 +98,7 @@ const defaultOptions: DefaultOption[] = [
|
|||||||
{ name: "codeLineWrapEnabled", value: "true", isSynced: false },
|
{ name: "codeLineWrapEnabled", value: "true", isSynced: false },
|
||||||
{
|
{
|
||||||
name: "codeNotesMimeTypes",
|
name: "codeNotesMimeTypes",
|
||||||
value: '["text/x-csrc","text/x-c++src","text/x-csharp","text/css","text/x-go","text/x-groovy","text/x-haskell","text/html","message/http","text/x-java","application/javascript;env=frontend","application/javascript;env=backend","application/json","text/x-kotlin","text/x-markdown","text/x-perl","text/x-php","text/x-python","text/x-ruby",null,"text/x-sql","text/x-sqlite;schema=trilium","text/x-swift","text/xml","text/x-yaml","text/x-sh","application/typescript"]',
|
value: '["text/x-csrc","text/x-c++src","text/x-csharp","text/css","text/x-elixir","text/x-go","text/x-groovy","text/x-haskell","text/html","message/http","text/x-java","application/javascript;env=frontend","application/javascript;env=backend","application/json","text/x-kotlin","text/x-markdown","text/x-perl","text/x-php","text/x-python","text/x-ruby",null,"text/x-sql","text/x-sqlite;schema=trilium","text/x-swift","text/xml","text/x-yaml","text/x-sh","application/typescript"]',
|
||||||
isSynced: true
|
isSynced: true
|
||||||
},
|
},
|
||||||
{ name: "leftPaneWidth", value: "25", isSynced: false },
|
{ name: "leftPaneWidth", value: "25", isSynced: false },
|
||||||
|
@ -84,6 +84,7 @@ const byMimeType: Record<string, (() => Promise<StreamParser<unknown> | Language
|
|||||||
"text/x-ebnf": async () => (await import('@codemirror/legacy-modes/mode/ebnf')).ebnf,
|
"text/x-ebnf": async () => (await import('@codemirror/legacy-modes/mode/ebnf')).ebnf,
|
||||||
"text/x-ecl": async () => (await import('@codemirror/legacy-modes/mode/ecl')).ecl,
|
"text/x-ecl": async () => (await import('@codemirror/legacy-modes/mode/ecl')).ecl,
|
||||||
"text/x-eiffel": async () => (await import('@codemirror/legacy-modes/mode/eiffel')).eiffel,
|
"text/x-eiffel": async () => (await import('@codemirror/legacy-modes/mode/eiffel')).eiffel,
|
||||||
|
"text/x-elixir": async () => (await import('@codemirror/legacy-modes/mode/elixir')).elixir,
|
||||||
"text/x-elm": async () => (await import('@codemirror/legacy-modes/mode/elm')).elm,
|
"text/x-elm": async () => (await import('@codemirror/legacy-modes/mode/elm')).elm,
|
||||||
"text/x-erlang": async () => (await import('@codemirror/legacy-modes/mode/erlang')).erlang,
|
"text/x-erlang": async () => (await import('@codemirror/legacy-modes/mode/erlang')).erlang,
|
||||||
"text/x-esper": async () => (await import('@codemirror/legacy-modes/mode/sql')).esper,
|
"text/x-esper": async () => (await import('@codemirror/legacy-modes/mode/sql')).esper,
|
||||||
|
@ -71,6 +71,7 @@ export const MIME_TYPES_DICT: readonly MimeTypeDefinition[] = Object.freeze([
|
|||||||
{ title: "ECL", mime: "text/x-ecl" },
|
{ title: "ECL", mime: "text/x-ecl" },
|
||||||
{ title: "edn", mime: "application/edn" },
|
{ title: "edn", mime: "application/edn" },
|
||||||
{ title: "Eiffel", mime: "text/x-eiffel" },
|
{ title: "Eiffel", mime: "text/x-eiffel" },
|
||||||
|
{ title: "Elixir", mime: "text/x-elixir", mdLanguageCode: "elixir" },
|
||||||
{ title: "Elm", mime: "text/x-elm", mdLanguageCode: "elm" },
|
{ title: "Elm", mime: "text/x-elm", mdLanguageCode: "elm" },
|
||||||
{ title: "Embedded Javascript", mime: "application/x-ejs" },
|
{ title: "Embedded Javascript", mime: "application/x-ejs" },
|
||||||
{ title: "Embedded Ruby", mime: "application/x-erb", mdLanguageCode: "erb" },
|
{ title: "Embedded Ruby", mime: "application/x-erb", mdLanguageCode: "erb" },
|
||||||
|
@ -64,6 +64,7 @@ const byMimeType: MimeRecord = {
|
|||||||
"text/x-ebnf": () => import("highlight.js/lib/languages/ebnf"),
|
"text/x-ebnf": () => import("highlight.js/lib/languages/ebnf"),
|
||||||
"text/x-ecl": null,
|
"text/x-ecl": null,
|
||||||
"text/x-eiffel": null,
|
"text/x-eiffel": null,
|
||||||
|
"text/x-elixir": () => import("highlight.js/lib/languages/elixir"),
|
||||||
"text/x-elm": () => import("highlight.js/lib/languages/elm"),
|
"text/x-elm": () => import("highlight.js/lib/languages/elm"),
|
||||||
"text/x-erlang": () => import("highlight.js/lib/languages/erlang"),
|
"text/x-erlang": () => import("highlight.js/lib/languages/erlang"),
|
||||||
"text/x-esper": null,
|
"text/x-esper": null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user