diff --git a/src/components/Params.astro b/src/components/Params.astro new file mode 100644 index 0000000..401e838 --- /dev/null +++ b/src/components/Params.astro @@ -0,0 +1,28 @@ +--- +const {schema} = Astro.props +--- + \ No newline at end of file diff --git a/src/components/SchemaInfo.astro b/src/components/SchemaInfo.astro new file mode 100644 index 0000000..c18ea3a --- /dev/null +++ b/src/components/SchemaInfo.astro @@ -0,0 +1,23 @@ +--- +import moduleSchema from '../data/modules.schema.json'; +import processorSchema from '../data/processors.schema.json'; +import Params from './Params.astro'; +const {type, id} = Astro.props; +var schema; + +switch(type) { + case 'module': + schema = moduleSchema.items?.oneOf?.find(schema=>schema["$id"] === id); + break; + case 'processor': + schema = processorSchema.items?.oneOf?.find(schema=>schema["$id"] === id); + break; +} +--- +{ +schema !== undefined && + +} \ No newline at end of file diff --git a/src/content/docs/modules/db/sqlite.mdx b/src/content/docs/modules/db/sqlite.mdx index a93f430..d6cc1d8 100644 --- a/src/content/docs/modules/db/sqlite.mdx +++ b/src/content/docs/modules/db/sqlite.mdx @@ -3,24 +3,22 @@ title: SQLite sidebar: order: 1 --- +import SchemaInfo from '../../../../components/SchemaInfo.astro'; The `db.sqlite` module can open/create SQLite databases -- **type**: `db.sqlite` -- **params**: - - **dsn**: the data source name, this can be a file path or the special `:memory:` name for an in-memory DB + This module implements the `DatabaseModule` interface. -## Cap -### Example snippet +### Example Opens an in-memory SQLite database ```yaml -- id: db +- id: myDatabase type: db.sqlite - params: - dsn: ":memory:" + params: + dsn: ":memory:" ``` diff --git a/src/content/docs/modules/http/http-server.mdx b/src/content/docs/modules/http/http-server.mdx index a853958..9dcfb42 100644 --- a/src/content/docs/modules/http/http-server.mdx +++ b/src/content/docs/modules/http/http-server.mdx @@ -4,12 +4,11 @@ sidebar: label: Server order: 2 --- +import SchemaInfo from '../../../../components/SchemaInfo.astro'; The `http.server` module emits a message for every HTTP request that is made to the server. -- **type**: `http.server` -- **params**: - - **port**: TCP port to listen for HTTP requests on + ### Example diff --git a/src/content/docs/modules/midi/input.mdx b/src/content/docs/modules/midi/input.mdx index 6d33caf..aa4e1bf 100644 --- a/src/content/docs/modules/midi/input.mdx +++ b/src/content/docs/modules/midi/input.mdx @@ -6,6 +6,7 @@ sidebar: --- import { Aside } from "@astrojs/starlight/components"; +import SchemaInfo from '../../../../components/SchemaInfo.astro';