question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handling manpages

See original GitHub issue

How would this feature be useful? Some packages, like ipython and ranger-fm come with man pages. It would be nice to provide these, such that man ipython will work.

Describe the solution you’d like

Much like we ask users to ensure ~/.local/bin is on their PATH and we manage symlinks there. We could manage symlinks to man pages in a location and ask them to add a MANDATORY_MANPATH or MANPATH_MAP line to their .manpath file.

Describe alternatives you’ve considered

I tried globbing ~/.local/pipx/venvs/*/share/man in my man config. But didn’t succeed. Adding a line for each installed package does work as expected, so that’s why I think automating the process would be ideal.

I’m willing and able to implement this. I just wanted to open discussion first instead of immediately coming with an elaborate PR.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
uranusjrcommented, Jul 18, 2022

Option 1 is probably the easiest path for now since there’s no suitable metadata for specifying file location now (entry point is close but it’s designed for Python files and I’m not sure if people would think it’s a good idea for us to use it like this). If enough projects catch on, we’d have more ground to push for a metadata standard.

So the next steps for anyone interested in implementing this would be:

  1. Add documentation that pipx would look for man page files inside ${DATA_DIRECTORY}/data/share/man/.
  2. Implement logic for the above; more specifically, the installation process would install those as wheel data files into the environment, and pipx should pick those up and symlink/copy them into (say) ${PIPX_HOME}/share/man, like we do for entry points (inside ${PIPX_HOME}/bin).
  3. Tell projects they can put man page files there for pipx to pick up. Listen to feedback and improve things, eventually producing an Informational PEP to make this into a standard.
0reactions
ilyagrcommented, Aug 20, 2022

The following script seems to work for me. I called it pipx-manpage-install.

You need to have stow installed. For man to find the manpages, ~/.local/share/man needs to be in the output of the manpath command. It is there on my debian system by default, though I’m not sure how it got there.

The --ignore pattern comes from https://unix.stackexchange.com/a/293676/261949.

#!/bin/bash
# Create links from `~/.local/share` to the files in `share` subdirectories
# of virtual environments installed with `pipx`.

# Run with `-n` option for a dry run, with `-D` to undo.
# You may have to resolve conflicts manually.
# Assumes there are only directories in the venv dir.

cd $(pipx environment -v PIPX_LOCAL_VENVS)
stow --ignore='^((?!share).)*$' --target=$(realpath ~/.local) -v $@ *
Read more comments on GitHub >

github_iconTop Results From Across the Web

man-pages(7) - Linux manual page - man7.org
(Within the man-pages project, the necessary updates to these timestamps are handled automatically by scripts, so there is no need to manually update...
Read more >
HOW TO READ MAN PAGES
This will tell you what kind of command you're dealing with. If it says CMD is a 'builtin', then do 'help CMD' (bash...
Read more >
Understanding man Pages in Linux [Beginner's Guide]
The man pages, short for reference manual pages, are your keys to Linux. Understanding the man pages could be challenging.
Read more >
Linux / UNIX: Getting help with man pages and how to use them
Linux and UNIX-like system comes with man (manual) pages. The man command is used to format and display the man pages.
Read more >
Mastering Linux Man Pages - A Definitive Guide - YouTube
Read the full blog post here:https://www.linuxtrainingacademy.com/manDo you want to know where to find the answer to just about any Linux ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found