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
------------------
Breaking change:
Previously, image files names were a hash of all or part of the image url.
To provide more stability and future-proofing, the default format is now `{page-slug}.{notion-block-id}`. (sillsdev#82)
Users can opt in to the old format with `--image-file-name-format legacy`.
------------------
Feature:
If desired instead, users can specify `--image-file-name-format content-hash` to use a hash of the image content as the file name. (sillsdev#76)
------------------
Potential breaking change for plugins:
The exported type IDocuNotionContext changed from
```
export type IDocuNotionContext = {
layoutStrategy: LayoutStrategy;
options: DocuNotionOptions;
getBlockChildren: IGetBlockChildrenFn;
notionToMarkdown: NotionToMarkdown;
directoryContainingMarkdown: string;
relativeFilePathToFolderContainingPage: string;
convertNotionLinkToLocalDocusaurusLink: (url: string) => string | undefined;
pages: NotionPage[];
counts: ICounts;
imports: string[];
};
```
to
```
export type IDocuNotionContext = {
layoutStrategy: LayoutStrategy;
options: DocuNotionOptions;
getBlockChildren: IGetBlockChildrenFn;
notionToMarkdown: NotionToMarkdown;
pageInfo: IDocuNotionContextPageInfo;
convertNotionLinkToLocalDocusaurusLink: (url: string) => string | undefined;
pages: NotionPage[];
counts: ICounts;
imports: string[];
};
```
where `IDocuNotionContextPageInfo` is
```
export type IDocuNotionContextPageInfo = {
directoryContainingMarkdown: string;
relativeFilePathToFolderContainingPage: string;
slug: string;
};
```
Copy file name to clipboardExpand all lines: README.md
+22-19Lines changed: 22 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Example Site: https://sillsdev.github.io/docu-notion-sample-site/
6
6
7
7
# Instructions
8
8
9
-
## 1. Set up your documentation site.
9
+
## 1. Set up your documentation site
10
10
11
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
@@ -27,15 +27,15 @@ Go to the page that will be the root of your site. This page should have, as dir
Currently, docu-notion expects that each page has only one of the following: sub-pages, 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.
33
33
34
34
## 6. Pull your pages
35
35
36
-
First, determine the id of your root page by clicking "Share" and looking at the url it gives you. E.g.
| -n, --notion-token <string> | required | notion api token, which looks like `secret_3bc1b50XFYb15123RHF243x43450XFY33250XFYa343`|
128
-
| -r, --root-page <string> | required | The 31 character ID of the page which is the root of your docs page in notion. The code will look like `9120ec9960244ead80fa2ef4bc1bba25`. This page must have a child page named 'Outline' |
129
-
| -m, --markdown-output-path <string> || Root of the hierarchy for md files. WARNING: node-pull-mdx will delete files from this directory. Note also that if it finds localized images, it will create an i18n/ directory as a sibling. (default: "./docs") |
130
-
| -t, --status-tag <string> || Database pages without a Notion page property 'status' matching this will be ignored. Use '\*' to ignore status altogether. (default: `Publish`) |
131
-
| --locales <codes> || Comma-separated list of iso 639-2 codes, the same list as in docusaurus.config.js, minus the primary (i.e. 'en'). This is needed for image localization. (default: []) |
| -i, --img-output-path <string> || Path to directory where images will be stored. If this is not included, images will be placed in the same directory as the document that uses them, which then allows for localization of screenshots. |
134
-
| -p, --img-prefix-in-markdown <string> || When referencing an image from markdown, prefix with this path instead of the full img-output-path. Should be used only in conjunction with --img-output-path. |
135
-
| --require-slugs || If set, docu-notion will fail if any pages it would otherwise publish are missing a slug in Notion. |
136
-
| -h, --help || display help for command |
127
+
|`-n, --notion-token <string>`| required | notion api token, which looks like `secret_3bc1b50XFYb15123RHF243x43450XFY33250XFYa343`|
128
+
|`-r, --root-page <string>`| required | The 31 character ID of the page which is the root of your docs page in notion. The code will look like `9120ec9960244ead80fa2ef4bc1bba25`. This page must have a child page named 'Outline' |
129
+
|`-m, --markdown-output-path <string>`|| Root of the hierarchy for md files. WARNING: node-pull-mdx will delete files from this directory. Note also that if it finds localized images, it will create an i18n/ directory as a sibling. (default: `./docs`) |
130
+
|`-t, --status-tag <string>`|| Database pages without a Notion page property 'status' matching this will be ignored. Use '\*' to ignore status altogether. (default: `Publish`) |
131
+
|`--locales <codes>`|| Comma-separated list of iso 639-2 codes, the same list as in docusaurus.config.js, minus the primary (i.e. 'en'). This is needed for image localization. (default: `[]`) |
|`-i, --img-output-path <string>`|| Path to directory where images will be stored. If this is not included, images will be placed in the same directory as the document that uses them, which then allows for localization of screenshots. |
134
+
|`-p, --img-prefix-in-markdown <string>`|| When referencing an image from markdown, prefix with this path instead of the full img-output-path. Should be used only in conjunction with --img-output-path. |
135
+
|`--require-slugs`|| If set, docu-notion will fail if any pages it would otherwise publish are missing a slug in Notion. |
136
+
|`--image-file-name-format <format>`|| choices:<ul><li>`default`: {page slug (if any)}.{image block ID}</li><li>`content-hash`: Use a hash of the image content.</li><li>`legacy`: Use the legacy (before v0.16) method of determining file names. Set this to maintain backward compatibility.</li></ul>All formats will use the original file extension. |
137
+
|`-h, --help`|| display help for command |
137
138
138
139
# Plugins
139
140
@@ -155,8 +156,10 @@ The default admonition type, if no matching icon is found, is "note".
155
156
# Known Workarounds
156
157
157
158
### Start a numbered list at a number other than 1
159
+
158
160
In Notion, make sure the block is "Text," not "Numbered List".
161
+
159
162
- But make sure the number does NOT have a space in front of it. This can/will cause issues with sub-list items.
160
163
- One way to get Notion to let you do this:
161
-
- Create a numbered list item where the text duplicates the number you want. Convert that numbered list item to "Text."
162
-
- i.e. Type "1. 1. Item one." Notion makes the first "1." into a number in a list. When you convert back to "Text," you're left with plain text "1. Item one."
164
+
- Create a numbered list item where the text duplicates the number you want. Convert that numbered list item to "Text."
165
+
- i.e. Type "1. 1. Item one." Notion makes the first "1." into a number in a list. When you convert back to "Text," you're left with plain text "1. Item one."
0 commit comments