mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-09 09:31:25 +00:00
commit
f5fc412497
6 changed files with 24 additions and 9 deletions
|
|
@ -3,6 +3,8 @@
|
|||
[](https://github.com/remcohaszing/monaco-yaml/actions/workflows/ci.yaml)
|
||||
[](https://www.npmjs.com/package/monaco-yaml)
|
||||
[](https://prettier.io)
|
||||
[](https://monaco-yaml.js.org)
|
||||
[](https://app.netlify.com/sites/monaco-yaml/deploys)
|
||||
|
||||
YAML language plugin for the Monaco Editor. It provides the following features when editing YAML
|
||||
files:
|
||||
|
|
@ -86,6 +88,8 @@ Also make sure to register the web worker.
|
|||
|
||||
## Examples
|
||||
|
||||
A demo is available on [monaco-yaml.js.org](https://monaco-yaml.js.org).
|
||||
|
||||
A running example: 
|
||||
|
||||
Some usage examples can be found in the
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# Webpack entry points demo
|
||||
# Demo
|
||||
|
||||
This demo shows how to use `monaco-editor` and `monaco-yaml` with Webpack 4
|
||||
[entry points](https://webpack.js.org/concepts/entry-points). To start it, simply run:
|
||||
This demo is deployed to [monaco-yaml.js.org](https://monaco-yaml.js.org). It shows how
|
||||
`monaco-editor` and `monaco-yaml` can be used with
|
||||
[Webpack 5](https://webpack.js.org/concepts/entry-points). To start it, simply run:
|
||||
|
||||
```sh
|
||||
npm start
|
||||
|
|
|
|||
14
examples/webpack/src/icon.svg
Normal file
14
examples/webpack/src/icon.svg
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 512 470.647">
|
||||
<style>
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.char {
|
||||
fill: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<polygon class="char" points="512 422.735 395.638 422.735 395.638 250.125 347.442 250.125 347.442 469.647 512 469.647 512 422.737 512 422.735" />
|
||||
<polygon class="char" points="87.701 250.177 87.701 470.647 135.004 470.647 135.004 318.569 184.509 420.789 221.743 420.789 272.939 314.976 272.939 470.602 318.318 470.602 318.318 250.177 256.358 250.177 201.381 349.883 149.021 250.177 87.701 250.177 87.701 250.177" />
|
||||
<path fill="#cb171e" d="M330.294,195.39H228.433l-20.717,50.024H162.61L257.99,20.465h46.137l91.51,224.949h-48.2L330.293,195.39Zm-16.92-44.911-31.226-82.55-34.837,82.55h66.063Z" transform="translate(0 -19.939)" />
|
||||
<polygon class="char" points="235.793 0 143.978 137.674 143.978 224.949 87.702 224.949 87.702 137.674 0 0 63.25 0 119.018 88.646 175.243 0 235.793 0 235.793 0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
|
|
@ -2,6 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="<%= require('./icon.svg') %>" />
|
||||
<title>Monaco YAML</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -10,14 +10,8 @@ import 'monaco-editor';
|
|||
window.MonacoEnvironment = {
|
||||
getWorker(moduleId, label) {
|
||||
switch (label) {
|
||||
case 'css':
|
||||
return new Worker(new URL('monaco-editor/esm/vs/language/css/css.worker', import.meta.url));
|
||||
case 'editorWorkerService':
|
||||
return new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url));
|
||||
case 'json':
|
||||
return new Worker(
|
||||
new URL('monaco-editor/esm/vs/language/json/json.worker', import.meta.url),
|
||||
);
|
||||
case 'yaml':
|
||||
return new Worker(new URL('monaco-yaml/lib/esm/yaml.worker', import.meta.url));
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
"name": "monaco-yaml",
|
||||
"version": "3.0.0",
|
||||
"description": "YAML plugin for the Monaco Editor",
|
||||
"homepage": "https://monaco-yaml.js.org",
|
||||
"scripts": {
|
||||
"watch": "tsc -p ./src --watch",
|
||||
"compile": "rimraf ./out && tsc",
|
||||
|
|
|
|||
Loading…
Reference in a new issue