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: src/NotionImage.ts
+35-16Lines changed: 35 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,19 @@ import { logDebug, verbose, info } from "./log";
8
8
letexistingImagesNotSeenYetInPull: string[]=[];
9
9
letimageOutputPath="";// default to putting in the same directory as the document referring to it.
10
10
letimagePrefix="";// default to "./"
11
+
letlocales: string[];
11
12
12
-
// we parse a notion image and its caption into what we need, which includes any urls to localized versions of the image that may be embedded in the caption
13
+
// we parse a notion image and its caption into what we need, which includes any urls to localized versions
14
+
// of the image that may be embedded in the caption.
13
15
exporttypeImageSet={
14
16
// We get these from parseImageBlock():
15
17
primaryUrl: string;
18
+
// caption may contain a caption and/or URLs to localized versions
16
19
caption?: string;
20
+
// We use entries in localizedUrls whether or not we have a url, because if we don't have
21
+
// a localized image, we then need to copy the primary image in, instead, to
22
+
// get image fallback. In that case, the placeholder at least tells us what languages
Copy file name to clipboardExpand all lines: src/index.ts
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -13,18 +13,23 @@ program
13
13
.requiredOption("-n, --notion-token <string>","notion api token")
14
14
.requiredOption(
15
15
"-r, --root-page <string>",
16
-
"the 31 character ID of the page which is the root of your notion docs"
16
+
"The 31 character ID of the page which is the root of your notion docs"
17
17
)
18
18
.requiredOption(
19
19
"-m, --markdown-output-path <string>",
20
-
"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.",
20
+
"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.",
21
21
"./docs"
22
22
)
23
23
.option(
24
24
"-t, --status-tag <string>",
25
25
"Database pages without a Notion page property 'status' matching this will be ignored. Use '*' to ignore status altogether.",
26
26
"Publish"
27
27
)
28
+
.option(
29
+
"--locales <codes>",
30
+
"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.",
"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."
42
+
"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."
38
43
)
39
44
// .option(
40
45
// "-l, --internal-link-prefix <string>",
41
46
// "when converting a link from one page to another, prefix the with this path instead of the default, which is rooted at the markdown-output-path."
42
47
// )
43
48
.option(
44
49
"-p, --img-prefix-in-markdown <string>",
45
-
"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."
50
+
"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."
0 commit comments