Skip to content

Commit ca86d97

Browse files
authored
docs(markdown): refine tree
1 parent e2a0f69 commit ca86d97

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

docs/content/docs/3.files/1.markdown.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ to: https://marketplace.visualstudio.com/items?itemName=Nuxt.mdc
141141
Install the **MDC VS Code extension** to get proper syntax highlighting for the MDC syntax.
142142
::
143143

144-
## Vue Components
144+
### Vue Components
145145

146146
You can use any Vue component in your Markdown files.
147147

@@ -157,7 +157,7 @@ Default slot content
157157
Components that are used in Markdown has to be marked as `global` in your Nuxt app if you don't use the `components/content/` directory, visit [Nuxt 3 docs](https://nuxt.com/docs/guide/directory-structure/components) to learn more about it.
158158
::
159159

160-
### Block Components
160+
#### Block Components
161161

162162
Block components are components that accept Markdown content or another component as a slot.
163163

@@ -188,7 +188,7 @@ The content of the card
188188
:::
189189
::
190190

191-
### Slots
191+
#### Slots
192192

193193
A component's slots can accept content or another components.
194194

@@ -219,7 +219,7 @@ This will be rendered inside the `description` slot.
219219
:::preview-card{icon="i-lucide-eye" label="Preview"}
220220
::::example-hero
221221
My Page Title
222-
222+
223223
#description
224224
This will be rendered inside the `description` slot.
225225
::::
@@ -239,15 +239,15 @@ You can use Markdown inside your components slots:
239239
A [rich text](/) will be **rendered** by the component.
240240
::
241241
```
242-
242+
243243
```html [MyTitle.vue]
244244
<template>
245245
<h1 class="text-4xl">
246246
<slot mdc-unwrap="p" />
247247
</h1>
248248
</template>
249249
```
250-
250+
251251
::::preview-card{icon="i-lucide-eye" label="Preview"}
252252
:::::example-title
253253
A [rich text](/) will be **rendered** by the component.
@@ -256,11 +256,11 @@ You can use Markdown inside your components slots:
256256
:::
257257
::
258258

259-
### Props
259+
#### Props
260260

261261
There are two ways to pass props to components using MDC.
262262

263-
#### Inline method
263+
##### **Inline method**
264264

265265
The `{}` identifier passes props to components in a terse way by using a `key=value` syntax.
266266

@@ -329,7 +329,7 @@ If you want to pass arrays or objects as props to components you can pass them a
329329
```
330330
::
331331

332-
#### YAML method
332+
##### **YAML method**
333333

334334
The YAML method uses the `---` identifier to declare one prop per line, that can be useful for readability.
335335

@@ -400,7 +400,7 @@ Hello [World]{style="color: green;" .custom-class #custom-id}!
400400
:::
401401
::
402402

403-
In addition to mdc components and `span`, attribute syntax will work on images, links, inline `code`, **bold*&#x2A; and &#x5F;italic_ text.
403+
In addition to mdc components and `span`, attribute syntax will work on images, links, inline `code`, \**bold*\* and \_italic\_ text.
404404

405405
::code-group
406406
```md [index.md]
@@ -412,17 +412,17 @@ Attributes work on:
412412

413413
:::preview-card{prose label="Preview"}
414414
Attributes work on:
415-
415+
416416
- [link](#attributes){style="background-color: pink;"}, `code`,
417417
- *italic* and **bold** texts.
418418
:::
419419
::
420420

421-
## Binding Data in Markdown
421+
### Binding Data
422422

423423
You can bind data within your Markdown document using the `{{ $doc.variable || 'defaultValue' }}` syntax. These values can be defined in the YAML frontmatter at the top of the document, within each MDC component, or injected using the `data` prop of the `<ContentRenderer>` component.
424424

425-
### Example 1: Define in YAML
425+
#### Define in YAML
426426

427427
```mdc
428428
---
@@ -435,7 +435,7 @@ customVariable: 'Custom Value'
435435
436436
```
437437

438-
### Example 2: Define in external with `<ContentRenderer>`
438+
#### Define in external with `<ContentRenderer>`
439439

440440
```html [test.vue]
441441
<template>
@@ -526,6 +526,7 @@ If there is no `<!--more-->` divider in the text then excerpt is undefined.
526526

527527
::tip
528528
You should define the `excerpt` field in the collection schema if you want to use the excerpt feature.
529+
529530
```ts [content.config.ts]
530531
const content = defineCollection({
531532
type: 'page',
@@ -538,6 +539,7 @@ const content = defineCollection({
538539
}),
539540
})
540541
```
542+
541543
Read more about the [collection schema](/docs/collections/define#collection-schema).
542544
::
543545

0 commit comments

Comments
 (0)