Skip to content

Commit cbb8c2e

Browse files
committed
feat: rename mdc reference to comark
1 parent 0b3059d commit cbb8c2e

18 files changed

Lines changed: 2589 additions & 1432 deletions

File tree

demo/starter/slides.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ drawings:
1818
persist: false
1919
# slide transition: https://sli.dev/guide/animations.html#slide-transitions
2020
transition: slide-left
21-
# enable MDC Syntax: https://sli.dev/features/mdc
22-
mdc: true
21+
# enable Comark Syntax: https://comark.dev/syntax/markdown
22+
comark: true
2323
# duration of the presentation
2424
duration: 35min
2525
---

docs/features/code-groups.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: |
99
# Code Groups
1010

1111
> [!NOTE]
12-
> This feature requires [MDC Syntax](/features/mdc#mdc-syntax). Enable `mdc: true` to use it.
12+
> This feature requires [Comark Syntax](/features/comark#comark-syntax). Enable `comark: true` to use it.
1313
1414
You can group multiple code blocks like this:
1515

docs/features/comark.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
relates:
3+
- Comark Syntax: https://comark.dev/syntax/markdown
4+
- '@comark/markdown-it': https://github.com/comarkdown/comark
5+
since: v0.43.0
6+
tags: [syntax, styling]
7+
description: |
8+
A powerful syntax to enhance your markdown content with components and styles.
9+
---
10+
11+
# Comark Syntax
12+
13+
Slidev supports optional [Comark Syntax](https://comark.dev/syntax/markdown) (formerly known as MDC, Markdown Components) powered by [`@comark/markdown-it`](https://github.com/comarkdown/comark).
14+
15+
You can enable it by adding `comark: true` to the frontmatter of your markdown file.
16+
17+
```mdc
18+
---
19+
comark: true
20+
---
21+
22+
This is a [red text]{style="color:red"} :inline-component{prop="value"}
23+
24+
![](/image.png){width=500px lazy}
25+
26+
::block-component{prop="value"}
27+
The **default** slot
28+
::
29+
```
30+
31+
Learn more about [Comark Syntax](https://comark.dev/syntax/markdown).

docs/features/mdc.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "module",
33
"version": "52.13.0",
44
"private": true,
5-
"packageManager": "pnpm@10.28.2",
5+
"packageManager": "pnpm@10.30.3",
66
"engines": {
77
"node": ">=18.0.0"
88
},

packages/create-app/template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"@slidev/cli": "^52.13.0",
1212
"@slidev/theme-default": "latest",
1313
"@slidev/theme-seriph": "latest",
14-
"vue": "^3.5.27"
14+
"vue": "^3.5.29"
1515
}
1616
}

packages/slidev/node/syntax/markdown-it/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { ResolvedSlidevOptions } from '@slidev/types'
22
import type MagicString from 'magic-string'
33
import type MarkdownExit from 'markdown-exit'
4+
import MarkdownItComark from '@comark/markdown-it'
45
import { taskLists as MarkdownItTaskList } from '@hedgedoc/markdown-it-plugins'
56
// @ts-expect-error missing types
67
import MarkdownItFootnote from 'markdown-it-footnote'
7-
import MarkdownItMdc from 'markdown-it-mdc'
88
import MarkdownItEscapeInlineCode from './markdown-it-escape-code'
99
import MarkdownItKatex from './markdown-it-katex'
1010
import MarkdownItLink from './markdown-it-link'
@@ -26,6 +26,6 @@ export async function useMarkdownItPlugins(md: MarkdownExit, options: ResolvedSl
2626
if (features.katex)
2727
md.use(MarkdownItKatex, katexOptions)
2828
md.use(MarkdownItVDrag, markdownTransformMap)
29-
if (config.mdc)
30-
md.use(MarkdownItMdc)
29+
if (config.comark || config.mdc)
30+
md.use(MarkdownItComark)
3131
}

packages/slidev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"dependencies": {
5252
"@antfu/ni": "catalog:prod",
5353
"@antfu/utils": "catalog:frontend",
54+
"@comark/markdown-it": "catalog:prod",
5455
"@iconify-json/carbon": "catalog:icons",
5556
"@iconify-json/ph": "catalog:icons",
5657
"@iconify-json/svg-spinners": "catalog:icons",
@@ -83,7 +84,6 @@
8384
"magic-string-stack": "catalog:prod",
8485
"markdown-exit": "catalog:prod",
8586
"markdown-it-footnote": "catalog:prod",
86-
"markdown-it-mdc": "catalog:prod",
8787
"mlly": "catalog:prod",
8888
"monaco-editor": "catalog:monaco",
8989
"obug": "catalog:prod",

packages/slidev/template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ info: |
1414
Learn more at [Sli.dev](https://sli.dev)
1515
transition: slide-left
1616
title: Welcome to Slidev
17-
mdc: true
17+
comark: true
1818
---
1919

2020
# Welcome to Slidev

packages/types/src/frontmatter.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,17 @@ export interface HeadmatterConfig extends TransitionOptions {
198198
*/
199199
htmlAttrs?: Record<string, string>
200200
/**
201-
* Suppport MDC syntax
201+
* Suppport Comark syntax
202202
*
203-
* See https://github.com/antfu/markdown-it-mdc
204-
*
205-
* See https://content.nuxtjs.org/guide/writing/mdc
203+
* https://comark.dev/syntax/markdown
206204
*
207205
* @default false
208206
*/
207+
comark?: boolean
208+
/**
209+
* @deprecated MDC is now Comark. Use the `comark` option instead
210+
* @default false
211+
*/
209212
mdc?: boolean
210213
/**
211214
* Enable built-in editor

0 commit comments

Comments
 (0)