directive()

`:::name` 構文のコンテナディレクティブをサポートします。

import { directive } from "@unifast/node";

シグネチャ

function directive(): UnifastPlugin

パラメータ

なし。

使い方

import { compile, directive } from "@unifast/node";

const result = compile(md, { plugins: [directive()] });

使用例

コンテナディレクティブ

これらは GitHub Alerts と同様に、CSS の .directive-note.directive-warning クラスでスタイリングできます。加えて、名前は完全にカスタマイズ可能です。

属性付きのコンテナ

:::warning title="Deprecation Notice"
This API will be removed in the next major version.
:::

ネストされたコンテンツ

ディレクティブの内部では、リスト、コードブロック、インラインの書式など、フルの Markdown を利用できます。

:::note
You can include **bold**, *italic*, and other Markdown inside containers.

- List items work too
- As does `inline code`
:::