Skip to content

Commit 0db992d

Browse files
authored
refactor: migrate remaining Comark 0.6 rename leftovers in examples/docs (#329)
1 parent 1d57970 commit 0db992d

12 files changed

Lines changed: 34 additions & 30 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>

examples/1.frameworks/astro/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@astrojs/react": "catalog:",
13+
"@comark/react": "workspace:*",
1314
"@tailwindcss/vite": "catalog:",
1415
"astro": "catalog:",
1516
"comark": "workspace:*",

examples/1.frameworks/astro/src/pages/posts/[...id].astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
import { getCollection } from 'astro:content'
3-
import { parse } from 'comark'
3+
import { parseMarkdown } from 'comark'
44
import Layout from '../../layouts/Layout.astro'
5-
import { MarkdownParsed } from '@comark/react'
5+
import { MarkdownDocument } from '@comark/react'
66
import highlight from 'comark/plugins/highlight'
77
import Alert from '../../components/Alert'
88
@@ -15,7 +15,7 @@ export async function getStaticPaths() {
1515
}
1616
1717
const { post } = Astro.props
18-
const tree = await parse(post.body!, {
18+
const document = await parseMarkdown(post.body!, {
1919
plugins: [
2020
highlight({
2121
themes: {
@@ -43,6 +43,6 @@ const tree = await parse(post.body!, {
4343
</div>
4444
</div>
4545
</header>
46-
<MarkdownParsed value={tree} className="prose" components={{ Alert }} />
46+
<MarkdownDocument value={document} className="prose" components={{ Alert }} />
4747
</article>
4848
</Layout>

examples/1.frameworks/nuxt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defaultValue: content/posts/comark-syntax.md
1919
::Browser{src="https://comark-nuxt.vercel.app/blog/comark-syntax"}
2020
::
2121

22-
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.
22+
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.
2323

2424
## What does `comark/nuxt` module do
2525

examples/2.vite/angular/content/posts/angular-integration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export async function getPost(slug: string) {
3030
const content = Object.entries(rawFiles)
3131
.find(([path]) => path.endsWith(`${slug}.md`))?.[1]
3232

33-
const tree = await parseMarkdown(content!, { plugins: [highlight()] })
34-
return { slug, tree, ...tree.frontmatter }
33+
const document = await parseMarkdown(content!, { plugins: [highlight()] })
34+
return { slug, tree: document, ...document.frontmatter }
3535
}
3636
```
3737

@@ -41,7 +41,7 @@ export async function getPost(slug: string) {
4141
imports: [MarkdownDocument],
4242
template: `
4343
@if (post) {
44-
<comark-markdown-parsed [value]="post.tree" [components]="components" />
44+
<comark-markdown-document [value]="post.tree" [components]="components" />
4545
}
4646
`,
4747
})
@@ -54,7 +54,7 @@ Since this is a client-side SPA, `parseMarkdown()` runs in the browser. Markdown
5454

5555
## Custom components
5656

57-
Pass custom components via the `components` input on `<comark-markdown-parsed>`. Each component receives props as `@Input()` values and children via `<ng-content />`:
57+
Pass custom components via the `components` input on `<comark-markdown-document>`. Each component receives props as `@Input()` values and children via `<ng-content />`:
5858

5959
```ts
6060
@Component({

examples/2.vite/angular/content/posts/hello-world.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ This alert is rendered using a custom Comark component mapped via the `component
2424
import { parseMarkdown } from 'comark'
2525
import { MarkdownDocument } from '@comark/angular'
2626

27-
const tree = await parseMarkdown(markdown)
28-
// <comark-markdown-parsed [value]="tree" [components]="components" />
27+
const document = await parseMarkdown(markdown)
28+
// <comark-markdown-document [value]="document" [components]="components" />
2929
```
3030

3131
::alert{type="success"}

examples/2.vite/react/README.md

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

19-
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.
19+
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.

examples/2.vite/svelte/README.md

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

22-
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.
22+
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.

examples/2.vite/vue/README.md

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

22-
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.
22+
This example demonstrates the simplest way to use Comark with Vue - use the `h()` render function with the `Markdown` component and pass it markdown content. The component handles parsing and rendering automatically.

examples/3.plugins/react-vite-math/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ This example demonstrates how to use Comark with LaTeX math formulas in React:
3434

3535
2. Import the math plugin, component, and KaTeX CSS:
3636
```tsx
37-
import { Comark } from '@comark/react'
37+
import { Markdown } from '@comark/react'
3838
import math, { Math } from '@comark/react/plugins/math'
3939
import 'katex/dist/katex.min.css'
4040
```
4141

42-
3. Pass the plugin and component to `Comark`:
42+
3. Pass the plugin and component to `Markdown`:
4343
```tsx
4444
<Markdown
4545
value={content}

0 commit comments

Comments
 (0)