Skip to content

Commit

Permalink
🔧 Add markdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
MeganSteenkamp committed Oct 6, 2023
1 parent 7d435ec commit 9fef94d
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 56 deletions.
16 changes: 7 additions & 9 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineConfig } from 'astro/config';
import flexsearchPlugin from './src/plugins/flexsearch';

// https://astro.build/config
import tailwind from '@astrojs/tailwind';

// https://astro.build/config
Expand All @@ -14,21 +13,20 @@ import { mermaid } from './src/plugins/mermaid';
// https://astro.build/config
import mdx from '@astrojs/mdx';

// https://astro.build/config
import markdoc from '@astrojs/markdoc';

// https://astro.build/config
export default defineConfig({
site: 'https://docs.centrapay.com',
integrations: [
vue(),
tailwind({
applyBaseStyles: false,
}),
mdx()
tailwind({ applyBaseStyles: false }),
mdx(),
markdoc()
],
markdown: {
remarkPlugins: [
remarkSectionize,
mermaid,
],
remarkPlugins: [remarkSectionize, mermaid],
shikiConfig: {
// Choose from Shiki's built-in themes (or add your own)
// https://github.com/shikijs/shiki/blob/main/docs/themes.md
Expand Down
12 changes: 12 additions & 0 deletions markdoc.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"id": "centrapay-docs",
"path": "src/content",
"schema": {
"path": "markdoc.config.mjs",
"type": "esm",
"property": "default",
"watch": true
}
}
]
16 changes: 16 additions & 0 deletions markdoc.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineMarkdocConfig, component } from '@astrojs/markdoc/config';

export default defineMarkdocConfig({
tags: {
properties: {
render: component('./src/components/Properties.astro'),
},
property: {
render: component('./src/components/Property.astro'),
attributes: {
name: { type: String, required: true },
type: { type: String, required: true },
},
}
}
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"test": "vitest --watch=false"
},
"devDependencies": {
"@astrojs/markdoc": "^0.5.1",
"@astrojs/mdx": "^1.0.3",
"@astrojs/tailwind": "^5.0.0",
"@astrojs/vue": "^3.0.0",
Expand All @@ -17,7 +18,7 @@
"@fontsource/inter": "^4.5.15",
"@headlessui/vue": "^1.6.0",
"@tailwindcss/typography": "^0.5.8",
"astro": "^3.0.12",
"astro": "^3.2.2",
"eslint": "^7.20.0",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-import": "^2.20.2",
Expand Down
Loading

0 comments on commit 9fef94d

Please sign in to comment.