Merge pull request #64 from remcohaszing/update-metadata

Update documentation
This commit is contained in:
Remco Haszing 2021-07-31 16:51:20 +02:00 committed by GitHub
commit c1310d88ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 26 deletions

View file

@ -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
View 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
```

View file

@ -1,19 +1,22 @@
# Monaco YAML # Monaco YAML
[![ci workflow](https://github.com/remcohaszing/monaco-yaml/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/monaco-yaml/actions/workflows/ci.yaml)
[![npm version](https://img.shields.io/npm/v/monaco-yaml)](https://www.npmjs.com/package/monaco-yaml)
[![prettier code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](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: ![demo-image](test-demo.png) A running example: ![demo-image](test-demo.png)
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)

View file

@ -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
``` ```

View file

@ -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
``` ```

View file

@ -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 = {

View file

@ -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",