• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    Python
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Notion >> Markdown. Python utility that converts Notion pages into MD files, along with intergation to build static webpages such as Hexo | 自动从 Notion 笔记生成 MD 文件,并部署到 Hexo 静态博客 | Notion Pages より Markdown Files をコンバートする、更に Hexo Webpages までの自動化も可能

Notion Down

🇨🇳 🇯🇵

BANNER-02

Notion Down, python tools that convert Notion blog pages into Markdown files, along with integration to build static webpages such as Hexo. Its inspiration and goal is to avoid separation of writing by keep writing drafts or posts within notion.so and then publish them into MD webpages automatically.

Examples

kaedea.com
hexo.kaedea.com
基于 Notion 的笔记写作和博客分享自动化方案

Features

What can NotionDown do now:

  • Notion pages to MarkDown files
    • Basic Notion PageBlocks parsing
    • Notion images refer & download
    • Notion nested list blocks
    • Notion obfuscated-links parsing
    • Notion table block (Collection)
    • Notion subpage / alias link parsing
  • Advanced Notion PageBlocks support
    • Pullquote Blocks (Notion ColumnList)
    • Image source replacing
      • Replace notion image url with image file
      • Replace notion image url with other CDN urls
    • Notion page embed blocks
  • Writing optimized integration
    • Noton custom ShortCode blocks that control parametered MD files generating
    • Mixed CN-EN text separation format (by pangu)
    • Spelling inspect (by pycorrector)
  • HEXO Integration
    • HEXO page properties config
    • HEXO generate
    • HEXO tags plugin
  • PyPI Publish
  • Notion APIs
    • notion-py (3rd party)
    • notion-sdk (official)

Hot It Works

NotionDown Workflows

NotionDown read Notion pages data using notion-py, and then write pages into MD files.

Basic usage

notion-down >> Notion APIs (notion-py) >> Notion pages data >> generating MD files

Advanced usage

WebHook >> notion-down >> Notion APIs (notion-py) >> Notion pages data >> generating MD files >> Copy into Hexo source >> generating webpages >> push to GitHub pages

Getting Started

Prepare

To get started with NotionDown, you should:

  1. Prepare your Notion username(email) and password, or directly use notion_token_v2.
  2. Prepare public notion blog_url as root post for NotionDown to get the pages you want to handle.
  3. Run notion-down/main.py with your configs.

Check here to get notion_token_v2.

Duplicate NotionDown Posts Template to your own notion and take it as blog_url (or you can just use your existing blog post url). Note that, for now the root page should be public as well as placed in root path of notion workspace.

Run NotionDown

Basically just run notion-down/main.py :

# Run with cli cmd
PYTHONPATH=./ python main.py \
    --blog_url <Notion Post Url> \
    --token_v2 <token_v2>
    --username <username>  # Only when token_v2 is not presented
    --password <password>  # Only when token_v2 is not presented

# or
PYTHONPATH=./ python main.py \
    --config_file '.config_file.json'

# Your can configure notion-down args by cli-args, config_file or SysEnv parameters
# Priority: cli args > config_file > SysEnv parameters > NotionDown default

For custom configurations in details, see Custom Configurations.

Also check the following procedures as showcase usages for NotionDown.

CI Build Script

See building script at /.circleci/config.yaml.

  • test-build-readme: CircleCI jobs generating README for this repo.
  • test-build-hexo: CircleCI jobs generating Hexo posts for https://github.com/kaedea/notion-down-hexo-showcase.
  • test-run-pycorrector: CircleCI jobs that executing spelling check for the test posts.

Showcase Jobs

See the usage showcase jobs at /jobs, and jobs outputs at /dist.

UnitTest Examples

See unittest cases at test/.


This page is generated by notion-down from notion.so NotionDown-README.

More Repositories

1

android-dynamical-loading

🔌 Android plugin development library (Frontia) and tech introductions, which means that you can upgrade your Android APP or fix emergent bugs, as well as reduce the file size of Apk without any re-installation.
Java
1,076
star
2

android-mvp-pattern

An android simple but clear sample project for MVP pattern, including mvp usage with eventbus. @Deprecated, try google official solution: https://developer.android.com/topic/libraries/architecture/
Java
696
star
3

android-tagview

An Android TagView Widget. You can edit the tag's style, and set listener of selecting or deleting tag.
Java
663
star
4

fresco-sample-usage

Android demo project as sample usage for Facebook's Fresco in detail, which is an awesome image loading library for Android.
Java
213
star
5

Andriod-Seamless-ViewPager-Header

SeamlessViewpagerHeader offers a Viewpager with a scrollable header, like Android Lollipop Contacts or Google Play Pagers.
Java
129
star
6

notion-up

Use NotionUp (Notion Backup) + CircleCI to backup your notion data nightly.|自动备份 Notion 数据。|Notion データのバックアップを自動化する
Python
121
star
7

dualapp-mediastore-compatibility

安卓双开/分身 MediaStore 兼容性测试。Tuning of Android MediaStore & File IO compatibility issues between HostProfile App and WorkProfile/DualApp/MultiApp.
Java
34
star
8

gradle-maven-publication

Gradle maven artifacts publishing walkaround with 'maven', 'maven-publish', 'android-maven' gradle plugins. The project contains both of scripts and custom gradle plugin which are designed to make the publishing jobs much simpler and correct. Of course, both java & android project are supported!
Groovy
18
star
9

Feya

'Feya' is a repo for code snippet tweaking. Nothing can be found here.
Java
14
star
10

how-old-camera

An android application for Microsoft how-old.net, as Sample usage for Android `MVP` design pattern and `android-async-http`.
Java
12
star
11

b-log

BLog is not blog but an android logcat entended utility library. It helps to log message to file as well as print in logcat window.
Java
12
star
12

comment-formatter

Comment Formatter is an IntelliJ plugin that formats comments to a friendly style.
Java
10
star
13

aab-signer

Android AppBundle aab package signing tool.
10
star
14

pixel-bar

Google's Pixel-like search bar for launcher
Kotlin
9
star
15

Android-MarqueeView

Android上的跑马灯布局,布局里面的内容会像跑马灯一样滚动。
Java
6
star
16

android-swipe-loading-view

SwipeLoadingView offers a LoadingView like drawer when you are swiping on it. You can use this view when you want to switch something like video or picture.
Java
5
star
17

junwind

Get Java thread's stacktrace by native tid.
Java
5
star
18

leakcanary-demo

Demo project for Square's LeakCanary, a awesome library that help you to detect memory leak in your Android project.
Java
4
star
19

intransitives

Gradle plugin for intransitive-complie dependencies.
Groovy
2
star
20

Android-SquareLayout

Android SquareLayout
Java
2
star
21

rainy-mood

Android APP wiht rain sounds of different scenes. It was created for me because I had been in trouble with sleep for a long time and this APP is helpful.
Java
2
star
22

moe-navigator

nijigen website navigator
HTML
1
star
23

hackintosh-changelog

Hackintosh setups (CLOVER/OC) for my PC: Z170i + 6700K Desktop, XPS 9360 QHD+ Laptop
ASL
1
star