Syncs Github markdown files in your repository to Notion.
This utility is described in the following blog post.
See example Notion page.
pip install git-notion
or for local installation:
git clone https://github.com/NarekA/git-notion.git
cd git-notion
pip install -e .NOTION_TOKEN_V2 - Can be found in your browser cookies for Notion's website.
NOTION_ROOT_PAGE - URL for notion page. Repo docs will be a new page under this page.
NOTION_IGNORE_REGEX - Regex for paths to ignore.
These environment variables can be set.
export NOTION_TOKEN_V2=<YOUR_TOKEN>
export NOTION_ROOT_PAGE="https://www.notion.so/..." # Can be in setup.cfg as well
export NOTION_IGNORE_REGEX="models/.*" # Can be in setup.cfg as wellThese parameters can be set in the setup.cfg for the repo.
[git-notion]
ignore_regex = models/.*
notion_root_page = https://www.notion.so/...
If you want to map specific Github folders to Notion subpages besides the notion_root_page, you can add the folder names and subpage URLs as parameters in the setup.cfg for the repo:
[folders]
# docs = <any_notion_url> # This can be any subpage of the Notion root page
# docs/NestedTest = <any_other_notion_url> # This can be the same subpage as above, or any other subpage of the Notion root page
# To upload your current directory
git-notion
# To upload another directory
git-notion --path path/to/your/repobumpversion patch # Look-up bumpversion
rm -rf dist/
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*