@astrojs/markdoc 0.5.0-rc.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -344,6 +344,36 @@ Now, you can call this function from any Markdoc content entry:
|
|
|
344
344
|
|
|
345
345
|
📚 [See the Markdoc documentation](https://markdoc.dev/docs/functions#creating-a-custom-function) for more on using variables or functions in your content.
|
|
346
346
|
|
|
347
|
+
### Markdoc Language Server
|
|
348
|
+
|
|
349
|
+
If you are using VS Code, there is an official [Markdoc language extension](https://marketplace.visualstudio.com/items?itemName=Stripe.markdoc-language-support) that includes syntax highlighting and autocomplete for configured tags. [See the language server on GitHub](https://github.com/markdoc/language-server.git) for more information.
|
|
350
|
+
|
|
351
|
+
To set up the extension, create a `markdoc.config.json` file into the project root with following content:
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
[
|
|
355
|
+
{
|
|
356
|
+
"id": "my-site",
|
|
357
|
+
"path": "src/content",
|
|
358
|
+
"schema": {
|
|
359
|
+
"path": "markdoc.config.mjs",
|
|
360
|
+
"type": "esm",
|
|
361
|
+
"property": "default",
|
|
362
|
+
"watch": true
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
The `schema` property contains all information to configure the language server for Astro content collections. It accepts following properties:
|
|
369
|
+
|
|
370
|
+
- `path`: The path to the configuration file.
|
|
371
|
+
- `type`: The type of module your configuration file uses (`esm` allows `import` syntax).
|
|
372
|
+
- `property`: The exported property name that contains the configuration object.
|
|
373
|
+
- `watch`: Tell the server to watch for changes in the configuration.
|
|
374
|
+
|
|
375
|
+
The top-level `path` property tells the server where content is located. Since Markdoc is specific to content collections, you can use `src/content`.
|
|
376
|
+
|
|
347
377
|
### Pass Markdoc variables
|
|
348
378
|
|
|
349
379
|
You may need to pass [variables][markdoc-variables] to your content. This is useful when passing SSR parameters like A/B tests.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/markdoc",
|
|
3
3
|
"description": "Add support for Markdoc in your Astro site",
|
|
4
|
-
"version": "0.5.0
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -57,32 +57,32 @@
|
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@markdoc/markdoc": "^0.3.0",
|
|
60
|
-
"esbuild": "^0.
|
|
60
|
+
"esbuild": "^0.19.2",
|
|
61
61
|
"github-slugger": "^2.0.0",
|
|
62
62
|
"gray-matter": "^4.0.3",
|
|
63
63
|
"htmlparser2": "^9.0.0",
|
|
64
64
|
"kleur": "^4.1.5",
|
|
65
|
-
"shiki": "^0.14.
|
|
66
|
-
"zod": "
|
|
67
|
-
"@astrojs/internal-helpers": "0.2.0
|
|
68
|
-
"@astrojs/prism": "3.0.0
|
|
65
|
+
"shiki": "^0.14.3",
|
|
66
|
+
"zod": "3.21.1",
|
|
67
|
+
"@astrojs/internal-helpers": "0.2.0",
|
|
68
|
+
"@astrojs/prism": "3.0.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"astro": "^3.0.0
|
|
71
|
+
"astro": "^3.0.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@types/chai": "^4.3.5",
|
|
75
75
|
"@types/html-escaper": "^3.0.0",
|
|
76
|
-
"@types/markdown-it": "^
|
|
77
|
-
"@types/mocha": "^
|
|
76
|
+
"@types/markdown-it": "^13.0.0",
|
|
77
|
+
"@types/mocha": "^10.0.1",
|
|
78
78
|
"chai": "^4.3.7",
|
|
79
79
|
"devalue": "^4.3.2",
|
|
80
|
-
"linkedom": "^0.
|
|
81
|
-
"mocha": "^
|
|
82
|
-
"rollup": "^3.
|
|
83
|
-
"vite": "^4.4.
|
|
84
|
-
"@astrojs/markdown-remark": "3.0.0
|
|
85
|
-
"astro": "3.0.0
|
|
80
|
+
"linkedom": "^0.15.1",
|
|
81
|
+
"mocha": "^10.2.0",
|
|
82
|
+
"rollup": "^3.28.1",
|
|
83
|
+
"vite": "^4.4.9",
|
|
84
|
+
"@astrojs/markdown-remark": "3.0.0",
|
|
85
|
+
"astro": "3.0.0",
|
|
86
86
|
"astro-scripts": "0.0.14"
|
|
87
87
|
},
|
|
88
88
|
"engines": {
|