Skip to content

Commit

Permalink
feat(md-enhance): remove card and add component option
Browse files Browse the repository at this point in the history
BREAKING CHANGE: card option is no longer supported
  • Loading branch information
Mister-Hope committed Nov 10, 2023
1 parent 55ea333 commit 2dbddb9
Show file tree
Hide file tree
Showing 60 changed files with 285 additions and 411 deletions.
4 changes: 2 additions & 2 deletions demo/md-enhance/src/.vuepress/config.ts
Expand Up @@ -25,11 +25,11 @@ export default defineUserConfig({
"/demo/": [
"/demo/align",
"/demo/attrs",
"/demo/card",
"/demo/chart",
"/demo/echarts",
"/demo/code-demo",
"/demo/code-tabs",
"/demo/component",
"/demo/container",
"/demo/figure",
"/demo/flowchart",
Expand Down Expand Up @@ -65,9 +65,9 @@ export default defineUserConfig({
mdEnhancePlugin({
align: true,
attrs: true,
card: true,
chart: true,
codetabs: true,
component: true,
container: true,
demo: true,
echarts: true,
Expand Down
1 change: 1 addition & 0 deletions demo/md-enhance/src/demo/README.md
Expand Up @@ -10,6 +10,7 @@ title: Get Started
- [ECharts](echarts.md)
- [Code Demo](code-demo.md)
- [Code Tabs](code-tabs.md)
- [Component](component.md)
- [Container](container.md)
- [Figure](figure.md)
- [Flowchart](flowchart.md)
Expand Down
39 changes: 0 additions & 39 deletions demo/md-enhance/src/demo/card.md

This file was deleted.

19 changes: 19 additions & 0 deletions demo/md-enhance/src/demo/component.md
@@ -0,0 +1,19 @@
---
title: Component
---

```component VPCard
title: Mr.Hope
desc: Where there is light, there is hope
logo: https://mister-hope.com/logo.svg
link: https://mister-hope.com
```

```component VPCard
{
"title": "Mr.Hope",
"desc": "Where there is light, there is hope",
"logo": "https://mister-hope.com/logo.svg",
"link": "https://mister-hope.com"
}
```
2 changes: 1 addition & 1 deletion demo/theme-blog/src/.vuepress/theme.ts
Expand Up @@ -150,9 +150,9 @@ export default hopeTheme(
mdEnhance: {
align: true,
attrs: true,
card: true,
chart: true,
codetabs: true,
component: true,
demo: true,
echarts: true,
figure: true,
Expand Down
6 changes: 3 additions & 3 deletions demo/theme-blog/src/demo/markdown.md
Expand Up @@ -187,17 +187,17 @@ Support setting color scheme and size

- [View Detail](https://theme-hope.vuejs.press/guide/markdown/image.html)

#### Card
#### Component

```card
```component VPCard
title: Mr.Hope
desc: Where there is light, there is hope
logo: https://mister-hope.com/logo.svg
link: https://mister-hope.com
color: rgba(253, 230, 138, 0.15)
```

- [View Detail](https://theme-hope.vuejs.press/guide/markdown/card.html)
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/component.html)

#### Include files

Expand Down
6 changes: 3 additions & 3 deletions demo/theme-blog/src/zh/demo/markdown.md
Expand Up @@ -167,17 +167,17 @@ npm i -D vuepress-theme-hope

- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/image.html)

#### 卡片
#### 组件

```card
```component VPCard
title: Mr.Hope
desc: Where there is light, there is hope
logo: https://mister-hope.com/logo.svg
link: https://mister-hope.com
color: rgba(253, 230, 138, 0.15)
```

- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/card.html)
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/component.html)

#### 导入文件

Expand Down
2 changes: 1 addition & 1 deletion demo/theme-docs/src/.vuepress/theme.ts
Expand Up @@ -80,9 +80,9 @@ export default hopeTheme(
mdEnhance: {
align: true,
attrs: true,
card: true,
chart: true,
codetabs: true,
component: true,
demo: true,
echarts: true,
figure: true,
Expand Down
6 changes: 3 additions & 3 deletions demo/theme-docs/src/README.md
Expand Up @@ -90,10 +90,10 @@ highlights:
details: improve syntax to specify size and color scheme
link: https://theme-hope.vuejs.press/guide/markdown/image.html

- title: Card Support
- title: Component Support
icon: square
details: Add cards in Markdown
link: https://theme-hope.vuejs.press/guide/markdown/card.html
details: Add component easily in Markdown
link: https://theme-hope.vuejs.press/guide/markdown/component.html

- title: Chart Support
icon: chart-simple
Expand Down
6 changes: 3 additions & 3 deletions demo/theme-docs/src/demo/markdown.md
Expand Up @@ -187,17 +187,17 @@ Support setting color scheme and size

- [View Detail](https://theme-hope.vuejs.press/guide/markdown/image.html)

#### Card
#### Component

```card
```component VPCard
title: Mr.Hope
desc: Where there is light, there is hope
logo: https://mister-hope.com/logo.svg
link: https://mister-hope.com
color: rgba(253, 230, 138, 0.15)
```

- [View Detail](https://theme-hope.vuejs.press/guide/markdown/card.html)
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/component.html)

#### Include files

Expand Down
8 changes: 4 additions & 4 deletions demo/theme-docs/src/zh/README.md
Expand Up @@ -90,10 +90,10 @@ highlights:
details: 使用改进的语法指定图片大小与颜色模式
link: https://theme-hope.vuejs.press/zh/guide/markdown/image.html

- title: 卡片支持
icon: square
details: 在 Markdown 中展示卡片
link: https://theme-hope.vuejs.press/zh/guide/markdown/card.html
- title: 组件支持
icon: puzzle-piece
details: 在 Markdown 中展示组件
link: https://theme-hope.vuejs.press/zh/guide/markdown/component.html

- title: 图表支持
icon: chart-simple
Expand Down
6 changes: 3 additions & 3 deletions demo/theme-docs/src/zh/demo/markdown.md
Expand Up @@ -167,17 +167,17 @@ npm i -D vuepress-theme-hope

- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/image.html)

#### 卡片
#### 组件

```card
```component VPCard
title: Mr.Hope
desc: Where there is light, there is hope
logo: https://mister-hope.com/logo.svg
link: https://mister-hope.com
color: rgba(253, 230, 138, 0.15)
```

- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/card.html)
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/component.html)

#### 导入文件

Expand Down
6 changes: 5 additions & 1 deletion docs/md-enhance/src/.vuepress/theme.ts
Expand Up @@ -19,12 +19,16 @@ export default theme("md-enhance", {
},

plugins: {
components: {
components: ["VPCard"],
},

mdEnhance: {
align: true,
attrs: true,
card: true,
chart: true,
codetabs: true,
component: true,
container: true,
demo: true,
echarts: true,
Expand Down
8 changes: 4 additions & 4 deletions docs/md-enhance/src/README.md
Expand Up @@ -86,10 +86,10 @@ highlights:
details: Group similar content with tabs and switch them together
link: ./guide/content/tabs.html

- title: Card Support
icon: square
details: Add cards in Markdown
link: ./guide/content/card.html
- title: Component Support
icon: puzzle-piece
details: Easily insert components in Markdown
link: ./guide/content/component.html

- header: Stylizing contents
image: /assets/image/marker.svg
Expand Down
6 changes: 3 additions & 3 deletions docs/md-enhance/src/config.md
Expand Up @@ -341,14 +341,14 @@ Whether to enable $\TeX$ syntax support through Math Jax. You can pass an object

Please see [source code](https://github.com/vuepress-theme-hope/vuepress-theme-hope/tree/main/packages/md-enhance/src/shared/mathjax.ts) for available options.

### card
### component

- Type: `boolean`
- Default: `false`
- Details:
- [Card](./guide/content/card.md)
- [Component](./guide/content/component.md)

Whether to enable card support
Whether to enable component support

### chart

Expand Down
8 changes: 4 additions & 4 deletions docs/md-enhance/src/guide/content/README.md
Expand Up @@ -11,7 +11,7 @@ index: false

This plugin provides the following ways to enrich your content.

- Cards: quickly create cards
- Component: quickly insert component in M.
- Footnotes: Supplementary explanation of key content
- Import files: Easily split or reuse files
- Slideshow: Show content
Expand All @@ -24,17 +24,17 @@ This plugin provides the following ways to enrich your content.

<!-- #region demo -->

### Card
### component

```card
```component VPCard
title: Mr.Hope
desc: Where there is light, there is hope
logo: https://mister-hope.com/logo.svg
link: https://mister-hope.com
color: rgba(253, 230, 138, 0.15)
```

- [View Detail](./card.md)
- [View Detail](./component.md)

### Footnote

Expand Down

0 comments on commit 2dbddb9

Please sign in to comment.