-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathmkdocs.ts
206 lines (202 loc) · 5.48 KB
/
mkdocs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
const help = (name: string): Fig.Option => ({
name: ["-h", "--help"],
description: `help for ${name}`,
});
// options common to 'mkdocs build' 'mkdocs gh-deploy' and 'mkdocs serve'
const commonOptions: Fig.Option[] = [
{
name: ["-f", "--config-file"],
description: "Provide a specific MkDocs config",
args: {
template: "filepaths",
},
},
{
name: ["-s", "--strict"],
description:
"Enable strict mode. This will cause MkDocs to abort the build on any warnings",
},
{
name: ["-t", "--theme"],
description: "The theme to use when building your documentation",
args: {
name: "theme",
},
},
{
name: "--use-directory-urls",
description: "Use directory URLs when building pages (the default)",
},
{
name: "--no-directory-urls",
description: "Don't use directory URLs when building pages",
},
];
const globalOptions: Fig.Option[] = [
{
name: ["-q", "--quiet"],
description: "Silence warnings",
},
{
name: ["-v", "--verbose"],
description: "Enable verbose output",
},
];
const completionSpec: Fig.Spec = {
name: "mkdocs",
description: "Project documentation with Markdown",
subcommands: [
{
name: "build",
description: "Build the MkDocs documentation",
options: [
help("build"),
...globalOptions,
...commonOptions,
{
name: ["-c", "--clean"],
description:
"Remove old files from the site directory before building (the default)",
},
{
name: "--dirty",
description:
"Only rebuild pages that have been modified since last build",
},
{
name: ["-d", "--site-dir"],
description:
"The directory to output the result of the documentation build",
args: {
template: "folders",
},
},
],
},
{
name: "gh-deploy",
description: "Deploy your documentation to GitHub Pages",
options: [
help("gh-deploy"),
...globalOptions,
...commonOptions,
{
name: ["-c", "--clean"],
description:
"Remove old files from the site directory before building (the default)",
},
{
name: "--dirty",
description:
"Only rebuild pages that have been modified since last build",
},
{
name: ["-m", "--message"],
description:
"A commit message to use when committing to the GitHub Pages remote branch. Commit {sha} and MkDocs {version} are available as expansions",
args: {
name: "message",
},
},
{
name: ["-b", "--remote-branch"],
description:
"The remote branch to commit to for GitHub Pages. This overrides the value specified in config",
args: {
name: "branch name",
},
},
{
name: ["-r", "--remote-name"],
description:
"The remote name to commit to for GitHub Pages. This overrides the value specified in config",
args: {
name: "remote name",
},
},
{
name: "--force",
description: "Force the push to the repository",
isDangerous: true,
},
{
name: "--no-history",
description: "Replace the whole Git history with one new commit",
isDangerous: true,
},
{
name: "--ignore-version",
description:
"Ignore check that build is not being deployed with an older version of MkDocs",
},
{
name: "--shell",
description: "Use the shell when invoking Git",
},
],
},
{
name: "new",
description: "Create a new MkDocs project",
options: [help("new"), ...globalOptions],
args: {
template: "folders",
},
},
{
name: "serve",
description: "Run the builtin development server",
options: [
help("serve"),
...globalOptions,
...commonOptions,
{
name: ["-a", "--dev-addr"],
description:
"IP address and port to serve documentation locally (default: localhost:8000)",
args: {
name: "IP:PORT",
},
},
{
name: "--live-reload",
description:
"Enable the live reloading in the development server (this is the default)",
},
{
name: "--no-reload",
description: "Disable the live reloading in the development server",
},
{
name: "--dirtyreload",
description:
"Enable the live reloading in the development server, but only re-build files that have changed",
},
{
name: "--watch-theme",
description:
"Include the theme in list of files to watch for live reloading. Ignored when live reload is not used",
},
{
name: ["-w", "--watch"],
description:
"A directory or file to watch for live reloading. Can be supplied multiple times",
args: {
template: ["folders", "filepaths"],
},
},
],
},
],
options: [
{
name: ["-h", "--help"],
description: "Show help message and exit",
},
{
name: ["-V", "--version"],
description: "Show the version and exit",
},
],
};
export default completionSpec;