Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-01-01
23:38 • Closed ticket [8e811bc1f1]: Wrong formatting of arguments in man page plus 5... artifact: d5f58e76e3 user: jan.nijtmans
23:32
Fix [8e811bc1f1]: Wrong formatting of arguments in man page check-in: d8e13bbb61 user: jan.nijtmans tags: core-8-6-branch
2022-12-29
23:16 • Ticket [8e811bc1f1] Wrong formatting of arguments in man page status still O... artifact: 2fe8bc8667 user: jan.nijtmans
17:13 • Add attachment with_aee4bada42.png to ticket [8e811bc1f16273e9|8e811bc1... artifact: 0ea7ff31f4 user: fvogel
17:12 • Ticket [8e811bc1f1] Wrong formatting of arguments in man page status still O... artifact: ab7015202c user: fvogel
2022-12-28
22:05 • Add attachment with-ee40100bc1.png to ticket [8e811bc1f16273e9|8e811bc1... artifact: 72433d04b2 user: fvogel
22:04 • Ticket [8e811bc1f1] Wrong formatting of arguments in man page status still O... artifact: 3b2ea6efac user: fvogel
20:43 • Ticket [8e811bc1f1]: 5 changes artifact: 483a703181 user: fvogel
20:39
Fix [8e811bc1f1]: Wrong formatting of arguments in man page check-in: ee40100bc1 user: fvogel tags: bug-8e811bc1f1
2022-02-05
08:09 • Ticket [8e811bc1f1] Wrong formatting of arguments in man page status still O... artifact: f3de0632b1 user: fvogel
2022-02-04
11:38 • Ticket [8e811bc1f1]: 3 changes artifact: f45494ca9d user: pooryorick
2021-02-07
11:02 • Add attachment WrongIndentInManPage.png to ticket [8e811bc1f16273e9|8e8... artifact: 348293cd03 user: fvogel
11:01 • New ticket [8e811bc1f1] Wrong formatting of arguments in man page. artifact: eb232528fb user: fvogel

Wrong formatting of arguments in man page

Closed / Fixed8e811bc1f16273e93899b4a3be5d0d533370fb70Created 6 years agoUpdated 4 years ago
Descriptionplain2021-02-07 11:01:28
When built in html some man pages show wrong formatting of the ARGUMENTS section. There is indentation that should not be there.

Example in http://www.tcl.tk/man/tcl8.6/TclLib/FileSystem.htm
See section ARGUMENTS.
Starting at Tcl_PackageInitProc **proc1Ptr (out)  indentation is wrong.

I'm attaching a snapshot.
Referenced by2
pooryorickplain2022-02-04 11:38:27
This seems to have been resolved at some point.  Perhaps this report can be closed now.
fvogelplain2022-02-05 08:09:19
Well, not for me. When I generate the html man pages with core-8-6-branch (on Windows) I still see the problem. 

I'm seeing this with both MS Edge and Firefox on Windows.
fvogelplain2022-12-28 20:43:18
I have found the issue.

First, the indentation problem appears in .AP directives within a .SH "ARGUMENTS" section. It only shows up when the size of the text to display before the first tab is larger than some limit. This can be demonstrated by shortening line 248 in FileSystem.3 from ".AP Tcl_PackageInitProc **proc1Ptr out" to, say, ".AP Tcl_type **pPtr out" and rebuilding the html man pages.

In principle one should be able to tune this limit using the .AS directive (see doc/man/macros): this would enlarge the area dedicated to displaying the .AP directive text, but it would only be a workaround. So let's forget about this possibility.

Analyzing the code generating the html man pages in tools/tcltk-man2html-utils.tcl one can see that .AP directives are translated into .IP in turn creating Definition Term (<DT>) and Definition Description (<DD>) tags. Each <DT> is preceded by a <P> paragraph tag.

What is wrong is that there is no closing tag </P>. The closing tag can be omitted in some cases (see the documentation about this, but it appears it's not the case when the <DT>... text wraps.

Hence the fix [ee40100bc1].
fvogelwiki2022-12-28 22:04:02

Note this fix is not perfect. If changes a bit the formatting of the man pages (further than fixing this bug), see the attached snapshot 'with-ee40100bc1.png'. The DD area is no longer exactly aligned with the DT area. Is this an issue? Probably not (the bug is worse IMO). Opinions?

Also my fix does not deal with the case of the first item in the .SH ARGUMENTS section, which still suffers from the bug described in the present ticket. Even knowing this, the fix is probably good enough. Going further would need to dive into the very old [1c115e499ef19779] that introduced the last change here.

fvogelwiki2022-12-29 17:12:55

After more thinking I decided to revert my originally proposed solution [ee40100bc1] and implement a very simple fix in [aee4bada42] consisting in enlarging a bit the width of Description Termes (dt) and Description Details (dd) items in Descripton Lists (dl). This does not suffer from the previously mentioned drawbacks and looks safer to me, and much simpler than diving into the nroff macros in man.macros and in the conversion code into html.

Snapshot attached ('with_aee4bada42.png').

I plan to merge soon. Any comments, anyone?

jan.nijtmanswiki2022-12-29 23:16:38

+1

jan.nijtmanswiki2023-01-01 23:38:40

Merged to core-8-6-branch and up.

Thanks, françois, for taking this!

Log in (anonymous is fine) to add a comment.

Attachments: