mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-04 20:14:57 +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 { erlang } from "@codemirror/legacy-modes/mode/erlang";
|
||||
import { dockerFile } from "@codemirror/legacy-modes/mode/dockerfile";
|
||||
import { shell } from "@codemirror/legacy-modes/mode/shell";
|
||||
import { elixir } from "codemirror-lang-elixir";
|
||||
|
||||
export const elixirDesc = LanguageDescription.of({
|
||||
|
@ -71,6 +72,11 @@ const dockerfileDesc = LanguageDescription.of({
|
|||
support: new LanguageSupport(StreamLanguage.define(dockerFile)),
|
||||
});
|
||||
|
||||
const shellDesc = LanguageDescription.of({
|
||||
name: "Shell",
|
||||
support: new LanguageSupport(StreamLanguage.define(shell)),
|
||||
});
|
||||
|
||||
const markdownDesc = LanguageDescription.of({
|
||||
name: "Markdown",
|
||||
support: markdown({
|
||||
|
@ -87,6 +93,7 @@ const markdownDesc = LanguageDescription.of({
|
|||
htmlDesc,
|
||||
javascriptDesc,
|
||||
dockerfileDesc,
|
||||
shellDesc,
|
||||
],
|
||||
}),
|
||||
});
|
||||
|
@ -103,5 +110,6 @@ export const languages = [
|
|||
htmlDesc,
|
||||
javascriptDesc,
|
||||
dockerfileDesc,
|
||||
shellDesc,
|
||||
markdownDesc,
|
||||
];
|
||||
|
|
|
@ -561,6 +561,9 @@ function buildHighlightStyle({
|
|||
|
||||
// CSS specific
|
||||
{ tag: t.className, color: peach },
|
||||
|
||||
// Shell specific
|
||||
{ tag: t.meta, color: gray },
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue