Skip to content

Commit 26af3a9

Browse files
authored
Highlight Elixir in code notes (#2327)
2 parents e1e2afc + 6bfc78e commit 26af3a9

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

apps/server/src/services/import/mime.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const CODE_MIME_TYPES = new Set([
1616
"text/x-c++src",
1717
"text/x-csrc",
1818
"text/x-dockerfile",
19+
"text/x-elixir",
1920
"text/x-erlang",
2021
"text/x-feature",
2122
"text/x-go",
@@ -55,6 +56,8 @@ const EXTENSION_TO_MIME = new Map<string, string>([
5556
[".cs", "text/x-csharp"],
5657
[".clj", "text/x-clojure"],
5758
[".erl", "text/x-erlang"],
59+
[".ex", "text/x-elixir"],
60+
[".exs", "text/x-elixir"],
5861
[".hrl", "text/x-erlang"],
5962
[".feature", "text/x-feature"],
6063
[".go", "text/x-go"],

apps/server/src/services/options_init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const defaultOptions: DefaultOption[] = [
9898
{ name: "codeLineWrapEnabled", value: "true", isSynced: false },
9999
{
100100
name: "codeNotesMimeTypes",
101-
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"]',
101+
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"]',
102102
isSynced: true
103103
},
104104
{ name: "leftPaneWidth", value: "25", isSynced: false },

packages/commons/src/lib/mime_type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const MIME_TYPES_DICT: readonly MimeTypeDefinition[] = Object.freeze([
6969
{ title: "ECL", mime: "text/x-ecl" },
7070
{ title: "edn", mime: "application/edn" },
7171
{ title: "Eiffel", mime: "text/x-eiffel" },
72+
{ title: "Elixir", mime: "text/x-elixir", mdLanguageCode: "elixir" },
7273
{ title: "Elm", mime: "text/x-elm", mdLanguageCode: "elm" },
7374
{ title: "Embedded Javascript", mime: "application/x-ejs" },
7475
{ title: "Embedded Ruby", mime: "application/x-erb", mdLanguageCode: "erb" },

packages/highlightjs/src/syntax_highlighting.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const byMimeType: MimeRecord = {
6464
"text/x-ebnf": () => import("highlight.js/lib/languages/ebnf"),
6565
"text/x-ecl": null,
6666
"text/x-eiffel": null,
67+
"text/x-elixir": () => import("highlight.js/lib/languages/elixir"),
6768
"text/x-elm": () => import("highlight.js/lib/languages/elm"),
6869
"text/x-erlang": () => import("highlight.js/lib/languages/erlang"),
6970
"text/x-esper": null,

0 commit comments

Comments
 (0)