パイプライン(Pipeline)
Markdownをmdastへパースし、remarkプラグインで変換し、hastへブリッジし、rehypeプラグインでHTMLを変換する処理パイプラインです。Coreが駆動し、プラグインが拡張します。
パイプラインの段階
パイプラインは決まった順序で実行されます。
- Markdownのパース:
remarkParse、remarkFrontmatter、remarkGfm、remarkMath - Remarkプラグイン:サイト固有およびユーザー提供の
remarkPlugins - HTMLへのブリッジ:
allowDangerousHtml: trueを指定したremarkRehype - Rehypeプラグイン:
rehypeRaw、サイトが提供するrehypePlugins、rehypeSlug、rehypeKatex、rehypeFormat - HTMLの文字列化:
rehypeStringify
import { Pipeline } from "@riebeckite/core";
const pipeline = new Pipeline(contentIndex, permalinks);
const post = await pipeline.execute(markdownContent);
関連用語
さらに詳しく
- [../framework/content-system.ja.md]