0.10.1 • Published 8 months ago

@noticle/zenn v0.10.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@noticle/zenn

Zenn package for converting Notion pages to Markdown.

🚀 Installation

# if JavaScript
npm install @noticle/core @noticle/zenn

# if TypeScript
npm install @noticle/core @noticle/zenn @noticle/types

📖 Usage

import { $getPageFullContent } from "@noticle/core";
import { NotionZennMarkdownConverter } from "@noticle/zenn";
import { Client } from "@notionhq/client";

const client = new Client({
  auth: API_KEY,
});

const pageId = "some-page-id";
// Notion API helpers in this library.
// Recursively retrieve the Notion Block's child elements
const content = await $getPageFullContent(client, pageId);

// convert to markdwon
const executor = new NotionZennMarkdownConverter();
const result = executor.execute(content);

Block Options

Callout

You can choose between Zenn message's info, warn, and alert styles based on the background color and text color settings.

colornote
redalert
otherdefault

Code

You can enable diff display using Callout Metadata

metadatavalue
diffSet to true to enable diff display

Image

You can set metadata to adjust the image size.

metadatavalue
widthSpecifies the width of the image (e.g. 500)

Embed

Speaker Deck

metadatavalue
idSpeaker Deck ID

If no ID is specified, it will be displayed as a link card.

Video

YouTube videos will be displayed as embeds. Other videos will use the video tag.

License

Distributed under the MIT License. See LICENSE for more information.

Author

malvageee (https://github.com/salvage0707)

0.10.1

8 months ago

0.10.0

8 months ago

0.9.0

9 months ago