Skip to content

Commit

Permalink
Ajout de la doc sur CodeEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
pprev94 committed Jun 21, 2024
1 parent b4a31a2 commit dd99b40
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/components/code-editor/CodeEditorExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react';
import { CodeEditor } from 'geostyler';
import SldStyleParser from 'geostyler-sld-parser';
import QgisStyleParser from "geostyler-qgis-parser";
import MapboxStyleParser from 'geostyler-mapbox-parser';
import { Style as GsStyle } from 'geostyler-style';

const CodeEditorExample = () => {
const sldParser = new SldStyleParser({
sldVersion: "1.1.0",
builderOptions: {
format: true,
},
});
const qgisStyleParser = new QgisStyleParser();
const mapboxStyleParser = new MapboxStyleParser({ pretty: true });
const style: GsStyle = {
name: "Demo Style",
rules: [
{
name: "Rule 1",
symbolizers: [
{
kind: "Mark",
wellKnownName: "circle",
},
],
},
],
};

return (
<div style={{ height: "300px" }}>
<CodeEditor
style={style}
parsers={[sldParser, qgisStyleParser, mapboxStyleParser]}
defaultParser={sldParser}
showSaveButton={true}
showCopyButton={true}
/>
</div>
);
}

export default CodeEditorExample;
11 changes: 11 additions & 0 deletions docs/components/code-editor/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
displayed_sidebar: componentsSidebar
---

import CodeEditorExample from './CodeEditorExample.tsx'

# CodeEditor

This demonstrates the use of `CodeEditor`.

<CodeEditorExample />

0 comments on commit dd99b40

Please sign in to comment.