mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-12 16:04:39 +08:00
Add support for Shell script highlighting in Markdown cells
This commit is contained in:
parent
ba59baa9fe
commit
cbcd638621
2 changed files with 11 additions and 0 deletions
|
@ -14,6 +14,7 @@ import { yaml } from "@codemirror/lang-yaml";
|
||||||
import { javascript } from "@codemirror/lang-javascript";
|
import { javascript } from "@codemirror/lang-javascript";
|
||||||
import { erlang } from "@codemirror/legacy-modes/mode/erlang";
|
import { erlang } from "@codemirror/legacy-modes/mode/erlang";
|
||||||
import { dockerFile } from "@codemirror/legacy-modes/mode/dockerfile";
|
import { dockerFile } from "@codemirror/legacy-modes/mode/dockerfile";
|
||||||
|
import { shell } from "@codemirror/legacy-modes/mode/shell";
|
||||||
import { elixir } from "codemirror-lang-elixir";
|
import { elixir } from "codemirror-lang-elixir";
|
||||||
|
|
||||||
export const elixirDesc = LanguageDescription.of({
|
export const elixirDesc = LanguageDescription.of({
|
||||||
|
@ -71,6 +72,11 @@ const dockerfileDesc = LanguageDescription.of({
|
||||||
support: new LanguageSupport(StreamLanguage.define(dockerFile)),
|
support: new LanguageSupport(StreamLanguage.define(dockerFile)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const shellDesc = LanguageDescription.of({
|
||||||
|
name: "Shell",
|
||||||
|
support: new LanguageSupport(StreamLanguage.define(shell)),
|
||||||
|
});
|
||||||
|
|
||||||
const markdownDesc = LanguageDescription.of({
|
const markdownDesc = LanguageDescription.of({
|
||||||
name: "Markdown",
|
name: "Markdown",
|
||||||
support: markdown({
|
support: markdown({
|
||||||
|
@ -87,6 +93,7 @@ const markdownDesc = LanguageDescription.of({
|
||||||
htmlDesc,
|
htmlDesc,
|
||||||
javascriptDesc,
|
javascriptDesc,
|
||||||
dockerfileDesc,
|
dockerfileDesc,
|
||||||
|
shellDesc,
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -103,5 +110,6 @@ export const languages = [
|
||||||
htmlDesc,
|
htmlDesc,
|
||||||
javascriptDesc,
|
javascriptDesc,
|
||||||
dockerfileDesc,
|
dockerfileDesc,
|
||||||
|
shellDesc,
|
||||||
markdownDesc,
|
markdownDesc,
|
||||||
];
|
];
|
||||||
|
|
|
@ -561,6 +561,9 @@ function buildHighlightStyle({
|
||||||
|
|
||||||
// CSS specific
|
// CSS specific
|
||||||
{ tag: t.className, color: peach },
|
{ tag: t.className, color: peach },
|
||||||
|
|
||||||
|
// Shell specific
|
||||||
|
{ tag: t.meta, color: gray },
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue