diff --git a/.github/workflows/notion2github.yml b/.github/workflows/notion2github.yml
index c97fbf8..409c2b9 100644
--- a/.github/workflows/notion2github.yml
+++ b/.github/workflows/notion2github.yml
@@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- name: Notion2Github
- uses: younho9/notion2github@v1.0.0-beta
+ uses: younho9/notion2github@main
with:
database-url: 'https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad'
docs-directory: docs/test
diff --git a/README.md b/README.md
index 14d5152..5ca90b7 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,11 @@
[](https://github.com/marketplace/actions/notion2github)
[](.github/workflows/notion2github.yml)
-[](https://github.com/younho9/narkdown/releases/tag/v1.0.0-beta)
+[](https://github.com/younho9/notion2github/releases/tag/v1.0.1)
[](./LICENSE)
+| [English](/README.md) | [ํ๊ตญ์ด](/docs/README.ko.md) |
+
**Automatic syncronization from Notion to Github**
---
@@ -18,37 +20,24 @@
## Usage
-### Using encrypted token_v2 in a workflow
+### Quick Start
-
-

-
+1. Go to `github.com/{your_id}/{your_repo}/settings/secrets/actions`
-The `token_v2` is required to get contents from Notion. The `token_v2` of notion is a variable that should not be shared. So you can use encrypted secrets in your repository.
+2. Set `token_v2` of Notion to your repository secret.
-For more information, See ["Using encrypted secrets in a workflow"](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow)
-
-### Parameters
+ 
-| Name | Description | Required | Default |
-| ---------------- | -------------------------------------------------------------- | ---------- | -------- |
-| `database-url` | URL of the Notion database to extract. | `required` | |
-| `docs-directory` | Directory in which the Notion pages to extract will be stored. | | `"docs"` |
-| `filter-prop` | Property of the filter to apply to the notion database. | | `""` |
-| `filter-value` | Value of the filter to apply to the notion database. | | `""` |
+ [How To Find Your Notion v2 Token - Red Gregory](https://www.redgregory.com/notion/2020/6/15/9zuzav95gwzwewdu1dspweqbv481s5)
-### Database template page for test
+ [Encrypted secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow)
-Here is an [database template page](/acc3dfd0339e4cacb5baae8673fddfad?v=be43c1c8dd644cfb9df9efd97d8af60a) for importing pages from the database. Move to that page, duplicate it, and test it.
+3. Create a workflow in `.github/workflows/**.yml` of your repository
-
-

-
+Here are examples.
### Example Workflow
-Create workflow in `.github/workflows/**.yml`
-
#### Example 1 (run on push & pull request in main)
```yaml
@@ -66,12 +55,10 @@ jobs:
uses: actions/checkout@v2
- name: Notion2Github
- uses: younho9/notion2github@v1.0.0-beta
+ uses: younho9/notion2github@v1.1.0
with:
database-url: 'https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad'
- docs-directory: docs/test
- filter-prop: Category
- filter-value: Test
+ docs-directory: docs
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
@@ -99,12 +86,10 @@ jobs:
uses: actions/checkout@v2
- name: Notion2Github
- uses: younho9/notion2github@v1.0.0-beta
+ uses: younho9/notion2github@v1.1.0
with:
database-url: 'https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad'
- docs-directory: docs/test
- filter-prop: Category
- filter-value: Test
+ docs-directory: docs
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
@@ -125,7 +110,26 @@ jobs:
- [younho9/TIL](https://github.com/younho9/til/blob/main/.github/workflows/notion2github.yml)
-## Configuring Narkdown
+## Database template page for test
+
+Here is an [database template page](https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad?v=be43c1c8dd644cfb9df9efd97d8af60a) for importing pages from the database. Move to that page, duplicate it, and test it.
+
+
+

+
+
+## Configuration
+
+### Parameters
+
+| Name | Description | Required | Default |
+| ---------------- | -------------------------------------------------------------- | ---------- | -------- |
+| `database-url` | URL of the Notion database to extract. | `required` | |
+| `docs-directory` | Directory in which the Notion pages to extract will be stored. | | `"docs"` |
+| `filter-prop` | Property of the filter to apply to the notion database. | | `""` |
+| `filter-value` | Value of the filter to apply to the notion database. | | `""` |
+
+### Configuring Narkdown
Narkdown provides some configuration for how to extract documents. You can configure Narkdown via `narkdown.config.json` .
@@ -139,15 +143,12 @@ For more information on configure your environment, [see the document in Nakdown
"exportConfig": {
"recursiveExport": true,
"createPageDirectory": true,
- "addMetadata": false,
- "lowerPathname": false,
- "lowerFilename": false,
- "lineBreak": false
+ "addMetadata": true,
+ "appendCreatedTime": true,
+ "generateSlug": true
},
"databaseConfig": {
"categoryColumnName": "Category",
- "tagsColumnName": "Tags",
- "createdTimeColumnName": "Created Time",
"statusColumnName": "Status",
"currentStatus": "โ
Completed",
"nextStatus": "๐จ Published"
@@ -155,6 +156,16 @@ For more information on configure your environment, [see the document in Nakdown
}
```
+### Used in combination with other actions
+
+Notion2Github is a step in the workflow, just import the contents of notion to a running virtual machine in github action.
+
+There are great actions to commit the imported content to your repository.
+
+- [Git Auto Commit - GitHub Marketplace](https://github.com/marketplace/actions/git-auto-commit)
+
+- [Prettier Action - GitHub Marketplace](https://github.com/marketplace/actions/prettier-action)
+
### License
MIT ยฉ [younho9](https://github.com/younho9)
diff --git a/docs/README.ko.md b/docs/README.ko.md
new file mode 100644
index 0000000..5183be0
--- /dev/null
+++ b/docs/README.ko.md
@@ -0,0 +1,170 @@
+
+
+# Notion2Github
+
+[](https://github.com/marketplace/actions/notion2github)
+[](.github/workflows/notion2github.yml)
+[](https://github.com/younho9/notion2github/releases/tag/v1.0.1)
+[](./LICENSE)
+
+| [English](/README.md) | [ํ๊ตญ์ด](/docs/README.ko.md) |
+
+**๋
ธ์
์์ ๊นํ์ผ๋ก์ ์๋ ๋๊ธฐํ**
+
+---
+
+> โ ๏ธ **์ ์์ฌํญ:** Notion2Github์ [Jamie Alexandre](https://github.com/jamalex)์ด ๋ง๋ **_๋น๊ณต์_** ๋
ธ์
API์ธ [notion-py](https://github.com/jamalex/notion-py) ํ๋ก์ ํธ์ ์์กดํ๊ณ ์์ต๋๋ค. ๊ณต์ API๊ฐ ์๋๊ธฐ ๋๋ฌธ์ ์์ ์ ์ด์ง ์์ ์ ์์ต๋๋ค. ํ๋ก๋์
ํ๊ฒฝ์์ ์ฌ์ฉํ๊ณ ์ ํ๋ค๋ฉด, ๋
ธ์
๊ณต์ API ์ถ์๋ฅผ ๊ธฐ๋ค๋ฆฌ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
+
+---
+
+## ์ฌ์ฉ๋ฒ
+
+### ๋ฐ๋ก ์์ํ๊ธฐ
+
+1. `github.com/{your_id}/{your_repo}/settings/secrets/actions` ์ผ๋ก ์ด๋ํฉ๋๋ค.
+
+1. ๋
ธ์
์ `token_v2` ๋ฅผ ๋ ํฌ์งํ ๋ฆฌ์ Secrets์ผ๋ก ์ค์ ํฉ๋๋ค.
+
+ 
+
+ [How To Find Your Notion v2 Token - Red Gregory](https://www.redgregory.com/notion/2020/6/15/9zuzav95gwzwewdu1dspweqbv481s5)
+
+ [Encrypted secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow)
+
+1. ๋ ํฌ์งํ ๋ฆฌ์ `.github/workflows/**.yml` ํ์ผ์ ์ํฌํ๋ก์ฐ๋ฅผ ์์ฑํฉ๋๋ค.
+
+๋ช ๊ฐ์ง ์์์
๋๋ค.
+
+### ์ํฌํ๋ก์ฐ ์์
+
+#### ์์ 1 (main ๋ธ๋์น์ push & pull request ์์ ์คํ)
+
+```yaml
+name: Notion2Github
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+jobs:
+ auto-sync-from-notion-to-github:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Notion2Github
+ uses: younho9/notion2github@v1.1.0
+ with:
+ database-url: 'https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad'
+ docs-directory: docs
+ env:
+ NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
+
+ - name: Format documents
+ uses: creyD/prettier_action@v3.1
+ with:
+ prettier_options: --write ./docs/**/*.md
+ commit_message: 'docs: Update docs (auto)'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+```
+
+#### ์์ 2 (์ ํด์ง ์๊ฐ์ ์คํ)
+
+```yaml
+name: Notion2Github
+on:
+ schedule:
+ - cron: '0 14 * * *'
+jobs:
+ auto-sync-from-notion-to-github:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Notion2Github
+ uses: younho9/notion2github@v1.1.0
+ with:
+ database-url: 'https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad'
+ docs-directory: docs
+ env:
+ NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
+
+ - name: Format documents
+ uses: creyD/prettier_action@v3.1
+ with:
+ prettier_options: --write ./docs/**/*.md
+ commit_message: 'docs: Update docs (auto)'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+```
+
+> [ํฌ๋ก ํญ ์ค์ ์ ์ ์ฉํ ์ฌ์ดํธ](https://crontab.guru/)
+
+### ์ค์ฌ์ฉ ์์
+
+- [younho9/narkdown](https://github.com/younho9/narkdown/blob/main/.github/workflows/notion2github.yml)
+
+- [younho9/TIL](https://github.com/younho9/til/blob/main/.github/workflows/notion2github.yml)
+
+## ํ
์คํธ๋ฅผ ์ํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ํ
ํ๋ฆฟ ํ์ด์ง
+
+๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก๋ถํฐ ํ์ด์ง๋ค์ ๊ฐ์ ธ์ฌ ์ ์๋ [๋ฐ์ดํฐ๋ฒ ์ด์ค ํ
ํ๋ฆฟ ํ์ด์ง](https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad?v=be43c1c8dd644cfb9df9efd97d8af60a)๊ฐ ์์ต๋๋ค.
+
+ํ์ด์ง๋ก ์ด๋ํด์ ๋ณต์ ํ๊ณ ํ
์คํธํด๋ณผ ์ ์์ต๋๋ค.
+
+
+

+
+
+## ํ๊ฒฝ์ค์
+
+| Name | Description | Required | Default |
+| ---------------- | ------------------------------------------- | ---------- | -------- |
+| `database-url` | ์ถ์ถํ ๋
ธ์
๋ฐ์ดํฐ๋ฒ ์ด์ค์ URL | `required` | |
+| `docs-directory` | ์ถ์ถ๋ ๋
ธ์
ํ์ด์ง๋ค์ด ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ | | `"docs"` |
+| `filter-prop` | ๋
ธ์
๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฉํ ํํฐ์ ์์ฑ ์ด๋ฆ | | `""` |
+| `filter-value` | ๋
ธ์
๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฉํ ํํฐ์ ๊ฐ ์ด๋ฆ | | `""` |
+
+### Narkdown ํ๊ฒฝ์ค์
+
+Narkdown์ ๋ฌธ์๋ค์ ์ด๋ป๊ฒ ์ถ์ถํ ๊ฒ์ธ์ง์ ๋ํด ๋ช๊ฐ์ง ํ๊ฒฝ์ค์ ์ ์ ๊ณตํฉ๋๋ค. `narkdown.config.json` ํ์ผ์ ํตํด์ Narkdown์ ํ๊ฒฝ์ค์ ํ ์ ์์ต๋๋ค.
+
+๋ ํฌ์งํ ๋ฆฌ์ root์ `narkdown.config.json` ํ์ผ์ ์์ฑํ์ธ์.
+
+ํ๊ฒฝ์ ๋ฐ๋ผ ํ๊ฒฝ์ค์ ํ๋ ๋ฐฉ๋ฒ์ ๋ํ ๋ ๋ง์ ์ ๋ณด๋ฅผ ๋ณด๋ ค๋ฉด [Narkdown์ ๋ฌธ์๋ฅผ ํ์ธํ์ธ์](https://github.com/younho9/narkdown#configuring-narkdown).
+
+```json
+// narkdown.config.json
+{
+ "exportConfig": {
+ "recursiveExport": true,
+ "createPageDirectory": true,
+ "addMetadata": true,
+ "appendCreatedTime": true,
+ "generateSlug": true
+ },
+ "databaseConfig": {
+ "categoryColumnName": "Category",
+ "statusColumnName": "Status",
+ "currentStatus": "โ
Completed",
+ "nextStatus": "๐จ Published"
+ }
+}
+```
+
+### ๋ค๋ฅธ ์ก์
๊ณผ ์กฐํฉํ์ฌ ์ฌ์ฉ
+
+Notion2Github์ ์ํฌํ๋ก์ฐ์ ํ step์ผ๋ก ๋จ์ง github action์ผ๋ก ์คํ๋๋ ๊ฐ์ ๋จธ์ ์ผ๋ก ๋
ธ์
์ ์ฝํ
์ธ ๋ค์ ๊ฐ์ ธ์ฌ ๋ฟ์
๋๋ค.
+
+๋
ธ์
์ ์ฝํ
์ธ ๋ค์ ๋ ํฌ์งํ ๋ฆฌ๋ก ์ปค๋ฐํ ์ ์๋ ํ๋ฅญํ action๋ค์ด ์์ต๋๋ค.
+
+- [Git Auto Commit - GitHub Marketplace](https://github.com/marketplace/actions/git-auto-commit)
+
+- [Prettier Action - GitHub Marketplace](https://github.com/marketplace/actions/prettier-action)
+
+### License
+
+MIT ยฉ [younho9](https://github.com/younho9)
diff --git a/narkdown.config.json b/narkdown.config.json
index 16cd5c0..6ab6355 100644
--- a/narkdown.config.json
+++ b/narkdown.config.json
@@ -2,15 +2,12 @@
"exportConfig": {
"recursiveExport": true,
"createPageDirectory": true,
- "addMetadata": false,
- "lowerPathname": true,
- "lowerFilename": true,
- "lineBreak": false
+ "addMetadata": true,
+ "appendCreatedTime": true,
+ "generateSlug": true
},
"databaseConfig": {
"categoryColumnName": "Category",
- "tagsColumnName": "Tags",
- "createdTimeColumnName": "Created Time",
"statusColumnName": "Status",
"currentStatus": "โ
Completed",
"nextStatus": "๐จ Published"
diff --git a/requirements.txt b/requirements.txt
index 56bf8f8..17bb333 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +1 @@
-narkdown==1.2.3
+narkdown