From 8e394074af2179becf5fd3aa1441325e15b83f2f Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Sun, 20 Aug 2023 12:56:10 +0200 Subject: [PATCH] chore: release new version and docs --- apps/demo/src/routes/advanced/+page.markdoc | 27 +++++++++++++++++++++ packages/process/package.json | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/demo/src/routes/advanced/+page.markdoc b/apps/demo/src/routes/advanced/+page.markdoc index fd3675e..af01f2a 100644 --- a/apps/demo/src/routes/advanced/+page.markdoc +++ b/apps/demo/src/routes/advanced/+page.markdoc @@ -18,3 +18,30 @@ In the `markdoc.config.json` [configuration file](https://github.com/markdoc/lan } ] ``` + +## Markdoc configuration + +You can configure the underlying Markdoc compiler by passing a [configuration object](https://markdoc.dev/docs/config#options). + +```js +// svelte.config.js +markdoc({ + config: { + variables: { + name: 'Dr. Mark', + frontmatter: { + title: 'Configuration options' + } + }, + functions: { + includes: { + transform(parameters, config) { + const [array, value] = Object.values(parameters); + + return Array.isArray(array) ? array.includes(value) : false; + } + } + } + } +}) +``` diff --git a/packages/process/package.json b/packages/process/package.json index cc3d147..4b2c7a3 100644 --- a/packages/process/package.json +++ b/packages/process/package.json @@ -1,6 +1,6 @@ { "name": "svelte-markdoc-preprocess", - "version": "0.1.2", + "version": "0.1.3", "description": "A Svelte preprocessor that allows you to use Markdoc.", "type": "commonjs", "keywords": [