import React, {useEffect, useState} from "react" import BrowserOnly from "@docusaurus/BrowserOnly" import {useColorMode, useWindowSize} from '@docusaurus/theme-common'; import CodeBlock from '@theme/CodeBlock'; import Schema from "@site/static/schemas/aio.json"; import ConfigExample from "@site/static/configExample.json"; import './Playground.scss'; import { JSONSchema, JsonSchemaViewer } from 'cf-json-schema-viz'; import "./json-schema-viewer-styles.css"; import "./modern-json-react-styles.css"; import { Mode, ReactJsonEditor, createAjvValidator, type Content } from 'modern-react-json-editor'; import f from "ajv-formats" import DetailsAdmo from "./AdmonitionDetails"; const validator = createAjvValidator({ schema: Schema, ajvOptions: { strict: "log", strictSchema: "log", allowUnionTypes: true, }, onCreateAjv: (ajv) => { ajv.addKeyword('deprecationMessage'); f.default(ajv); return ajv; } }); function PlaygroundInner(): JSX.Element { const { colorMode, // the "effective" color mode, never null // colorModeChoice, // the color mode chosen by the user, can be null // setColorMode, // set the color mode chosen by the user } = useColorMode(); const windowSize = useWindowSize({desktopBreakpoint: 500}); const [data, setData] = useState({json: ConfigExample }); return (

This displays the structure of the all-in-one (config.json) configuration with all possible properties, their shape, and descriptions/types.

Use this to understand how to write a valid config.

This displays an example config file of a all-in-one (config.json) configuration that adheres to the shown Config Structure.

  • text mode lets you edit the JSON directly.
  • tree mode gives you a guided point-and-click editing experience that always keeps the JSON syntax valid.

Both modes validate that the configuraion is correct. Any errors show up as squiggly lines.

After you finish editing, switch to text and then copy all text to get a completed config.

This displays an example config file of a all-in-one (config.json) configuration that adheres to the shown Config Structure.

The example config file editor is meant for a larger screen experience so only the read-only example is shown. Please use this site on a tablet/laptop/desktop to enable file editor features.

{windowSize === 'mobile' ? ({JSON.stringify(data, null, 2)}) : ( )}
) } export default function PlaygroundComponent(): JSX.Element { return ( Loading...}> {() => { return }} ) }