mirror of
https://github.com/curl/curl.git
synced 2025-09-14 16:12:43 +03:00
gen.pl: support ## for doing .IP in table-like lists
Warn on use of .RS/.IP/.RE Closes #12667
This commit is contained in:
parent
0ad13e0618
commit
a859e29a60
|
@ -54,6 +54,19 @@ Text written within `*asterisks*` is shown using italics. Text within two
|
||||||
Text that is prefixed with a space is treated like an "example" and gets
|
Text that is prefixed with a space is treated like an "example" and gets
|
||||||
output in monospace.
|
output in monospace.
|
||||||
|
|
||||||
|
Within the body, describe a lite of items like this:
|
||||||
|
|
||||||
|
## item 1
|
||||||
|
description
|
||||||
|
|
||||||
|
## item 2
|
||||||
|
second description
|
||||||
|
|
||||||
|
The list is automatically terminated at end of file, or you can do it
|
||||||
|
explicitly with an empty "header":
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
## Header and footer
|
## Header and footer
|
||||||
|
|
||||||
`page-header` is the file that is output before the generated options output
|
`page-header` is the file that is output before the generated options output
|
||||||
|
|
|
@ -319,10 +319,36 @@ sub single {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my @desc;
|
my @desc;
|
||||||
|
my $tablemode = 0;
|
||||||
while(<F>) {
|
while(<F>) {
|
||||||
|
$line++;
|
||||||
|
if(/^## (.*)/) {
|
||||||
|
if(!$tablemode) {
|
||||||
|
push @desc, ".RS\n";
|
||||||
|
$tablemode = 1;
|
||||||
|
}
|
||||||
|
push @desc, ".IP \"\\fB$1\\fP\"\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
elsif(/^##/) {
|
||||||
|
if($tablemode) {
|
||||||
|
# end of table
|
||||||
|
push @desc, ".RE\n.IP\n";
|
||||||
|
$tablmode = 0;
|
||||||
|
}
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
elsif(/^\.(IP|RS|RE)/) {
|
||||||
|
my ($cmd) = ($1);
|
||||||
|
print STDERR "$f:$line:1:ERROR: $cmd detected, use ##-style\n";
|
||||||
|
}
|
||||||
push @desc, $_;
|
push @desc, $_;
|
||||||
}
|
}
|
||||||
close(F);
|
close(F);
|
||||||
|
if($tablemode) {
|
||||||
|
# end of table
|
||||||
|
push @desc, ".RE\n.IP\n";
|
||||||
|
}
|
||||||
my $opt;
|
my $opt;
|
||||||
|
|
||||||
if(defined($short) && $long) {
|
if(defined($short) && $long) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user