0.12.1 • Published 7 months ago
@notion-md-converter/zenn v0.12.1
@notion-md-converter/zenn
NotionページをZennのMarkdownに変換するためのパッケージです。
🚀 インストール
# JavaScriptの場合
npm install @notion-md-converter/core @notion-md-converter/zenn
# TypeScriptの場合
npm install @notion-md-converter/core @notion-md-converter/zenn @notion-md-converter/types📖 使い方
import { $getPageFullContent } from "@notion-md-converter/core";
import { NotionZennMarkdownConverter } from "@notion-md-converter/zenn";
import { Client } from "@notionhq/client";
const client = new Client({
auth: API_KEY,
});
const pageId = "some-page-id";
// このライブラリのNotion APIヘルパー
// Notion Blockの子要素を再帰的に取得
const content = await $getPageFullContent(client, pageId);
// Markdownに変換
const executor = new NotionZennMarkdownConverter();
const result = executor.execute(content);ブロックオプション
コールアウト
背景色とテキスト色の設定に基づいて、Zennメッセージのinfo、warn、alertスタイルを選択できます。
| 色 | ノート |
|---|---|
| red | alert |
| その他 | default |
コード
コールアウトメタデータを使用してdiff表示を有効にできます
| メタデータ | 値 |
|---|---|
| diff | trueに設定するとdiff表示が有効になります |
画像
メタデータを設定して画像のサイズを調整できます。
| メタデータ | 値 |
|---|---|
| width | 画像の幅を指定します(例:500) |
埋め込み
Speaker Deck
| メタデータ | 値 |
|---|---|
| id | Speaker Deck ID |
IDが指定されていない場合は、リンクカードとして表示されます。
ビデオ
YouTube動画は埋め込みとして表示されます。その他の動画はvideoタグを使用します。
ライセンス
MITライセンスの下で配布されています。詳細はLICENSEをご覧ください。
作者
malvageee (https://github.com/salvage0707)
0.12.1
7 months ago
0.12.0
7 months ago
0.11.0
7 months ago
0.10.0
7 months ago
0.9.0
9 months ago
0.8.0
9 months ago
0.7.4
9 months ago
0.7.3
9 months ago
0.7.2
10 months ago
0.7.1
10 months ago
0.6.3
10 months ago
0.6.2
10 months ago
0.6.1
10 months ago
0.6.0
10 months ago
0.5.0
10 months ago
0.4.1
10 months ago
0.4.0
10 months ago
0.3.1
10 months ago
0.3.0
10 months ago
0.2.1
10 months ago
0.2.0
10 months ago