Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links in man pages don't always work #215

Open
magikid opened this issue Sep 2, 2017 · 4 comments
Open

Links in man pages don't always work #215

magikid opened this issue Sep 2, 2017 · 4 comments
Labels

Comments

@magikid
Copy link

magikid commented Sep 2, 2017

The links in the man pages to specific sections don't always work. Specifically, when the section being linked to is on a different man page, the link doesn't work.

For example, under the DESCRIPTION section of the rcrc.5.html page is a link to EXCLUDE_PATTERN which should point to the EXCLUDE_PATTERN section of the lsrc(1) page but instead it is linking to the EXCLUDE_PATTERN section on the rcrc page which doesn't exist.

@magikid
Copy link
Author

magikid commented Sep 2, 2017

After reading through mandoc documentation for Xr, it doesn't seem possible to use that macro to link the pages.

It may be possible through the Lk macro since that generates links to arbitrary pages but I can't get mandoc to generate reasonable ids for the links. So far the only link ids I can get mandoc to generate look like x4449524543544f5259204c41594f5554 for the section labeled EXCLUDE_PATTERN.

@mike-burns
Copy link
Contributor

mike-burns commented Sep 5, 2017

This might require patches to the mandoc HTML generator. Something around here, I suspect:

https://github.com/openbsd/src/blob/a44f9822a98f5f92d75e4231acd17435c1f03729/usr.bin/mandoc/mdoc_html.c#L919

Or it might need a new extension to mandoc. It does look like I'm violating .Sx already: "Reference a section or subsection in the same manual page" (emphasis mine).

@mike-burns mike-burns added the bug label Sep 5, 2017
@mat-m
Copy link
Contributor

mat-m commented May 3, 2020

@mike-burns : so a quick fix is to replace all .Sx out-of-page links with Emphasis on subsection and .Xr on page ?
Something like

  • Phrase all links to other pages' subsections with see command, SECTION structure
  • And update format so "see lsrc(1), EXCLUDE PATTERN" will give
see 
.Xr lsrc 1 ,
.Em EXCLUDE PATTERN

Lk is for external URLs in man pages. I would prefer an upgrade of Xr (Cross-Ref) to support a third parameter for the subsection of the page.

@mike-burns
Copy link
Contributor

@mat-m I like that use of .Em. That makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants