Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f74e5b79
Commit
f74e5b79
authored
Apr 28, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Control the layout of output tables a little better so they're easier
to debug. Small code cleanup around tables.
parent
cf282cda
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
43 deletions
+67
-43
Doc/perl/python.perl
Doc/perl/python.perl
+67
-43
No files found.
Doc/perl/python.perl
View file @
f74e5b79
...
...
@@ -159,7 +159,9 @@ sub do_cmd_dfn{
sub
do_cmd_emph
{
return
use_italics
(
@_
);
}
sub
do_cmd_file
{
return
use_wrappers
(
@_
[
0
],
'
"<tt class=file>
',
'
</tt>"
');
}
return
use_wrappers
(
@_
[
0
],
'
<tt class=file>
',
'
</tt>
');
}
sub
do_cmd_filenq
{
return
use_wrappers
(
@_
[
0
],
'
<tt class=file>
',
'
</tt>
');
}
sub
do_cmd_samp
{
return
use_wrappers
(
@_
[
0
],
'
"<tt class=samp>
',
'
</tt>"
');
}
sub
do_cmd_kbd
{
...
...
@@ -789,6 +791,19 @@ sub get_th{
return
$r
;
}
sub
fix_font
{
# do a little magic on a font name to get the right behavior in the first
# column of the output table
my
$font
=
@_
[
0
];
if
(
$font
eq
'
textrm
')
{
$font
=
'';
}
elsif
(
$font
eq
'
file
'
||
$font
eq
'
filenq
')
{
$font
=
'
tt class=file
';
}
return
$font
;
}
sub
setup_column_alignments
{
local
(
$_
)
=
@_
;
my
(
$a1
,
$a2
,
$a3
,
$a4
)
=
split
(
/[|]/
,
$_
);
...
...
@@ -804,33 +819,36 @@ sub setup_column_alignments{
sub
do_env_tableii
{
local
(
$_
)
=
@_
;
my
(
$th1
,
$th2
,
$th3
,
$th4
)
=
setup_column_alignments
(
next_argument
());
my
$font
=
next_argument
(
);
my
$font
=
fix_font
(
next_argument
()
);
my
$h1
=
next_argument
();
my
$h2
=
next_argument
();
$font
=
''
if
(
$font
eq
'
textrm
');
s/[\s\n]+//
;
$globals
{'
lineifont
'}
=
$font
;
return
'
<table border align=center><thead>
'
return
'
<table border align=center>
'
.
"
\n
<thead>
"
.
"
\n
<tr
$TABLE_HEADER_BGCOLOR
>
"
.
"
\n
$th1
<b>
$h1
</b></th>
"
.
"
\n
$th2
<b>
$h2
</b></th>
"
.
"
\n
</thead>
"
.
"
\n
<tbody valign=baseline>
"
.
"
\n
</thead>
"
.
"
\n
<tbody valign=baseline>
"
.
$_
.
"
\n
</tbody></table>
";
.
"
\n
</tbody>
"
.
"
\n
</table>
";
}
sub
do_cmd_lineii
{
local
(
$_
)
=
@_
;
my
$c1
=
next_argument
();
my
$c2
=
next_argument
();
s/[\s\n]+//
;
my
(
$font
,
$sfont
,
$efont
)
=
(
$globals
{'
lineifont
'},
'',
'');
if
(
$font
)
{
$sfont
=
"
<
$font
>
";
$efont
=
"
</
$font
>
";
$efont
=~
s/ .*>/>/
;
}
my
(
$c1align
,
$c2align
)
=
@col_aligns
[
0
,
1
];
return
"
<tr>
$c1align$sfont$c1$efont
</td>
\n
"
return
"
\n
<tr>
$c1align$sfont$c1$efont
</td>
\n
"
.
"
$c2align$c2
\
</td>
"
.
$_
;
}
...
...
@@ -838,22 +856,23 @@ sub do_cmd_lineii{
sub
do_env_tableiii
{
local
(
$_
)
=
@_
;
my
(
$th1
,
$th2
,
$th3
,
$th4
)
=
setup_column_alignments
(
next_argument
());
my
$font
=
next_argument
(
);
my
$font
=
fix_font
(
next_argument
()
);
my
$h1
=
next_argument
();
my
$h2
=
next_argument
();
my
$h3
=
next_argument
();
$font
=
''
if
(
$font
eq
'
textrm
');
s/[\s\n]+//
;
$globals
{'
lineifont
'}
=
$font
;
return
'
<table border align=center><thead>
'
return
'
<table border align=center>
'
.
"
\n
<thead>
"
.
"
\n
<tr
$TABLE_HEADER_BGCOLOR
>
"
.
"
\n
$th1
<b>
$h1
</b></th>
"
.
"
\n
$th2
<b>
$h2
</b></th>
"
.
"
\n
$th3
<b>
$h3
</b></th>
"
.
"
\n
</thead>
"
.
"
\n
<tbody valign=baseline>
"
.
"
\n
</thead>
"
.
"
\n
<tbody valign=baseline>
"
.
$_
.
"
\n
</tbody></table>
";
.
"
\n
</tbody>
"
.
"
\n
</table>
";
}
sub
do_cmd_lineiii
{
...
...
@@ -861,13 +880,15 @@ sub do_cmd_lineiii{
my
$c1
=
next_argument
();
my
$c2
=
next_argument
();
my
$c3
=
next_argument
();
s/[\s\n]+//
;
my
(
$font
,
$sfont
,
$efont
)
=
(
$globals
{'
lineifont
'},
'',
'');
if
(
$font
)
{
$sfont
=
"
<
$font
>
";
$efont
=
"
</
$font
>
";
$efont
=~
s/ .*>/>/
;
}
my
(
$c1align
,
$c2align
,
$c3align
)
=
@col_aligns
[
0
,
1
,
2
];
return
"
<tr>
$c1align$sfont$c1$efont
</td>
\n
"
return
"
\n
<tr>
$c1align$sfont$c1$efont
</td>
\n
"
.
"
$c2align$c2
</td>
\n
"
.
"
$c3align$c3
\
</td>
"
.
$_
;
...
...
@@ -876,24 +897,25 @@ sub do_cmd_lineiii{
sub
do_env_tableiv
{
local
(
$_
)
=
@_
;
my
(
$th1
,
$th2
,
$th3
,
$th4
)
=
setup_column_alignments
(
next_argument
());
my
$font
=
next_argument
(
);
my
$font
=
fix_font
(
next_argument
()
);
my
$h1
=
next_argument
();
my
$h2
=
next_argument
();
my
$h3
=
next_argument
();
my
$h4
=
next_argument
();
$font
=
''
if
(
$font
eq
'
textrm
');
s/[\s\n]+//
;
$globals
{'
lineifont
'}
=
$font
;
return
'
<table border align=center><thead>
'
return
'
<table border align=center>
'
.
"
\n
<thead>
"
.
"
\n
<tr
$TABLE_HEADER_BGCOLOR
>
"
.
"
\n
$th1
<b>
$h1
</b></th>
"
.
"
\n
$th2
<b>
$h2
</b></th>
"
.
"
\n
$th3
<b>
$h3
</b></th>
"
.
"
\n
$th4
<b>
$h4
</b></th>
"
.
"
\n
</thead>
"
.
"
\n
<tbody valign=baseline>
"
.
"
\n
</thead>
"
.
"
\n
<tbody valign=baseline>
"
.
$_
.
"
\n
</tbody></table>
";
.
"
\n
</tbody>
"
.
"
\n
</table>
";
}
sub
do_cmd_lineiv
{
...
...
@@ -902,13 +924,15 @@ sub do_cmd_lineiv{
my
$c2
=
next_argument
();
my
$c3
=
next_argument
();
my
$c4
=
next_argument
();
s/[\s\n]+//
;
my
(
$font
,
$sfont
,
$efont
)
=
(
$globals
{'
lineifont
'},
'',
'');
if
(
$font
)
{
$sfont
=
"
<
$font
>
";
$efont
=
"
</
$font
>
";
$efont
=~
s/ .*>/>/
;
}
my
(
$c1align
,
$c2align
,
$c3align
,
$c4align
)
=
@col_aligns
;
return
"
<tr>
$c1align$sfont$c1$efont
</td>
\n
"
return
"
\n
<tr>
$c1align$sfont$c1$efont
</td>
\n
"
.
"
$c2align$c2
</td>
\n
"
.
"
$c3align$c3
</td>
\n
"
.
"
$c4align$c4
\
</td>
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment