Markdown Sample

Nuxt Content のマークダウン・MDCサンプルです

この記事は約 6 分で読めます

Prose Component

Introduction - Nuxt UI

Beautiful typography components and utilities to style your content with Nuxt UI.

https://ui.nuxt.com/getting-started/typography

見出し

## 見出し

小見出し

### 小見出し

補足見出し

#### 補足見出し

H2, H3 は目次に自動的に表示

段落

吾輩は猫である。名前はまだ無い。
どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。

吾輩は猫である。名前はまだ無い。
どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。

リンク

吾輩は猫である

https://ja.wikipedia.org/wiki/吾輩は猫である

[吾輩は猫である](https://ja.wikipedia.org/wiki/吾輩は猫である)

https://ja.wikipedia.org/wiki/吾輩は猫である

引用

吾輩は猫である。名前はまだ無い。
どこで生れたかとんと見当がつかぬ。

何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。

> 吾輩は猫である。名前はまだ無い。
>
> > 何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。

ボールド

吾輩はである。名前はまだ無い。

吾輩は****である。名前はまだ無い。

イタリック

吾輩はである。名前はまだ無い。

吾輩は**である。名前はまだ無い。

順序なしリスト

  • 吾輩は猫である
  • 名前はまだ無い
    • どこで生れたかとんと見当がつかぬ
    • 何でも薄暗いじめじめした所で
    • ニャーニャー泣いていた事だけは
  • 記憶している
- 吾輩は猫である
- 名前はまだ無い
  - どこで生れたかとんと見当がつかぬ
  - 何でも薄暗いじめじめした所で
  - ニャーニャー泣いていた事だけは
- 記憶している

順序付きリスト

  1. 吾輩は猫である
  2. 名前はまだ無い
    1. どこで生れたかとんと見当がつかぬ
    2. 何でも薄暗いじめじめした所で
    3. ニャーニャー泣いていた事だけは
  3. 記憶している
1. 吾輩は猫である
2. 名前はまだ無い
   1. どこで生れたかとんと見当がつかぬ
   2. 何でも薄暗いじめじめした所で
   3. ニャーニャー泣いていた事だけは
3. 記憶している

チェックリスト

  • 吾輩は猫である
  • 名前はまだ無い
- [x] 吾輩は猫である
- [ ] 名前はまだ無い

テーブル

Header AHeader BHeader C
Cell A1Cell B1Cell C1
Cell A2Cell B2Cell C2
| Header A | Header B | Header C |
| -------- | -------- | -------- |
| Cell A1  | Cell B1  | Cell C1  |
| Cell A2  | Cell B2  | Cell C2  |

画像

![](https://github.com/is-nao.png)

iframe

<iframe style="aspect-ratio: 16/9; width: 100%;" src="https://www.youtube.com/embed/IxX_QHay02M?si=NhRrjVwZYaZMfftl" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

サイズを style="aspect-ratio: 16/9; width: 100%;" で調整しています

Inline Code

console.log("吾輩は猫である")console.log("名前はまだ無い")console.log("どこで生れたかとんと見当がつかぬ")console.log("何でも薄暗いじめじめした所で")console.log("ニャーニャー泣いていた事だけは")console.log("記憶している")

`console.log("吾輩は猫である")`{lang="js"}
`console.log("名前はまだ無い")`{color="error"}
`console.log("何でも薄暗いじめじめした所で")`{color="primary"}
`console.log("ニャーニャー泣いていた事だけは")`{color="secondary"}
`console.log("記憶している")`{color="warning"}

コードブロック

ハイライト

wagahai.json
{
  "type": "cat",
  "name": null,
  "born": "no idea"
}
```json [wagahai.json]{3}
{
  "type": "cat",
  "name": null,
  "born": "no idea"
}
```

差分

wagahai.json
{
  "type": "cat",
  "name": null,
  "born": "no idea",  "born": "a damp and gloomy place",
  "introduction": ["I am a cat.", "but as yet I have no name."]
}
```json [wagahai.json]
{
  "type": "cat",
  "name": null,
  "born": "no idea",  "born": "a damp and gloomy place",
  "introduction": ["I am a cat.", "but as yet I have no name."]
}
```

// [!code ++] で追加行、 // [!code --] で削除行をマークします。

行末に書くとその行のみをマークし、
// [!code ++:2] のように数字を使ってその行以降から数字の行数分、差分を表現できます。

Shiki

A beautiful yet powerful syntax highlighter

https://shiki.style/packages/transformers#transformernotationdiff

コード折りたたみ

wagahai.json
{
  "type": "cat",
  "name": null,
  "born": "a damp and gloomy place",
  "introduction": [
    "I am a cat.",
    "but as yet I have no name.",
    "Where I was born is entirely unknown to me."
  ]
}
::code-collapse

```json [wagahai.json]
{
  "type": "cat",
  "name": null,
  "born": "a damp and gloomy place",
  "introduction": [
    "I am a cat.",
    "but as yet I have no name.",
    "Where I was born is entirely unknown to me."
  ]
}
```

::

脚注

吾輩は猫である1

吾輩は猫である[^1]
[^1]: 名前はまだ無い。

絵文字

吾輩は🐱である

吾輩は:cat:である

Vue Component

要素は MDC、HTML のどちらでも書けます。
読みやすさ、書きやすさによって使い分けて良いと思います。
混在させるときには、間に空行が必要です。

MDC 1 line

MDC multi line

HTML
:div[MDC 1 line]{class="bg-accented my-4"}

::div{class="bg-accented my-4"}
MDC multi line
::

<div class="bg-accented my-4">
HTML
</div>

独自実装コンポーネント

リンクカード

Introduction - Nuxt UI

Beautiful typography components and utilities to style your content with Nuxt UI.

https://ui.nuxt.com/getting-started/typography

:link-card{href="https://ui.nuxt.com/getting-started/typography"}

Mermaid

sample
graph TB
    sq[Square shape] --> ci((Circle shape))

    subgraph A
        od>Odd shape]-- Two line<br/>edge comment --> ro
        di{Diamond with <br/> line break} -.-> ro(Rounded<br>square<br>shape)
        di==>ro2(Rounded square shape)
    end

    %% Notice that no text in shape are added here instead that is appended further down
    e --> od3>Really long text with linebreak<br>in an Odd shape]

    %% Comments after double percent signs
    e((Inner / circle<br>and some odd <br>special characters)) --> f(,.?!+-*ز)

    cyr[Cyrillic]-->cyr2((Circle shape Начало));

    classDef green fill:#9f6,stroke:#333,stroke-width:2px;
    classDef orange fill:#f96,stroke:#333,stroke-width:4px;
    class sq,e green
    class di orange
```mermaid [sample]
graph TB
    sq[Square shape] --> ci((Circle shape))

    subgraph A
        od>Odd shape]-- Two line<br/>edge comment --> ro
        di{Diamond with <br/> line break} -.-> ro(Rounded<br>square<br>shape)
        di==>ro2(Rounded square shape)
    end

    %% Notice that no text in shape are added here instead that is appended further down
    e --> od3>Really long text with linebreak<br>in an Odd shape]

    %% Comments after double percent signs
    e((Inner / circle<br>and some odd <br>special characters)) --> f(,.?!+-)

    cyr[Cyrillic]-->cyr2((Circle shape Начало));

    classDef green fill:#9f6,stroke:#333,stroke-width:2px;
    classDef orange fill:#f96,stroke:#333,stroke-width:4px;
    class sq,e green
    class di orange
```

Accordion

::accordion

::accordion-item{label="吾輩は猫である。名前はまだ無い。" :icon="i-lucide-circle-help"}
どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。
::

::accordion-item{label="吾輩はここで始めて人間というものを見た。" icon="i-lucide-circle-help"}
しかもあとで聞くとそれは書生という人間中で一番獰悪な種族であったそうだ。
::

::

Badge

v3.0.0
:badge[v3.0.0]

Callout

吾輩は猫である (リンク)
名前はまだ無い
何でも薄暗いじめじめした所で
ニャーニャー泣いていた事だけは
記憶している
::callout{icon="i-lucide-cat" color="neutral" to="https://ja.wikipedia.org/wiki/吾輩は猫である"}
吾輩は猫である (リンク)
::

::note
名前はまだ無い
::

::tip
何でも薄暗いじめじめした所で
::

::warning
ニャーニャー泣いていた事だけは
::

::caution
記憶している
::

Card, Card Group

吾輩は猫である

名前はまだ無い

何でも薄暗いじめじめした所で

ニャーニャー泣いていた事だけは記憶している
::card-group

::card{title="吾輩は猫である" icon="i-lucide-cat" color="primary" to="https://ja.wikipedia.org/wiki/吾輩は猫である" target="_blank"}
名前はまだ無い
::

::card{title="何でも薄暗いじめじめした所で" icon="i-lucide-cat" color="primary" to="https://www.aozora.gr.jp/cards/000148/files/789_14547.html" target="_blank"}
ニャーニャー泣いていた事だけは記憶している
::

::

Footnotes

  1. 名前はまだ無い。