Skip to content

Commit abf1338

Browse files
authored
fix: align first line of unordered list with following (#15161)
### What does this PR try to resolve? `\h` controls horizontal spacing. This changes unordered lists from moving 2 units (`\h'+02'`) to 3 units (`\h'+03'`). This looks more nature. Most other popular software programs follow the same style. For example, git-merge, tar, and bash. ### How should we test and review this PR? ``` cargo build target/debug/cargo help package ``` ### Additional information This was found during #15148.
2 parents 2928e32 + f7c9066 commit abf1338

37 files changed

+386
-386
lines changed

crates/mdman/doc/out/mdman.1

+10-10
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ The handlebars template has several special tags to assist with generating the
2222
man page:
2323
.sp
2424
.RS 4
25-
\h'-04'\(bu\h'+02'Every block of command\-line options must be wrapped between \fB{{#options}}\fR
25+
\h'-04'\(bu\h'+03'Every block of command\-line options must be wrapped between \fB{{#options}}\fR
2626
and \fB{{/options}}\fR tags. This tells the processor where the options start
2727
and end.
2828
.RE
2929
.sp
3030
.RS 4
31-
\h'-04'\(bu\h'+02'Each option must be expressed with a \fB{{#option}}\fR block. The parameters to
31+
\h'-04'\(bu\h'+03'Each option must be expressed with a \fB{{#option}}\fR block. The parameters to
3232
the block are a sequence of strings indicating the option. For example,
3333
\fB{{#option "`\-p` _spec_..." "`\-\-package` _spec_..."}}\fR is an option that
3434
has two different forms. The text within the string is processed as markdown.
@@ -41,29 +41,29 @@ Use the \fB{{/option}}\fR tag to end the option block.
4141
.RE
4242
.sp
4343
.RS 4
44-
\h'-04'\(bu\h'+02'References to other man pages should use the \fB{{man name section}}\fR
44+
\h'-04'\(bu\h'+03'References to other man pages should use the \fB{{man name section}}\fR
4545
expression. For example, \fB{{man "mdman" 1}}\fR will generate a reference to
4646
the \fBmdman(1)\fR man page. For non\-troff output, the \fB\-\-man\fR option will tell
4747
\fBmdman\fR how to create links to the man page. If there is no matching \fB\-\-man\fR
4848
option, then it links to a file named \fIname\fR\fB\&.md\fR in the same directory.
4949
.RE
5050
.sp
5151
.RS 4
52-
\h'-04'\(bu\h'+02'Variables can be set with \fB{{*set name="value"}}\fR\&. These variables can
52+
\h'-04'\(bu\h'+03'Variables can be set with \fB{{*set name="value"}}\fR\&. These variables can
5353
then be referenced with \fB{{name}}\fR expressions.
5454
.RE
5555
.sp
5656
.RS 4
57-
\h'-04'\(bu\h'+02'Partial templates should be placed in a directory named \fBincludes\fR
57+
\h'-04'\(bu\h'+03'Partial templates should be placed in a directory named \fBincludes\fR
5858
next to the source file. Templates can be included with an expression like
5959
\fB{{> template\-name}}\fR\&.
6060
.RE
6161
.sp
6262
.RS 4
63-
\h'-04'\(bu\h'+02'Other helpers include:
63+
\h'-04'\(bu\h'+03'Other helpers include:
6464
.sp
6565
.RS 4
66-
\h'-04'\(bu\h'+02'\fB{{lower value}}\fR Converts the given value to lowercase.
66+
\h'-04'\(bu\h'+03'\fB{{lower value}}\fR Converts the given value to lowercase.
6767
.RE
6868
.RE
6969
.SH "OPTIONS"
@@ -73,17 +73,17 @@ next to the source file. Templates can be included with an expression like
7373
Specifies the output type. The following output types are supported:
7474
.sp
7575
.RS 4
76-
\h'-04'\(bu\h'+02'\fBman\fR \[em] A troff\-style man page. Outputs with a numbered extension (like
76+
\h'-04'\(bu\h'+03'\fBman\fR \[em] A troff\-style man page. Outputs with a numbered extension (like
7777
\fB\&.1\fR) matching the man page section.
7878
.RE
7979
.sp
8080
.RS 4
81-
\h'-04'\(bu\h'+02'\fBmd\fR \[em] A markdown file, after all handlebars processing has been finished.
81+
\h'-04'\(bu\h'+03'\fBmd\fR \[em] A markdown file, after all handlebars processing has been finished.
8282
Outputs with the \fB\&.md\fR extension.
8383
.RE
8484
.sp
8585
.RS 4
86-
\h'-04'\(bu\h'+02'\fBtxt\fR \[em] A text file, rendered for situations where a man page viewer isn\[cq]t
86+
\h'-04'\(bu\h'+03'\fBtxt\fR \[em] A text file, rendered for situations where a man page viewer isn\[cq]t
8787
available. Outputs with the \fB\&.txt\fR extension.
8888
.RE
8989
.RE

crates/mdman/src/format/man.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<'e> ManRenderer<'e> {
167167
*n += 1;
168168
}
169169
// Unordered list.
170-
None => self.output.push_str("\\h'-04'\\(bu\\h'+02'"),
170+
None => self.output.push_str("\\h'-04'\\(bu\\h'+03'"),
171171
}
172172
suppress_paragraph = true;
173173
}

crates/mdman/tests/compare/expected/formatting.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ goodness regarding reindeer so astride before.
4747
\h'-04' 1.\h'+01'Ordered list
4848
.sp
4949
.RS 4
50-
\h'-04'\(bu\h'+02'Unordered list
50+
\h'-04'\(bu\h'+03'Unordered list
5151
.sp
5252
With a second paragraph inside it
5353
.sp
@@ -61,11 +61,11 @@ With a second paragraph inside it
6161
.RE
6262
.sp
6363
.RS 4
64-
\h'-04'\(bu\h'+02'Eggs
64+
\h'-04'\(bu\h'+03'Eggs
6565
.RE
6666
.sp
6767
.RS 4
68-
\h'-04'\(bu\h'+02'Milk
68+
\h'-04'\(bu\h'+03'Milk
6969
.sp
7070
.RS 4
7171
\h'-04' 5.\h'+01'Don\[cq]t start at one.

crates/mdman/tests/compare/expected/options.1

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ my\-command \- A brief description
1717
A description of the command.
1818
.sp
1919
.RS 4
20-
\h'-04'\(bu\h'+02'One
20+
\h'-04'\(bu\h'+03'One
2121
.sp
2222
.RS 4
23-
\h'-04'\(bu\h'+02'Sub one
23+
\h'-04'\(bu\h'+03'Sub one
2424
.RE
2525
.sp
2626
.RS 4
27-
\h'-04'\(bu\h'+02'Sub two
27+
\h'-04'\(bu\h'+03'Sub two
2828
.RE
2929
.RE
3030
.sp
3131
.RS 4
32-
\h'-04'\(bu\h'+02'Two
32+
\h'-04'\(bu\h'+03'Two
3333
.RE
3434
.sp
3535
.RS 4
36-
\h'-04'\(bu\h'+02'Three
36+
\h'-04'\(bu\h'+03'Three
3737
.RE
3838
.SH "OPTIONS"
3939
.SS "Command options"

src/etc/man/cargo-add.1

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@ This command can add or modify dependencies.
1717
The source for the dependency can be specified with:
1818
.sp
1919
.RS 4
20-
\h'-04'\(bu\h'+02'\fIcrate\fR\fB@\fR\fIversion\fR: Fetch from a registry with a version constraint of \[lq]\fIversion\fR\[rq]
20+
\h'-04'\(bu\h'+03'\fIcrate\fR\fB@\fR\fIversion\fR: Fetch from a registry with a version constraint of \[lq]\fIversion\fR\[rq]
2121
.RE
2222
.sp
2323
.RS 4
24-
\h'-04'\(bu\h'+02'\fB\-\-path\fR \fIpath\fR: Fetch from the specified \fIpath\fR
24+
\h'-04'\(bu\h'+03'\fB\-\-path\fR \fIpath\fR: Fetch from the specified \fIpath\fR
2525
.RE
2626
.sp
2727
.RS 4
28-
\h'-04'\(bu\h'+02'\fB\-\-git\fR \fIurl\fR: Pull from a git repo at \fIurl\fR
28+
\h'-04'\(bu\h'+03'\fB\-\-git\fR \fIurl\fR: Pull from a git repo at \fIurl\fR
2929
.RE
3030
.sp
3131
If no source is specified, then a best effort will be made to select one, including:
3232
.sp
3333
.RS 4
34-
\h'-04'\(bu\h'+02'Existing dependencies in other tables (like \fBdev\-dependencies\fR)
34+
\h'-04'\(bu\h'+03'Existing dependencies in other tables (like \fBdev\-dependencies\fR)
3535
.RE
3636
.sp
3737
.RS 4
38-
\h'-04'\(bu\h'+02'Workspace members
38+
\h'-04'\(bu\h'+03'Workspace members
3939
.RE
4040
.sp
4141
.RS 4
42-
\h'-04'\(bu\h'+02'Latest release in the registry
42+
\h'-04'\(bu\h'+03'Latest release in the registry
4343
.RE
4444
.sp
4545
When you add a package that is already present, the existing entry will be updated with the flags specified.
@@ -189,16 +189,16 @@ May also be specified with the \fBterm.quiet\fR
189189
Control when colored output is used. Valid values:
190190
.sp
191191
.RS 4
192-
\h'-04'\(bu\h'+02'\fBauto\fR (default): Automatically detect if color support is available on the
192+
\h'-04'\(bu\h'+03'\fBauto\fR (default): Automatically detect if color support is available on the
193193
terminal.
194194
.RE
195195
.sp
196196
.RS 4
197-
\h'-04'\(bu\h'+02'\fBalways\fR: Always display colors.
197+
\h'-04'\(bu\h'+03'\fBalways\fR: Always display colors.
198198
.RE
199199
.sp
200200
.RS 4
201-
\h'-04'\(bu\h'+02'\fBnever\fR: Never display colors.
201+
\h'-04'\(bu\h'+03'\fBnever\fR: Never display colors.
202202
.RE
203203
.sp
204204
May also be specified with the \fBterm.color\fR
@@ -230,11 +230,11 @@ existing \fBCargo.lock\fR file was originally generated. Cargo will exit with an
230230
error when either of the following scenarios arises:
231231
.sp
232232
.RS 4
233-
\h'-04'\(bu\h'+02'The lock file is missing.
233+
\h'-04'\(bu\h'+03'The lock file is missing.
234234
.RE
235235
.sp
236236
.RS 4
237-
\h'-04'\(bu\h'+02'Cargo attempted to change the lock file due to a different dependency resolution.
237+
\h'-04'\(bu\h'+03'Cargo attempted to change the lock file due to a different dependency resolution.
238238
.RE
239239
.sp
240240
It may be used in environments where deterministic builds are desired,
@@ -322,11 +322,11 @@ details on environment variables that Cargo reads.
322322
.SH "EXIT STATUS"
323323
.sp
324324
.RS 4
325-
\h'-04'\(bu\h'+02'\fB0\fR: Cargo succeeded.
325+
\h'-04'\(bu\h'+03'\fB0\fR: Cargo succeeded.
326326
.RE
327327
.sp
328328
.RS 4
329-
\h'-04'\(bu\h'+02'\fB101\fR: Cargo failed to complete.
329+
\h'-04'\(bu\h'+03'\fB101\fR: Cargo failed to complete.
330330
.RE
331331
.SH "EXAMPLES"
332332
.sp

src/etc/man/cargo-bench.1

+20-20
Original file line numberDiff line numberDiff line change
@@ -123,24 +123,24 @@ When no target selection options are given, \fBcargo bench\fR will build the
123123
following targets of the selected packages:
124124
.sp
125125
.RS 4
126-
\h'-04'\(bu\h'+02'lib \[em] used to link with binaries and benchmarks
126+
\h'-04'\(bu\h'+03'lib \[em] used to link with binaries and benchmarks
127127
.RE
128128
.sp
129129
.RS 4
130-
\h'-04'\(bu\h'+02'bins (only if benchmark targets are built and required features are
130+
\h'-04'\(bu\h'+03'bins (only if benchmark targets are built and required features are
131131
available)
132132
.RE
133133
.sp
134134
.RS 4
135-
\h'-04'\(bu\h'+02'lib as a benchmark
135+
\h'-04'\(bu\h'+03'lib as a benchmark
136136
.RE
137137
.sp
138138
.RS 4
139-
\h'-04'\(bu\h'+02'bins as benchmarks
139+
\h'-04'\(bu\h'+03'bins as benchmarks
140140
.RE
141141
.sp
142142
.RS 4
143-
\h'-04'\(bu\h'+02'benchmark targets
143+
\h'-04'\(bu\h'+03'benchmark targets
144144
.RE
145145
.sp
146146
The default behavior can be changed by setting the \fBbench\fR flag for the target
@@ -294,15 +294,15 @@ Specifying an output format (rather than the default) is unstable and requires
294294
\fB\-Zunstable\-options\fR\&. Valid output formats:
295295
.sp
296296
.RS 4
297-
\h'-04'\(bu\h'+02'\fBhtml\fR (unstable, requires \fB\-Zunstable\-options\fR): Write a human\-readable file \fBcargo\-timing.html\fR to the
297+
\h'-04'\(bu\h'+03'\fBhtml\fR (unstable, requires \fB\-Zunstable\-options\fR): Write a human\-readable file \fBcargo\-timing.html\fR to the
298298
\fBtarget/cargo\-timings\fR directory with a report of the compilation. Also write
299299
a report to the same directory with a timestamp in the filename if you want
300300
to look at older runs. HTML output is suitable for human consumption only,
301301
and does not provide machine\-readable timing data.
302302
.RE
303303
.sp
304304
.RS 4
305-
\h'-04'\(bu\h'+02'\fBjson\fR (unstable, requires \fB\-Zunstable\-options\fR): Emit machine\-readable JSON
305+
\h'-04'\(bu\h'+03'\fBjson\fR (unstable, requires \fB\-Zunstable\-options\fR): Emit machine\-readable JSON
306306
information about timing information.
307307
.RE
308308
.RE
@@ -348,16 +348,16 @@ May also be specified with the \fBterm.quiet\fR
348348
Control when colored output is used. Valid values:
349349
.sp
350350
.RS 4
351-
\h'-04'\(bu\h'+02'\fBauto\fR (default): Automatically detect if color support is available on the
351+
\h'-04'\(bu\h'+03'\fBauto\fR (default): Automatically detect if color support is available on the
352352
terminal.
353353
.RE
354354
.sp
355355
.RS 4
356-
\h'-04'\(bu\h'+02'\fBalways\fR: Always display colors.
356+
\h'-04'\(bu\h'+03'\fBalways\fR: Always display colors.
357357
.RE
358358
.sp
359359
.RS 4
360-
\h'-04'\(bu\h'+02'\fBnever\fR: Never display colors.
360+
\h'-04'\(bu\h'+03'\fBnever\fR: Never display colors.
361361
.RE
362362
.sp
363363
May also be specified with the \fBterm.color\fR
@@ -370,34 +370,34 @@ The output format for diagnostic messages. Can be specified multiple times
370370
and consists of comma\-separated values. Valid values:
371371
.sp
372372
.RS 4
373-
\h'-04'\(bu\h'+02'\fBhuman\fR (default): Display in a human\-readable text format. Conflicts with
373+
\h'-04'\(bu\h'+03'\fBhuman\fR (default): Display in a human\-readable text format. Conflicts with
374374
\fBshort\fR and \fBjson\fR\&.
375375
.RE
376376
.sp
377377
.RS 4
378-
\h'-04'\(bu\h'+02'\fBshort\fR: Emit shorter, human\-readable text messages. Conflicts with \fBhuman\fR
378+
\h'-04'\(bu\h'+03'\fBshort\fR: Emit shorter, human\-readable text messages. Conflicts with \fBhuman\fR
379379
and \fBjson\fR\&.
380380
.RE
381381
.sp
382382
.RS 4
383-
\h'-04'\(bu\h'+02'\fBjson\fR: Emit JSON messages to stdout. See
383+
\h'-04'\(bu\h'+03'\fBjson\fR: Emit JSON messages to stdout. See
384384
\fIthe reference\fR <https://doc.rust\-lang.org/cargo/reference/external\-tools.html#json\-messages>
385385
for more details. Conflicts with \fBhuman\fR and \fBshort\fR\&.
386386
.RE
387387
.sp
388388
.RS 4
389-
\h'-04'\(bu\h'+02'\fBjson\-diagnostic\-short\fR: Ensure the \fBrendered\fR field of JSON messages contains
389+
\h'-04'\(bu\h'+03'\fBjson\-diagnostic\-short\fR: Ensure the \fBrendered\fR field of JSON messages contains
390390
the \[lq]short\[rq] rendering from rustc. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
391391
.RE
392392
.sp
393393
.RS 4
394-
\h'-04'\(bu\h'+02'\fBjson\-diagnostic\-rendered\-ansi\fR: Ensure the \fBrendered\fR field of JSON messages
394+
\h'-04'\(bu\h'+03'\fBjson\-diagnostic\-rendered\-ansi\fR: Ensure the \fBrendered\fR field of JSON messages
395395
contains embedded ANSI color codes for respecting rustc\[cq]s default color
396396
scheme. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
397397
.RE
398398
.sp
399399
.RS 4
400-
\h'-04'\(bu\h'+02'\fBjson\-render\-diagnostics\fR: Instruct Cargo to not include rustc diagnostics
400+
\h'-04'\(bu\h'+03'\fBjson\-render\-diagnostics\fR: Instruct Cargo to not include rustc diagnostics
401401
in JSON messages printed, but instead Cargo itself should render the
402402
JSON diagnostics coming from rustc. Cargo\[cq]s own JSON diagnostics and others
403403
coming from rustc are still emitted. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
@@ -423,11 +423,11 @@ existing \fBCargo.lock\fR file was originally generated. Cargo will exit with an
423423
error when either of the following scenarios arises:
424424
.sp
425425
.RS 4
426-
\h'-04'\(bu\h'+02'The lock file is missing.
426+
\h'-04'\(bu\h'+03'The lock file is missing.
427427
.RE
428428
.sp
429429
.RS 4
430-
\h'-04'\(bu\h'+02'Cargo attempted to change the lock file due to a different dependency resolution.
430+
\h'-04'\(bu\h'+03'Cargo attempted to change the lock file due to a different dependency resolution.
431431
.RE
432432
.sp
433433
It may be used in environments where deterministic builds are desired,
@@ -542,11 +542,11 @@ details on environment variables that Cargo reads.
542542
.SH "EXIT STATUS"
543543
.sp
544544
.RS 4
545-
\h'-04'\(bu\h'+02'\fB0\fR: Cargo succeeded.
545+
\h'-04'\(bu\h'+03'\fB0\fR: Cargo succeeded.
546546
.RE
547547
.sp
548548
.RS 4
549-
\h'-04'\(bu\h'+02'\fB101\fR: Cargo failed to complete.
549+
\h'-04'\(bu\h'+03'\fB101\fR: Cargo failed to complete.
550550
.RE
551551
.SH "EXAMPLES"
552552
.sp

0 commit comments

Comments
 (0)