mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-05-19 04:08:48 +00:00
Update documentation
- Update repository links - Restructure the readme - Add contributing document - Update credits
This commit is contained in:
parent
090302534a
commit
2ea154af85
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:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [master]
|
||||
branches: [main]
|
||||
tags: ['*']
|
||||
|
||||
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
|
||||
|
||||
[](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
|
||||
files:
|
||||
|
||||
- Code completion, based on JSON schemas or by looking at similar objects in the same file
|
||||
- Hovers, based on JSON schemas
|
||||
- Validation: Syntax errors and schema validation
|
||||
- Formatting
|
||||
- Formatting using Prettier
|
||||
- Document Symbols
|
||||
- Syntax highlighting
|
||||
- Automatically load remote schema files (by enabling DiagnosticsOptions.enableSchemaRequest)
|
||||
|
||||
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
|
||||
plugin offers to configure the JSON language support.
|
||||
[here](https://github.com/remcohaszing/monaco-yaml/blob/main/index.d.ts) for the API that the plugin
|
||||
offers to configure the YAML language support.
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
@ -79,22 +82,36 @@ editor.create(document.createElement('editor'), {
|
|||
});
|
||||
```
|
||||
|
||||
Also make sure to register the service worker. See the
|
||||
[examples](https://github.com/pengx17/monaco-yaml/tree/master/examples) directory for full fledged
|
||||
examples.
|
||||
Also make sure to register the service worker.
|
||||
|
||||
## Development
|
||||
|
||||
- `git clone https://github.com/pengx17/monaco-yaml`
|
||||
- `cd monaco-yaml`
|
||||
- `npm ci`
|
||||
## Examples
|
||||
|
||||
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
|
||||
|
||||
- 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
|
||||
|
||||
[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
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|||
import { setDiagnosticsOptions } from 'monaco-yaml';
|
||||
|
||||
// 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';
|
||||
|
||||
window.MonacoEnvironment = {
|
||||
|
|
|
|||
|
|
@ -22,16 +22,15 @@
|
|||
],
|
||||
"author": "Kevin Decker <kpdecker@gmail.com> (http://incaseofstairs.com)",
|
||||
"maintainers": [
|
||||
"kpdecker",
|
||||
"pengx17"
|
||||
"Remco Haszing <remcohaszing@gmail.com> (https://github.com/remcohaszing)"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pengx17/monaco-yaml"
|
||||
"url": "https://github.com/remcohaszing/monaco-yaml"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pengx17/monaco-yaml/issues"
|
||||
"url": "https://github.com/remcohaszing/monaco-yaml/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
|
|
|
|||
Loading…
Reference in a new issue