- Remove the Monaco Editor because it was to heavy and hard to integrate - Use Ace instead - Use the lowercase identifier for languages (ex: "Text" -> "text") - Select automatically the default language in the drop down to create a note (like the expiration) - Add `ace_directory` to serve assets from a local folder instead of a CDN - "hcl" syntax highlighting has been removed - "go" syntax highlighting has been renamed to "golang" - Add option to disable the editor Fixes #32. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
9e0254c0b5
commit
b5701b5a4d
9 changed files with 113 additions and 73 deletions
|
@ -35,11 +35,13 @@ The file format is **JSON**:
|
|||
* **prometheus_route** (string): Route to expose Prometheus metrics (default "/metrics")
|
||||
* **prometheus_notes_metric** (string): Name of the notes count metric (default "collerd_notes")
|
||||
* **observation_internal** (int): Number of seconds to wait between two observations (default 60)
|
||||
* **languages** ([]string): List of supported [languages](https://github.com/microsoft/monaco-editor/tree/main/src/basic-languages)
|
||||
* **languages** ([]string): List of supported [languages](https://github.com/ajaxorg/ace/tree/master/src/mode)
|
||||
* **language** (string): Default language (default "text")
|
||||
* **tls_cert_file** (string): Path to TLS certificate file to enable HTTPS
|
||||
* **tls_key_file** (string): Path to TLS key file to enable HTTPS
|
||||
* **ace_directory** (string): Serve [Ace](hhttps://ace.c9.io/) assets from this local directory (ex: "./node_modules/ace-builds"). See **Dependencies** for details.
|
||||
* **bootstrap_directory** (string): Serve [Bootstrap](https://getbootstrap.com/) assets from this local directory (ex: "./node_modules/bootstrap/dist"). See **Dependencies** for details.
|
||||
* **disable_editor** (bool): Disable Ace editor.
|
||||
|
||||
The configuration file is not required but the service might not be exposed to the public.
|
||||
|
||||
|
@ -107,12 +109,12 @@ Errors return **500 Server Internal Error** with the **JSON** payload:
|
|||
|
||||
The web interface depends on:
|
||||
|
||||
- [Ace](https://ace.c9.io/)
|
||||
- [Bootstrap](https://getbootstrap.com/)
|
||||
- [Monaco Editor](https://github.com/microsoft/monaco-editor/)
|
||||
|
||||
By default, those dependencies are fetched from **remote CDN** services by the client.
|
||||
|
||||
If you would like to download them to serve them locally:
|
||||
If you would like to download and serve them locally:
|
||||
|
||||
```
|
||||
npm install
|
||||
|
@ -128,8 +130,7 @@ Then configure the local directories:
|
|||
|
||||
```json
|
||||
{
|
||||
"ace_directory": "./node_modules/ace-builds",
|
||||
"bootstrap_directory": "./node_modules/bootstrap/dist"
|
||||
}
|
||||
```
|
||||
|
||||
Downloading Monaco Editor is not supported yet.
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue