Skip to content

Commit 7cca354

Browse files
committed
docs: update mistmatched docs
1 parent 78aa4a5 commit 7cca354

35 files changed

Lines changed: 151 additions & 230 deletions

File tree

docs/app/components/landing/HeroDemo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const sourceAsCode = computed(() => ['```md', props.demoMarkdown, '```'].join('\
3535
<div class="shiki-source h-[280px] overflow-y-auto overflow-x-hidden p-4 md:h-[400px]">
3636
<ComarkDocs
3737
class="font-mono text-sm/6"
38-
:markdown="sourceAsCode"
38+
:value="sourceAsCode"
3939
:components="{ ProsePre: 'pre' }"
4040
/>
4141
</div>

docs/content/8.examples/1.frameworks/astro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ defaultValue: src/content/posts/comark-syntax.md
1414
---
1515
::
1616

17-
This example demonstrates how to use Comark with Astro content collections and React components. Blog posts are stored as `.md` files with Zod-validated frontmatter, loaded via the `glob()` loader, and rendered using `ComarkRenderer` from `comark/react` with custom components like `Alert`.
17+
This example demonstrates how to use Comark with Astro content collections and React components. Blog posts are stored as `.md` files with Zod-validated frontmatter, loaded via the `glob()` loader, and rendered using `MarkdownDocument` from `@comark/react` with custom components like `Alert`.
1818

1919
## How it works
2020

2121
- **Content collections** — Posts are defined with `glob()` loader and a Zod schema for type-safe frontmatter (title, description, pubDate, tags).
22-
- **Comark parsing** — In the blog post page, `parse()` converts the raw Markdown body into a Comark AST.
23-
- **React rendering**`ComarkRenderer` from `comark/react` renders the AST using React components, including custom ones like `Alert`. Thanks to Astro's React integration, these are server-rendered with zero client-side JavaScript.
22+
- **Comark parsing** — In the blog post page, `parseMarkdown()` converts the raw Markdown body into a Comark document.
23+
- **React rendering**`MarkdownDocument` from `@comark/react` renders the AST using React components, including custom ones like `Alert`. Thanks to Astro's React integration, these are server-rendered with zero client-side JavaScript.

docs/content/8.examples/1.frameworks/nextjs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ defaultValue: content/posts/comark-syntax.md
1717
::browser{src="https://comark-nextjs.vercel.app/blog/comark-syntax"}
1818
::
1919

20-
This example demonstrates how to use Comark with Next.js App Router and React Server Components. Blog posts are stored as `.md` files with frontmatter, parsed using `parse()` from `comark`, and rendered using `ComarkRenderer` from `@comark/react` with custom components like `Alert` and `FeatureCard`.
20+
This example demonstrates how to use Comark with Next.js App Router and React Server Components. Blog posts are stored as `.md` files with frontmatter, parsed using `parseMarkdown()` from `comark`, and rendered using `MarkdownDocument` from `@comark/react` with custom components like `Alert` and `FeatureCard`.
2121

2222
## How it works
2323

2424
- **File-based content** — Posts are plain `.md` files in `content/posts/` with YAML frontmatter for metadata (title, description, pubDate, tags).
25-
- **Comark parsing**`lib/posts.ts` reads markdown files and uses `parse()` to build the AST and extract frontmatter — replacing the usual `gray-matter` + `remark` + `rehype` pipeline.
25+
- **Comark parsing**`lib/posts.ts` reads markdown files and uses `parseMarkdown()` to build the AST and extract frontmatter — replacing the usual `gray-matter` + `remark` + `rehype` pipeline.
2626
- **Static generation**`generateStaticParams` pre-renders all blog posts at build time via `output: 'export'`.
27-
- **React rendering**`ComarkRenderer` from `@comark/react` renders the AST using React Server Components, including custom ones like `Alert` and slot-aware components like `FeatureCard`. No client-side JavaScript is shipped for content rendering.
27+
- **React rendering**`MarkdownDocument` from `@comark/react` renders the AST using React Server Components, including custom ones like `Alert` and slot-aware components like `FeatureCard`. No client-side JavaScript is shipped for content rendering.

docs/content/8.examples/1.frameworks/nuxt.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ defaultValue: content/posts/comark-syntax.md
1717
::Browser{src="https://comark-nuxt.vercel.app/blog/comark-syntax"}
1818
::
1919

20-
This example demonstrates how to use Comark Syntax with Nuxt UI. Comark Syntax automatically detects when Nuxt UI is installed and uses its components for rendering. Simply add both `comark/nuxt` and `@nuxt/ui` modules to your Nuxt config, and the `Comark` component will use Nuxt UI components automatically.
20+
This example demonstrates how to use Comark Syntax with Nuxt UI. Comark Syntax automatically detects when Nuxt UI is installed and uses its components for rendering. Simply add both `@comark/nuxt` and `@nuxt/ui` modules to your Nuxt config, and the `Markdown` component will use Nuxt UI components automatically.
2121

22-
## What does `comark/nuxt` module do
22+
## What does `@comark/nuxt` module do
2323

24-
- Registers the `<Comark>` component in Nuxt for automatic import.
24+
- Registers the `<Markdown>` and `<MarkdownDocument>` components in Nuxt for automatic import.
2525
- Registers the `~/components/prose` directory in the app and all layers as a global components directory.
2626
- This allows users to override prose components by creating components in this directory.
2727
- Detects Nuxt UI and tells Nuxt UI to register its Prose components

docs/content/8.examples/1.frameworks/sveltekit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: SvelteKit
3-
description: A SvelteKit example showing Comark with lazy components, ComarkAsync, and SSR.
3+
description: A SvelteKit example showing Comark with lazy components, MarkdownAsync, and SSR.
44
navigation:
55
icon: i-simple-icons-svelte
66
---
@@ -21,8 +21,8 @@ This example demonstrates how to use Comark with SvelteKit and server-side rende
2121

2222
## How it works
2323

24-
- **Lazy SSR route**`/` renders markdown with `<ComarkAsync>` and resolves custom components through an explicit dynamic import map.
25-
- **Stable SSR route**`/stable` parses markdown in `+page.server.ts` and renders the AST with `<ComarkRenderer>`.
24+
- **Lazy SSR route**`/` renders markdown with `<MarkdownAsync>` and resolves custom components through an explicit dynamic import map.
25+
- **Stable SSR route**`/stable` parses markdown in `+page.server.ts` and renders the AST with `<MarkdownDocument>`.
2626
- **Scoped Markdown components** — components rendered from Comark live in `src/lib/components/comark/`, separate from normal app UI components.
2727
- **Component manifest** — the examples show when to return dynamic imports and when to use eager/static entries for synchronous SSR.
2828

docs/content/8.examples/2.vite/angular.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ defaultValue: src/main.ts
1414
---
1515
::
1616

17-
This example demonstrates the simplest way to use Comark with Angular - use the `ComarkComponent` and pass it markdown content. The component handles parsing and rendering automatically.
17+
This example demonstrates the simplest way to use Comark with Angular - use the `Markdown` component and pass it markdown content via the `value` prop. The component handles parsing and rendering automatically.

docs/content/8.examples/2.vite/html.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ navigation:
88
::code-tree{defaultValue="src/main.ts" expandAll}
99

1010
```ts [src/main.ts]
11-
import { createRender } from '@comark/html'
12-
import highlight from 'comark/plugins/highlight'
11+
import { createHtmlRenderer } from '@comark/html'
12+
import highlight from '@comark/html/plugins/highlight'
1313

14-
const render = createRender({
15-
parse: { plugins: [highlight()] },
14+
const renderHtml = createHtmlRenderer({
15+
plugins: [highlight()],
1616
})
1717

1818
const PREVIEW_STYLES = `
@@ -29,7 +29,7 @@ const PREVIEW_STYLES = `
2929
`
3030

3131
async function updatePreview(markdown: string) {
32-
const html = await render(markdown)
32+
const html = await renderHtml(markdown)
3333
const frame = document.getElementById('preview') as HTMLIFrameElement
3434
frame.srcdoc = `<!doctype html><html><head><style>${PREVIEW_STYLES}</style></head><body>${html}</body></html>`
3535
}

docs/content/8.examples/2.vite/react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ defaultValue: src/App.tsx
1414
---
1515
::
1616

17-
This example demonstrates the simplest way to use Comark with React - use the `Comark` component and pass it markdown content. The component handles parsing and rendering automatically.
17+
This example demonstrates the simplest way to use Comark with React - use the `Markdown` component and pass it markdown content. The component handles parsing and rendering automatically.

docs/content/8.examples/2.vite/svelte.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ defaultValue: src/App.svelte
1717
::Browser{src="https://comark-svelte.vercel.app"}
1818
::
1919

20-
This example demonstrates the simplest way to use Comark with Svelte - use the `Comark` component and pass it markdown content. The component handles parsing and rendering automatically using Svelte 5's `$state` and `$effect` runes.
20+
This example demonstrates the simplest way to use Comark with Svelte - use the `Markdown` component and pass it markdown content. The component handles parsing and rendering automatically using Svelte 5's `$state` and `$effect` runes.

docs/content/8.examples/2.vite/vue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ defaultValue: content/posts/comark-syntax.md
1717
::Browser{src="https://comark-vue.vercel.app/#/blog/comark-syntax"}
1818
::
1919

20-
This example demonstrates the simplest way to use Comark with Vue - use the `h()` render function with the `Comark` component and pass it markdown content. The component handles parsing and rendering automatically.
20+
This example demonstrates the simplest way to use Comark with Vue - use the `Markdown` component and pass it markdown content. The component handles parsing and rendering automatically.

0 commit comments

Comments
 (0)