Skip to content

Commit

Permalink
Added support for shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
notangelmario committed Oct 25, 2022
1 parent ffbde38 commit a7edc8e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Marker has 2 kinds of support for languages:
* C++
* Python
* Markdown
* Shell/Bash scripts
* More comming soon...

Made with ❤ by [Fructo](https://fructo.land)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "marker",
"private": true,
"author": "Savin Angel-Mario ([email protected])",
"version": "1.2.2",
"version": "1.2.3",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
7 changes: 5 additions & 2 deletions src/lib/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function setEditorText(editor: monaco.editor.IStandaloneCodeEditor,

monaco.editor.getModels().forEach((model) => model.dispose());
editor.setModel(monaco.editor.createModel(await file.text(), fileTypes.get(ext), monaco.Uri.file(file.name)));

fileAvailableContext.set(true);
store.set("fileHandle", fileHandle);
}
Expand Down Expand Up @@ -155,6 +155,8 @@ export function initLaunchWithFile(editor: monaco.editor.IStandaloneCodeEditor,

export const fileTypes = new Map<string, string>([
["txt", "plaintext"],
["sh", "shell"],
["bash", "shell"],
["c", "c"],
["cpp", "cpp"],
["py", "python"],
Expand All @@ -170,6 +172,7 @@ export const fileTypes = new Map<string, string>([

export const fileMimeTypes = new Map<string, string>([
["txt", "text/plain"],
["sh", "text/x-shellscript"],
["c", "text/x-c"],
["py", "text/x-python"],
["md", "text/markdown"],
Expand All @@ -179,4 +182,4 @@ export const fileMimeTypes = new Map<string, string>([
["webmanifest", "application/manifest+json"],
["js", "text/javascript"],
["ts", "text/x-typescript"]
])
])
3 changes: 2 additions & 1 deletion src/lib/monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import "monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution"
import "monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution";
import "monaco-editor/esm/vs/basic-languages/python/python.contribution";
import "monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution";
import "monaco-editor/esm/vs/basic-languages/shell/shell.contribution";

import * as monaco from "monaco-editor/esm/vs/editor/editor.api";

export default monaco;
export default monaco;

0 comments on commit a7edc8e

Please sign in to comment.