Skip to content

Commit 581f0f0

Browse files
committed
Merge main into release
2 parents c7c302b + 9d11a98 commit 581f0f0

18 files changed

+535
-253
lines changed

.github/workflows/codeql.yml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
19+
branches: ["main"]
2020
schedule:
21-
- cron: '27 11 * * 2'
21+
- cron: "27 11 * * 2"
2222

2323
jobs:
2424
analyze:
@@ -32,43 +32,42 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript' ]
35+
language: ["javascript"]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v3
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
4242

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
5151

52-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53-
# queries: security-extended,security-and-quality
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
5454

55+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
56+
# If this step fails, then you should remove it and run the build manually (see below)
57+
- name: Autobuild
58+
uses: github/codeql-action/autobuild@v3
5559

56-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
57-
# If this step fails, then you should remove it and run the build manually (see below)
58-
- name: Autobuild
59-
uses: github/codeql-action/autobuild@v2
60+
# ℹ️ Command-line programs to run using the OS shell.
61+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6062

61-
# ℹ️ Command-line programs to run using the OS shell.
62-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6365

64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
65-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
# - run: |
67+
# echo "Run, Build Application using script"
68+
# ./location_of_script_within_repo/buildscript.sh
6669

67-
# - run: |
68-
# echo "Run, Build Application using script"
69-
# ./location_of_script_within_repo/buildscript.sh
70-
71-
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v2
73-
with:
74-
category: "/language:${{matrix.language}}"
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v3
72+
with:
73+
category: "/language:${{matrix.language}}"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414
- name: Setup Node.js
15-
uses: actions/setup-node@v3
15+
uses: actions/setup-node@v4
1616
with:
1717
node-version: lts/*
1818
- name: Install dependencies

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ node_modules/
66
version.json
77
docs/
88
*.orig
9+
10+
css/docu-notion-styles.css

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
"Greenshot",
1212
"imgur",
1313
"kanban",
14+
"sillsdev",
1415
"unlocalized"
1516
],
1617
"workbench.colorCustomizations": {
1718
"statusBar.background": "#d649ca",
1819
"statusBar.noFolderBackground": "#d649ca",
1920
"statussBar.prominentBackground": "#d649ca"
21+
},
22+
"markdownlint.config": {
23+
"MD025":false,
24+
"MD033":false,
25+
"MD040":false
2026
}
2127
}

README.md

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ Example Site: https://sillsdev.github.io/docu-notion-sample-site/
66

77
# Instructions
88

9-
## 1. Set up your documentation site.
9+
## 1. Set up your documentation site
1010

1111
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).
1212

13+
If you do not use the above sample, you will need to manually tell your `docusaurus.config.js` about `docu-notion-styles.css`. See [Styling and Layout](https://docusaurus.io/docs/styling-layout). This stylesheet enables various Notion things to look right, for example multi-column layouts. By default, docu-notion will copy this file to the `css/` directory. There is an option to change that location if you want.
14+
1315
## 2. In Notion, duplicate the docu-notion template
1416

1517
Go to [this template page](https://hattonjohn.notion.site/Documentation-Template-Docusaurus-0e998b32da3c47edad0f62a25b49818c). Duplicate it into your own workspace.
@@ -25,15 +27,15 @@ Go to the page that will be the root of your site. This page should have, as dir
2527

2628
<img width="318" alt="image" src="https://github.com/sillsdev/docu-notion/assets/8448/810c6dca-f9ab-4370-93b4-dc1479332af7">
2729

28-
## 5. Add your pages under your Outline page.
30+
## 5. Add your pages under your Outline page
2931

3032
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.
3133

3234
## 6. Pull your pages
3335

34-
First, determine the id of your root page by clicking "Share" and looking at the url it gives you. E.g.
35-
https://www.notion.so/hattonjohn/My-Docs-0456aa5842946bdbea3a4f37c97a0e5
36-
means that the id is "0456aa5842946PRETEND4f37c97a0e5".
36+
First, determine the ID of your root page by clicking "Share" and looking at the url it gives you. E.g.
37+
`https://www.notion.so/hattonjohn/My-Docs-0456aa5842946PRETEND4f37c97a0e5`
38+
means that the ID is `0456aa5842946PRETEND4f37c97a0e5`.
3739

3840
Try it out:
3941

@@ -88,7 +90,9 @@ One of the big attractions of Notion for large documentation projects is that yo
8890
8991
## Slugs
9092

91-
By default, pages will be given a slug based on the Notion id. For a human-readable URL, add a notion property named `Slug` to your database pages and enter a value in there that will work well in a URL. That is, no spaces, ?, #, /, etc.
93+
By default, pages will be given a slug based on the Notion ID. For a human-readable URL, add a notion property named `Slug` to your database pages and enter a value in there that will work well in a URL. That is, no spaces, ?, #, /, etc.
94+
95+
See `Options` to require slugs in Notion.
9296

9397
## Known Limitations
9498

@@ -110,25 +114,27 @@ NOTE: if you just localize an image, it will not get picked up. You also must lo
110114

111115
# Automated builds with Github Actions
112116

113-
Here is a working Github Action script to copy and customize: https://github.com/BloomBooks/bloom-docs/blob/master/.github/workflows/release.yml
117+
Here is a [working Github Action script to copy and customize](https://github.com/BloomBooks/bloom-docs/blob/master/.github/workflows/release.yml).
114118

115119
# Command line
116120

117-
Usage: docu-notion -n <token> -r <root> [options]
121+
Usage: `docu-notion -n <token> -r <root> [options]`
118122

119123
Options:
120124

121125
| flag | required? | description |
122126
| ------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
123-
| -n, --notion-token <string> | required | notion api token, which looks like `secret_3bc1b50XFYb15123RHF243x43450XFY33250XFYa343` |
124-
| -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' |
125-
| -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") |
126-
| -t, --status-tag <string> | | Database pages without a Notion page property 'status' matching this will be ignored. Use '\*' to ignore status altogether. (default: `Publish`) |
127-
| --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: []) |
128-
| -l, --log-level <level> | | Log level (choices: `info`, `verbose`, `debug`) |
129-
| -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. |
130-
| -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. |
131-
| -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: `[]`) |
132+
| `-l, --log-level <level>` | | Log level (choices: `info`, `verbose`, `debug`) |
133+
| `-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 |
132138

133139
# Plugins
134140

@@ -146,3 +152,14 @@ To map Notion callouts to Docusaurus admonitions, ensure the icon is for the typ
146152
- 🔥➜ danger
147153

148154
The default admonition type, if no matching icon is found, is "note".
155+
156+
# Known Workarounds
157+
158+
### Start a numbered list at a number other than 1
159+
160+
In Notion, make sure the block is "Text," not "Numbered List".
161+
162+
- But make sure the number does NOT have a space in front of it. This can/will cause issues with sub-list items.
163+
- One way to get Notion to let you do this:
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

Comments
 (0)