Skip to content

Commit 0d1d60a

Browse files
committed
Docs: reorganize man page generator
* Move generated manual pages into docs/man/ * Move the generate-man-pages script into docs/man/
1 parent 1e5259c commit 0d1d60a

File tree

4 files changed

+36
-12
lines changed

4 files changed

+36
-12
lines changed

docs/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ cmake_minimum_required(VERSION 3.10)
55
include(GNUInstallDirs)
66

77
install(
8-
FILES quick-lint-js.1
8+
FILES man/quick-lint-js.1
99
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
1010
)
1111
install(
12-
FILES quick-lint-js.config.5
12+
FILES man/quick-lint-js.config.5
1313
DESTINATION "${CMAKE_INSTALL_MANDIR}/man5"
1414
)
1515

tools/generate-man-pages renamed to docs/man/generate-man-pages

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def main():
1919
"-b",
2020
"manpage",
2121
"-D",
22-
"docs/",
22+
"man/",
2323
"-o",
2424
"quick-lint-js.1",
25-
"docs/cli.adoc",
25+
"cli.adoc",
2626
]
2727
)
2828
subprocess.check_output(
@@ -31,15 +31,15 @@ def main():
3131
"-b",
3232
"manpage",
3333
"-D",
34-
"docs/",
34+
"man/",
3535
"-o",
3636
"quick-lint-js.config.5",
37-
"docs/config.adoc",
37+
"config.adoc",
3838
]
3939
)
4040

41-
process_man(pathlib.Path("docs/quick-lint-js.1"))
42-
process_man(pathlib.Path("docs/quick-lint-js.config.5"))
41+
process_man(pathlib.Path("man/quick-lint-js.1"))
42+
process_man(pathlib.Path("man/quick-lint-js.config.5"))
4343

4444

4545
def process_man(file_path):

docs/quick-lint-js.1 renamed to docs/man/quick-lint-js.1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'\" t
99
.\" Title: quick-lint-js
1010
.\" Author: [see the "AUTHOR(S)" section]
11-
.\" Generator: Asciidoctor 2.0.10
11+
.\" Generator: Asciidoctor 2.0.12
1212
.\" Manual: \ \&
1313
.\" Source: quick-lint-js version 0.2.0
1414
.\" Language: English
@@ -96,7 +96,7 @@ Incompatible with \fB\-\-lsp\-server\fP.
9696
.RS 4
9797
Cause \fBquick\-lint\-js\fP to exit with a non\-zero exit code if any of the discovered errors is listed in \fIerrors\fP.
9898
.sp
99-
See the Error lists section for a description of the format for \fIerrors\fP.
99+
See the [error\-lists] section for a description of the format for \fIerrors\fP.
100100
.sp
101101
Incompatible with \fB\-\-lsp\-server\fP.
102102
.RE
@@ -225,12 +225,14 @@ To lint a file called \fIlib/index.js\fP, writing error messages to the terminal
225225
.sp
226226
.if n .RS 4
227227
.nf
228+
.fam C
228229
$ \fBquick\-lint\-js\fP lib/index.js
229230
lib/index.js:1:20: error: variable used before declaration: language [E058]
230231
lib/index.js:2:7: note: variable declared here [E058]
231232
lib/index.js:3:1: error: assignment to const variable [E003]
232233
lib/index.js:1:7: note: const variable declared here [E003]
233234
lib/index.js:5:25: warning: use of undeclared variable: ocupation [E057]
235+
.fam
234236
.fi
235237
.if n .RE
236238
.br
@@ -243,11 +245,13 @@ To lint three files, writing machine\-readable messages to \fI/tmp/vim\-qflist.j
243245
.sp
244246
.if n .RS 4
245247
.nf
248+
.fam C
246249
$ \fBquick\-lint\-js\fP \-\-output\-format=vim\-qflist\-json \(rs
247250
\-\-vim\-bufnr=3 lib/pizza\-dough.js \(rs
248251
\-\-vim\-bufnr=4 lib/pizza\-sauce.js \(rs
249252
\-\-vim\-bufnr=6 lib/pineapple.js \(rs
250253
>/tmp/vim\-qflist.json
254+
.fam
251255
.fi
252256
.if n .RE
253257
.br
@@ -262,10 +266,12 @@ To lint a file called \fIbad.js\fP, but don\(cqt fail on use\-of\-undeclared\-va
262266
.sp
263267
.if n .RS 4
264268
.nf
269+
.fam C
265270
$ \fBquick\-lint\-js\fP \-\-exit\-fail\-on=\-E057 bad.js
266271
bad.js:5:25: warning: use of undeclared variable: $ [E057]
267272
$ echo $?
268273
0
274+
.fam
269275
.fi
270276
.if n .RE
271277
.br
@@ -278,9 +284,11 @@ To lint source files with a strict configuration file and lint test files with a
278284
.sp
279285
.if n .RS 4
280286
.nf
287+
.fam C
281288
$ \fBquick\-lint\-js\fP \(rs
282289
\-\-config\-file strict\-quick\-lint\-js.config src/index.js src/helpers.js \(rs
283290
\-\-config\-file lax\-quick\-lint\-js.config test/test\-app.js
291+
.fam
284292
.fi
285293
.if n .RE
286294
.br

docs/quick-lint-js.config.5 renamed to docs/man/quick-lint-js.config.5

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'\" t
99
.\" Title: quick-lint-js.config
1010
.\" Author: [see the "AUTHOR(S)" section]
11-
.\" Generator: Asciidoctor 2.0.10
11+
.\" Generator: Asciidoctor 2.0.12
1212
.\" Manual: \ \&
1313
.\" Source: quick-lint-js version 0.2.0
1414
.\" Language: English
@@ -175,7 +175,9 @@ A \f(CRquick\-lint\-js.config\fP or \f(CR.quick\-lint\-js.config\fP file with no
175175
.sp
176176
.if n .RS 4
177177
.nf
178+
.fam C
178179
{}
180+
.fam
179181
.fi
180182
.if n .RE
181183
.sp
@@ -186,6 +188,7 @@ For example:
186188
.sp
187189
.if n .RS 4
188190
.nf
191+
.fam C
189192
{
190193
" ": "this file configures quick\-lint\-js",
191194
"globals": {
@@ -199,6 +202,7 @@ For example:
199202
"chart": true
200203
}
201204
}
205+
.fam
202206
.fi
203207
.if n .RE
204208
.sp
@@ -209,6 +213,7 @@ A \f(CRpackage.json\fP file might look like this:
209213
.sp
210214
.if n .RS 4
211215
.nf
216+
.fam C
212217
{
213218
"name": "my\-npm\-package",
214219
"version": "0.1.0",
@@ -218,6 +223,7 @@ A \f(CRpackage.json\fP file might look like this:
218223
}
219224
}
220225
}
226+
.fam
221227
.fi
222228
.if n .RE
223229
.SH "OPTIONS"
@@ -320,7 +326,7 @@ If \fBfalse\fP, the variable cannot be assigned to.
320326
.RE
321327
.sp
322328
JSON Unicode escapes (\fB"\(rsu0068ello"\fP) are allowed in the variable name.
323-
JavaScript Unicode escapes (\fB"\(rs\u{68}llo"\fP) are not allowed in the variable name.
329+
JavaScript Unicode escapes (\fB"\(rs\(rsu{68}llo"\fP) are not allowed in the variable name.
324330
.SH "GLOBAL GROUPS"
325331
.sp
326332
The following groups are supported for the \fBglobal\-groups\fP configuration property:
@@ -383,12 +389,14 @@ Such an application might have the following \f(CRquick\-lint\-js.config\fP file
383389
.sp
384390
.if n .RS 4
385391
.nf
392+
.fam C
386393
{
387394
"global\-groups": ["browser", "ecmascript", "jest"],
388395
"globals": {
389396
"google": {"writable": false}
390397
}
391398
}
399+
.fam
392400
.fi
393401
.if n .RE
394402
.sp
@@ -397,6 +405,7 @@ In this case, the application configures quick\-lint\-js in its \f(CRpackage.jso
397405
.sp
398406
.if n .RS 4
399407
.nf
408+
.fam C
400409
{
401410
"name": "acme",
402411
"version": "1.2.1",
@@ -410,6 +419,7 @@ In this case, the application configures quick\-lint\-js in its \f(CRpackage.jso
410419
}
411420
}
412421
}
422+
.fam
413423
.fi
414424
.if n .RE
415425
.sp
@@ -421,33 +431,39 @@ For example, if you\(cqre seeing a spurious warning E057 "use of undeclared vari
421431
.sp
422432
.if n .RS 4
423433
.nf
434+
.fam C
424435
{
425436
"globals": {
426437
"MyLibrary": true
427438
}
428439
}
440+
.fam
429441
.fi
430442
.if n .RE
431443
.sp
432444
If you are not seeing E002, E033, E057, or E059 (false negative), but you want to see E057 "use of undeclared variable: $", use one of the following configuration in \f(CRquick\-lint\-js.config\fP:
433445
.sp
434446
.if n .RS 4
435447
.nf
448+
.fam C
436449
{
437450
"globals": {
438451
"$": false
439452
}
440453
}
454+
.fam
441455
.fi
442456
.if n .RE
443457
.sp
444458
Alternatively, suppress the \fBjquery\fP globals group (which defines \fB$\fP as a global variable) by enabling only the environments you use in your project with this \f(CRquick\-lint\-js.config\fP:
445459
.sp
446460
.if n .RS 4
447461
.nf
462+
.fam C
448463
{
449464
"global\-groups": ["ecmascript", "node.js"]
450465
}
466+
.fam
451467
.fi
452468
.if n .RE
453469
.SH "SEE ALSO"

0 commit comments

Comments
 (0)