mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-07-05 02:50:47 +00:00
Merge pull request #64 from remcohaszing/update-metadata
Update documentation
This commit is contained in:
commit
c1310d88ff
7 changed files with 67 additions and 26 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
|
@ -3,7 +3,7 @@ name: ci
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [main]
|
||||||
tags: ['*']
|
tags: ['*']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
||||||
23
CONTRIBUTING.md
Normal file
23
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Contributing
|
||||||
|
|
||||||
|
To get started with contributing, clone the repository and install its dependencies.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/remcohaszing/monaco-yaml
|
||||||
|
cd monaco-yaml
|
||||||
|
npm ci
|
||||||
|
```
|
||||||
|
|
||||||
|
To build the repository, run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm prepack
|
||||||
|
```
|
||||||
|
|
||||||
|
To test it, run one of the
|
||||||
|
[examples](https://github.com/remcohaszing/monaco-yaml/tree/main/examples).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd examples/webpack-worker-loader
|
||||||
|
npm start
|
||||||
|
```
|
||||||
45
README.md
45
README.md
|
|
@ -1,19 +1,22 @@
|
||||||
# Monaco YAML
|
# Monaco YAML
|
||||||
|
|
||||||
|
[](https://github.com/remcohaszing/monaco-yaml/actions/workflows/ci.yaml)
|
||||||
|
[](https://www.npmjs.com/package/monaco-yaml)
|
||||||
|
[](https://prettier.io)
|
||||||
|
|
||||||
YAML language plugin for the Monaco Editor. It provides the following features when editing YAML
|
YAML language plugin for the Monaco Editor. It provides the following features when editing YAML
|
||||||
files:
|
files:
|
||||||
|
|
||||||
- Code completion, based on JSON schemas or by looking at similar objects in the same file
|
- Code completion, based on JSON schemas or by looking at similar objects in the same file
|
||||||
- Hovers, based on JSON schemas
|
- Hovers, based on JSON schemas
|
||||||
- Validation: Syntax errors and schema validation
|
- Validation: Syntax errors and schema validation
|
||||||
- Formatting
|
- Formatting using Prettier
|
||||||
- Document Symbols
|
- Document Symbols
|
||||||
- Syntax highlighting
|
|
||||||
- Automatically load remote schema files (by enabling DiagnosticsOptions.enableSchemaRequest)
|
- Automatically load remote schema files (by enabling DiagnosticsOptions.enableSchemaRequest)
|
||||||
|
|
||||||
Schemas can also be provided by configuration. See
|
Schemas can also be provided by configuration. See
|
||||||
[here](https://github.com/Microsoft/monaco-json/blob/master/index.d.ts) for the API that the JSON
|
[here](https://github.com/remcohaszing/monaco-yaml/blob/main/index.d.ts) for the API that the plugin
|
||||||
plugin offers to configure the JSON language support.
|
offers to configure the YAML language support.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
@ -79,22 +82,36 @@ editor.create(document.createElement('editor'), {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
Also make sure to register the service worker. See the
|
Also make sure to register the service worker.
|
||||||
[examples](https://github.com/pengx17/monaco-yaml/tree/master/examples) directory for full fledged
|
|
||||||
examples.
|
|
||||||
|
|
||||||
## Development
|
## Examples
|
||||||
|
|
||||||
- `git clone https://github.com/pengx17/monaco-yaml`
|
|
||||||
- `cd monaco-yaml`
|
|
||||||
- `npm ci`
|
|
||||||
|
|
||||||
A running example: 
|
A running example: 
|
||||||
|
|
||||||
|
Some usage examples can be found in the
|
||||||
|
[examples](https://github.com/remcohaszing/monaco-yaml/tree/main/examples) directory.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Please see our [contributing guidelines](CONTRIBUTING.md)
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
- https://github.com/redhat-developer/yaml-language-server
|
Originally [@kpdecker](https://github.com/kpdecker) forked this repository from
|
||||||
|
[`monaco-json`](https://github.com/microsoft/monaco-json) by
|
||||||
|
[@microsoft](https://github.com/microsoft) and rewrote it to work with
|
||||||
|
[`yaml-language-server`](https://github.com/redhat-developer/yaml-language-server) instead. Later
|
||||||
|
the repository maintenance was taken over by [@pengx17](https://github.com/pengx17). Eventually the
|
||||||
|
repository was tranferred to the account of [@remcohaszing](https://github.com/remcohaszing), who is
|
||||||
|
currently maintaining this repository with the help of [fleon](https://github.com/fleon) and
|
||||||
|
[@yazaabed](https://github.com/yazaabed).
|
||||||
|
|
||||||
|
The heavy processing is done in
|
||||||
|
[`yaml-language-server`](https://github.com/redhat-developer/yaml-language-server), best known for
|
||||||
|
being the backbone for [`vscode-yaml`](https://github.com/redhat-developer/vscode-yaml). This
|
||||||
|
repository provides a thin layer to add functionality provided by `yaml-language-server` into
|
||||||
|
`monaco-editor`.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT](https://github.com/pengx17/monaco-yaml/blob/master/LICENSE.md)
|
[MIT](https://github.com/remcohaszing/monaco-yaml/blob/main/LICENSE.md)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
# Usage example with Webpack and worker-loader
|
# Webpack worker-loader demo
|
||||||
|
|
||||||
To run:
|
This demo shows how to use `monaco-editor` and `monaco-yaml` with Webpack 4 and
|
||||||
|
[`worker-loader`](https://github.com/webpack-contrib/worker-loader). To start it, simply run:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
# Demo: Weback + Monaco + Monaco YAML
|
# Webpack entry points demo
|
||||||
|
|
||||||
To run:
|
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:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
||||||
import { setDiagnosticsOptions } from 'monaco-yaml';
|
import { setDiagnosticsOptions } from 'monaco-yaml';
|
||||||
|
|
||||||
// NOTE: This will give you all editor featues. If you would prefer to limit to only the editor
|
// NOTE: This will give you all editor featues. If you would prefer to limit to only the editor
|
||||||
// features you want to use, import them each individually. See this example: (https://github.com/microsoft/monaco-editor-samples/blob/master/browser-esm-webpack-small/index.js#L1-L91)
|
// features you want to use, import them each individually. See this example: (https://github.com/microsoft/monaco-editor-samples/blob/main/browser-esm-webpack-small/index.js#L1-L91)
|
||||||
import 'monaco-editor';
|
import 'monaco-editor';
|
||||||
|
|
||||||
window.MonacoEnvironment = {
|
window.MonacoEnvironment = {
|
||||||
|
|
|
||||||
|
|
@ -22,16 +22,15 @@
|
||||||
],
|
],
|
||||||
"author": "Kevin Decker <kpdecker@gmail.com> (http://incaseofstairs.com)",
|
"author": "Kevin Decker <kpdecker@gmail.com> (http://incaseofstairs.com)",
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"kpdecker",
|
"Remco Haszing <remcohaszing@gmail.com> (https://github.com/remcohaszing)"
|
||||||
"pengx17"
|
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pengx17/monaco-yaml"
|
"url": "https://github.com/remcohaszing/monaco-yaml"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/pengx17/monaco-yaml/issues"
|
"url": "https://github.com/remcohaszing/monaco-yaml/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/json-schema": "^7.0.8",
|
"@types/json-schema": "^7.0.8",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue