1.0.3 • Published 5 months ago

@valtown/notion-to-astro v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

notion-to-astro

So you've written your documentation in Notion but want to switch to Astro Starlight to publish it. So have we! This is the script we used to convert from one to the other. Here's what it does:

NotionAstro Starlight
File names include UUIDsClean file names
Title is the first h1 headingTitle is in YAML frontmatter
Embeds are self-linksEmbeds are HTML
Exports <aside></aside> elementsWants ::note syntax
Links & images are URL-encodedThey aren't

Notion bugs

This fixes a bug in Notion: if you have a link in Notion, and the link text is an inline code span, like in markdown:

[`getTest`](https://google.com/)

Notion messes this up and outputs this instead:

`[getTest](https://google.com/)`

So any roughly Commonmark Markdown implementation will render the latter as the markdown raw text rather than the intended link.

Install

npx @valtown/notion-to-astro

Usage

npx @valtown/notion-to-astro --help

One-pass

This is intended to be run once in order to start a conversion, and then you'd do some manual tweaking. It isn't a solution to maintain content in Notion while publishing with Starlight: that would require something a lot more complicated.