You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
-
# notion-pull-mdx
1
+
# docu-notion
2
2
3
-
notion-pull-mdx lets you use Notion as your editor for markdown-based static site generators like[Docusaurus](https://docusaurus.io/). Using Notion instead of raw markdown files means that you don't have to teach non-developers how to make git commits and pull requests. It also allows you to leverage Notion's database tools to control workflow, Notion's commenting feature to discuss changes, etc.
3
+
docu-notion lets you use Notion as your editor for [Docusaurus](https://docusaurus.io/). Using Notion instead of raw markdown files means that you don't have to teach non-developers how to make git commits and pull requests. It also allows you to leverage Notion's database tools to control workflow, Notion's commenting feature to discuss changes, etc.
4
4
5
-
Example Site: https://sillsdev.github.io/notion-pull-mdx-sample-site/
5
+
Example Site: https://sillsdev.github.io/docu-notion-sample-site/
6
6
7
7
# Instructions
8
8
9
9
## 1. Set up your documentation site.
10
10
11
-
First, prepare your markdown-based static file system like [Docusaurus](https://docusaurus.io/). For a shortcut with github actions, search, and deployment to github pages, you can just copy [this template](https://github.com/sillsdev/notion-pull-mdx-sample-site).
11
+
First, prepare your markdown-based static file system like [Docusaurus](https://docusaurus.io/). For a shortcut with github actions, search, and deployment to github pages, you can just copy [this template](https://github.com/sillsdev/docu-notion-sample-site).
12
12
13
-
## 2. In Notion, duplicate the notion-pull-mdx template
13
+
## 2. In Notion, duplicate the docu-notion template
14
14
15
15
Go to [this template page](https://hattonjohn.notion.site/Documentation-Template-Docusaurus-0e998b32da3c47edad0f62a25b49818c). Duplicate it into your own workspace.
16
16
You can name it anything you like, e.g. "Documentation Root".
17
17
18
18
## 3. Create a Notion Integration
19
19
20
-
In order for notion-pull-mdx to read your site via Notion's API, you need to create what Notion calls an "integration". Follow [these instructions](https://developers.notion.com/docs/getting-started) to make an integration and get your token. Limit your integration to "READ" access.
20
+
In order for docu-notion to read your site via Notion's API, you need to create what Notion calls an "integration". Follow [these instructions](https://developers.notion.com/docs/getting-started) to make an integration and get your token. Limit your integration to "READ" access.
21
21
22
22
## 4. "Invite" your Notion Integration to read you page
23
23
@@ -27,7 +27,7 @@ In Notion, click "Share" on the root of your documentation and "invite" your int
27
27
28
28
## 5. Add your pages under your Outline page.
29
29
30
-
Currently, notion-pull-mdx expects that each page has only one of the following: subpages, links to other pages, or normal content. Do not mix them. You can add content pages directly here, but then you won't be able to make use of the workflow features. If those matter to you, instead make new pages under the "Database" and then link to them in your outline pages.
30
+
Currently, docu-notion expects that each page has only one of the following: subpages, links to other pages, or normal content. Do not mix them. You can add content pages directly here, but then you won't be able to make use of the workflow features. If those matter to you, instead make new pages under the "Database" and then link to them in your outline pages.
31
31
32
32
## 6. Pull your pages
33
33
@@ -38,34 +38,34 @@ means that the id is "0456aa5842946PRETEND4f37c97a0e5".
38
38
Determine where you want the markdown files and images to land. The following works well for Docusaurus instances:
NOTE: In the above, we are using `npx` to use the latest `notion-pull-mdx`. A more conservative approach would be to `npm i cross-var notion-pull-mdx` and then create a script in your package.json like this:
56
+
NOTE: In the above, we are using `npx` to use the latest `docu-notion`. A more conservative approach would be to `npm i cross-var docu-notion` and then create a script in your package.json like this:
Most projects should probably commit the current markdown and image files each time you run notion-pull-mdx.
68
+
Most projects should probably commit the current markdown and image files each time you run docu-notion.
69
69
70
70
Note that if you choose not to commit, the workflow feature (see below) won't work for you. Imagine the case where a document that previously had a `Status` property of `Publish` now has a different status. You probably want to keep publishing the old version until the new one is ready. But if you don't commit files, your CI system (e.g. Github Actions) won't have the old version around, so it will disappear from your site.
71
71
@@ -75,27 +75,27 @@ One of the big attractions of Notion for large documentation projects is that yo
notion-pull-mdx is not doing anything smart with regards to previously Published but now not Published documents. All it does is ignore every Notion document that doesn't have `status == Publish`. So if the old version of the document is still in your file tree when your static site generator (e.g. Docusaurus) runs, then it will appear on your website. If it isn't there, it won't. If you rename directories or move the document, notion-pull-mdx will not realize this and will delete the previously published markdown file.
84
+
docu-notion is not doing anything smart with regards to previously Published but now not Published documents. All it does is ignore every Notion document that doesn't have `status == Publish`. So if the old version of the document is still in your file tree when your static site generator (e.g. Docusaurus) runs, then it will appear on your website. If it isn't there, it won't. If you rename directories or move the document, docu-notion will not realize this and will delete the previously published markdown file.
85
85
86
86
Links from one document to another in Notion are not yet converted to local links.
87
87
88
-
notion-pull-mdx makes some attempt to keep the right order of things, but there are definitely cases where it isn't smart enough yet.
88
+
docu-notion makes some attempt to keep the right order of things, but there are definitely cases where it isn't smart enough yet.
89
89
90
90
# Text Localization
91
91
92
92
Localize your files in Crowdin (or whatever) based on the markdown files, not in Notion. For how to do this with Docusaurus, see [Docusaurus i18n](https://docusaurus.io/docs/i18n/crowdin).
93
93
94
94
# Screenshot Localization
95
95
96
-
The only way we know of to provide localization of image in the current Docusaurus (2.0) is to place the images in the same directory as the markdown, and use relative paths for images. Most projects probably won't localize _every_ image, so we also need a way to "fall back" to the original screenshot when the localized one is missing. `notion-pull-mdx` facilitates this. If no localized version of an image is available, `notion-pull-mdx` places a copy of the original image into the correct location.
96
+
The only way we know of to provide localization of image in the current Docusaurus (2.0) is to place the images in the same directory as the markdown, and use relative paths for images. Most projects probably won't localize _every_ image, so we also need a way to "fall back" to the original screenshot when the localized one is missing. `docu-notion` facilitates this. If no localized version of an image is available, `docu-notion` places a copy of the original image into the correct location.
97
97
98
-
So how do you provide these localized screenshot files? Crowdin can handle localizing assets, and in the future we may support that. For now, we currently support a different approach. If you place for example `fr https:\\imgur.com\1234.png` in the caption of a screenshot in Notion, `notion-pull-mdx` will fetch that image and save it in the right place to be found when in French mode. Getting URLs to screenshots is easy with screenshot utilities such as [Greenshot](https://getgreenshot.org/) that support uploading to imgur. Note that `notion-pull-mdx` stores a copy of all images in your source tree, so you wouldn't lose the images if imgur were to go away.
98
+
So how do you provide these localized screenshot files? Crowdin can handle localizing assets, and in the future we may support that. For now, we currently support a different approach. If you place for example `fr https:\\imgur.com\1234.png` in the caption of a screenshot in Notion, `docu-notion` will fetch that image and save it in the right place to be found when in French mode. Getting URLs to screenshots is easy with screenshot utilities such as [Greenshot](https://getgreenshot.org/) that support uploading to imgur. Note that `docu-notion` stores a copy of all images in your source tree, so you wouldn't lose the images if imgur were to go away.
99
99
100
100
NOTE: that as far as I can tell, when you run `docusaurus start` docusaurus 2.0 offers the language picker but it doesn't actually work. So to test out the localized version, do `docusaurus build` followed by `docusaurus serve`.
Copy file name to clipboardExpand all lines: src/NotionPage.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ const notionLimiter = new RateLimiter({
16
16
letnotionClient: Client;
17
17
18
18
// Notion has 2 kinds of pages: a normal one which is just content, and what I'm calling a "database page", which has whatever properties you put on it.
19
-
// notion-pull-mdx supports the later via links from outline pages. That is, you put the database pages in a database, then separately, in the outline, you
19
+
// docu-notion supports the later via links from outline pages. That is, you put the database pages in a database, then separately, in the outline, you
20
20
// create pages for each node of the outline and then add links from those to the database pages. In this way, we get the benefits of database
21
21
// pages (metadata, workflow, etc) and also normal pages (order, position in the outline).
`Skipping "${pageInTheOutline.nameOrTitle}" and its children. notion-pull-mdx does not support pages that are both levels and have content at the same time.`
113
+
`Skipping "${pageInTheOutline.nameOrTitle}" and its children. docu-notion does not support pages that are both levels and have content at the same time.`
0 commit comments