Skip to content

Commit da15571

Browse files
committed
Merge branch 'master' into fix/win-paths
2 parents bad81d6 + 4b91fa3 commit da15571

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+478
-126
lines changed

common/config/rush/version-policies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"definitionName": "lockStepVersion",
44
"policyName": "webdoc",
5-
"version": "1.3.1",
5+
"version": "1.3.2",
66
"nextBump": "patch"
77
}
88
]

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"url": "https://github.com/SukantPal/webdoc/issues"
3535
},
3636
"dependencies": {
37-
"@webdoc/cli": "^1.3.1"
37+
"@webdoc/cli": "^1.3.2"
3838
},
3939
"gitHead": "a2866c1a42f60180a74add7bc1b0f42d8bb16330",
4040
"devDependencies": {

packages/webdoc-cli/CHANGELOG.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
{
22
"name": "@webdoc/cli",
33
"entries": [
4+
{
5+
"version": "1.3.2",
6+
"tag": "@webdoc/cli_v1.3.2",
7+
"date": "Sat, 01 May 2021 23:21:56 GMT",
8+
"comments": {
9+
"none": [
10+
{
11+
"comment": "Add configuration for custom app bar items and overriding the route for tutorials in @webdoc/default-template"
12+
}
13+
]
14+
}
15+
},
416
{
517
"version": "1.3.1",
618
"tag": "@webdoc/cli_v1.3.1",

packages/webdoc-cli/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log - @webdoc/cli
22

3-
This log was last generated on Sun, 25 Apr 2021 21:01:31 GMT and should not be manually modified.
3+
This log was last generated on Sat, 01 May 2021 23:21:56 GMT and should not be manually modified.
4+
5+
## 1.3.2
6+
Sat, 01 May 2021 23:21:56 GMT
7+
8+
### Updates
9+
10+
- Add configuration for custom app bar items and overriding the route for tutorials in @webdoc/default-template
411

512
## 1.3.1
613
Sun, 25 Apr 2021 21:01:31 GMT

packages/webdoc-cli/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ The `template` object is used by the site template.
9393
{
9494
"template": {
9595
"applicationName": "{ <i>webdoc</i> }",
96+
"appBar": {
97+
"items": {
98+
"about": {
99+
"name": "About Us",
100+
"uri": "https://example.com/about-us"
101+
}
102+
}
103+
},
104+
"routes": {
105+
"tutorials": "/faq"
106+
},
96107
"meta": {
97108
"og:title": "webdoc",
98109
"og:description": "webdoc API documentation",
@@ -114,6 +125,12 @@ The `template` object is used by the site template.
114125
```
115126

116127
* `template.applicationName`: The name of the documented software. This is usually used to fill the app bar and tab title.
128+
* `template.appBar.items`: This key-value object can be used to configure the items in the app bar. The key is an identifier
129+
and to override a built-in item, you'll need to use its specific key (if you're adding more items, the key's specific value
130+
won't matter). For example, if you want to show the tutorials as "Guides", you can set `{ "tutorials": { "name": "Guides" } }`. Each
131+
item defines a name and URI.
132+
* `template.routes`: This can be used to override specific routes generated by the template. For example, you can move the
133+
`tutorials` to be outputted at "/faq" instead of "/tutorials", if desired.
117134
* `template.meta`: (optional) This can be used to define the `<meta>` key-value tags. The `{{url}}` variable can be used
118135
to put in the site URL for each page (you have to provide the `siteDomain` and `siteRoot`).
119136
* `template.repository`: (optional) This can be used to link documents to their location in the source code. The only supported repository is GitHub.

packages/webdoc-cli/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@webdoc/cli",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "CLI for @webdoc monorepo",
55
"bin": {
66
"webdoc": "./cli.js"
@@ -40,14 +40,14 @@
4040
"url": "https://github.com/SukantPal/webdoc/issues"
4141
},
4242
"dependencies": {
43-
"@webdoc/default-template": "^1.3.1",
44-
"@webdoc/externalize": "^1.3.1",
45-
"@webdoc/legacy-template": "^1.3.1",
46-
"@webdoc/model": "^1.3.1",
47-
"@webdoc/parser": "^1.3.1",
48-
"@webdoc/plugin-markdown": "^1.3.1",
49-
"@webdoc/template-library": "^1.3.1",
50-
"@webdoc/types": "^1.3.1",
43+
"@webdoc/default-template": "^1.3.2",
44+
"@webdoc/externalize": "^1.3.2",
45+
"@webdoc/legacy-template": "^1.3.2",
46+
"@webdoc/model": "^1.3.2",
47+
"@webdoc/parser": "^1.3.2",
48+
"@webdoc/plugin-markdown": "^1.3.2",
49+
"@webdoc/template-library": "^1.3.2",
50+
"@webdoc/types": "^1.3.2",
5151
"array.prototype.flatmap": "~1.2.3",
5252
"fs-extra": "^9.0.1",
5353
"globby": "11.0.0",

packages/webdoc-cli/src/config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,18 @@ type ConfigSchema = {
3232
template?: string,
3333
},
3434
template: {
35+
appBar: {
36+
items: {
37+
[string]: {
38+
name: string,
39+
uri: string,
40+
}
41+
}
42+
},
3543
applicationName: string,
44+
routes: {
45+
tutorials: string,
46+
},
3647
stylesheets: Array<string>,
3748
siteDomain?: string,
3849
siteRoot: string,
@@ -78,7 +89,13 @@ const defaultConfig: ConfigSchema = {
7889
template: "@webdoc/default-template",
7990
},
8091
template: {
92+
appBar: {
93+
items: {},
94+
},
8195
applicationName: "{ <i>webdoc</i> }",
96+
routes: {
97+
tutorials: "tutorials",
98+
},
8299
siteRoot: "",
83100
stylesheets: [],
84101
mainPage: {

packages/webdoc-cli/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function main(argv: yargs.Argv) {
6161

6262
const {loadConfig, getTemplate} = require("./config");
6363
const config = loadConfig(argv.config);
64-
const tutorials = loadTutorials(argv.tutorials);
64+
const tutorials = loadTutorials(argv.tutorials, config.template.routes.tutorials);
6565

6666

6767
if (argv.siteRoot) {

packages/webdoc-cli/src/load-tutorials/load-tutorials.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const renderer = require("markdown-it")({
1717
.use(require("markdown-it-highlightjs"));
1818

1919
// Loads & parses all the tutorials in the given directory
20-
export function loadTutorials(tutorialsDir?: string): Tutorial[] {
20+
export function loadTutorials(tutorialsDir?: string, tutorialsRoute?: string): Tutorial[] {
2121
if (!tutorialsDir) {
2222
return [];
2323
}
@@ -80,10 +80,12 @@ export function loadTutorials(tutorialsDir?: string): Tutorial[] {
8080
// Tutorials can be part of the doc-tree!
8181
tutorials.push(createTutorialDoc(
8282
fileName,
83-
path.join("tutorials", relativePath
84-
.replace(".html", "")
85-
.replace(".htm", "")
86-
.replace(".md", "")),
83+
path.join(
84+
typeof tutorialsRoute === "string" ? tutorialsRoute : "tutorials",
85+
relativePath
86+
.replace(".html", "")
87+
.replace(".htm", "")
88+
.replace(".md", "")),
8789
fileContent,
8890
));
8991
}

packages/webdoc-default-template/CHANGELOG.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
{
22
"name": "@webdoc/default-template",
33
"entries": [
4+
{
5+
"version": "1.3.2",
6+
"tag": "@webdoc/default-template_v1.3.2",
7+
"date": "Sat, 01 May 2021 23:21:56 GMT",
8+
"comments": {
9+
"none": [
10+
{
11+
"comment": "Use CSS Grid to fix scrolling issues in Safari. Don't generate README file if not provided. Don't output API reference if document tree is empty (i.e. you're using webdoc to generate a tutorials-only site) Add support for custom app bar items."
12+
}
13+
]
14+
}
15+
},
416
{
517
"version": "1.3.1",
618
"tag": "@webdoc/default-template_v1.3.1",

0 commit comments

Comments
 (0)