Commit e724af16 authored by Élodie Thiéblin's avatar Élodie Thiéblin
Browse files

[README] Add instructions to instanciate a RQL Browser

parent 6de4d38046c1
Pipeline #31089 failed with stages
in 2 minutes and 15 seconds
......@@ -57,6 +57,22 @@ A _Clear selection_ button can reset the Schema Navigator state (clear search ba
![rql browser screenshot](docs/RqlBrowser.png 'RQL Browser')
Instanciate a RqlBrowser:
```javascript
// url is the base url of your cubicweb instance
import {providers, client} from '@logilab/cwclientlibjs';
import {RqlBrowser} from '@logilab/cwelements';
const clientRql = new client.CwRqlClient(new client.CwSimpleHttpClient(url));
const schemaProvider = new providers.RqlEntitySchemaProvider(
rqlClient,
'storageKey' // OPTIONAL : if you want the schema to be stored in window.localStorage
);
<RqlBrowser schemaProvider={schemaProvider} clientRql={rqlClient} />;
```
## Using monaco-editor-based components
The QueryMonacoEditorTextInput, included in RqlBrowser and RqlBrowserQuerier is based on [monaco-editor](https://www.npmjs.com/package/monaco-editor) for syntaxic colouring, cursor tracking, etc.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment