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

Create man page for btop in Markdown #724

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Conversation

ottok
Copy link
Contributor

@ottok ottok commented Jan 18, 2024

Create a man page in Markdown format so that it can be read online on GitHub etc and it can be edited much more easily than raw troff/groff files.

Compile it to proper man page format at build-time using 'lowdown' which is available in all modern Linux distros and also Homebrew for Mac. This commit does however not add 'lowdown' in any build dependencies or in the CI, that needs to be done separately.

This was split out from #715.

I am aware that several man pages for btop already exists. We just need one merged upstream first so that the various authors can start to target that one and same file with improvements.

Some say btop is 'too small' or simple to have a man page. There is no such thing as too small - all Unix/Linux commands must have a man page. The gap between reading a man page online or offline is significant to the effort of having a live system and running btop --help so see the current help in lack of a man page. If the command is small, then the man page is small and easy to maintain. Smallness/simplicity is not an excuse to not have a man page.

@ottok
Copy link
Contributor Author

ottok commented Jan 27, 2024

@aristocratos Hi! Could you consider merging this? If there is one manpage in the repo it will be much easier for others to contribute and enrich it as there is a file to target.

@aristocratos
Copy link
Owner

@ottok Will take a look at it later today and add some automation to build if lowdown is available and add some documentation for optional man page dependency.

Otherwise looks good 👍

@ottok
Copy link
Contributor Author

ottok commented Mar 1, 2024 via email

@aristocratos
Copy link
Owner

@ottok
Sure thing. I was mainly going to add a check in the Makefile if lowdown is available in path and if so build the man page (otherwise print something like: Skipping man page, missing lowdown), then a check during install if btop.1 is present.

And a note in the README.md that lowdown is an optional dependency for building the man page.

@ottok
Copy link
Contributor Author

ottok commented Mar 3, 2024

Without Lowdown CI passes:

image

Make and CMake output this and builds pass despite the intentional warning:

image

image

@ottok
Copy link
Contributor Author

ottok commented Mar 3, 2024

@aristocratos Please give advice on how to get Snapcraft build dependencies defined correctly.

Other than that this PR is ready.

When Lowdown is present CMake will output:

image

And regular Make:

image

@aristocratos
Copy link
Owner

@ottok Not sure why the snap build is completely failing, since with your current Makefile and cmake changes the missing lowdown should be ignored.

@kz6fittycent Do you know what the issue with the snap build is?

aristocratos
aristocratos previously approved these changes Mar 3, 2024
@aristocratos
Copy link
Owner

@ottok Oh right, should also add a note in the README.md about lowdown being required to build the man page.

@ottok
Copy link
Contributor Author

ottok commented Mar 3, 2024

@ottok Not sure why the snap build is completely failing, since with your current Makefile and cmake changes the missing lowdown should be ignored.

Please read the second commit and message: I did add lowdown to Snap build but for some reason it does not install it.

README.md updated now.

Create a man page in Markdown format so that it can be read online on
GitHub etc and it can be edited much more easily than a raw troff/groff
file.

Compile it to proper man page format at build-time using 'lowdown' if
it is available on the system, otherwise just issue a warning in yellow.

Tested to work both with:

    export VERBOSE=1
    make
    make install
    make uninstall

    cmake -B build
    cmake --build build --verbose

While Lowdown is easy to manually install in all modern Linux distros
and also Homebrew for Mac, this commit does not add 'lowdown' in any
build dependencies or in the CI, that needs to be done separately.
Building the man page is optional and happens automatically if command
'lowdown' is present on the system. Add it to all possible GitHub CI files
so man page conversion will be tested and fully used.

Unfortunately 'lowdown' cannot be added to the musl jobs the program is
available only starting from Alpine v3.15, while the musl Docker images
run Alpine v3.14 (and haven't been updated in 2+ years).

Also, the Snap build used Ubuntu 20.04 "Focal" which equally is too old
to include Lowdown, which is available only from Ubuntu 22.04 "Jammy"
onward:
https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=lowdown
@ottok
Copy link
Contributor Author

ottok commented Mar 4, 2024

Ok, I figured out that the Snap build actually runs on Ubuntu 20.04 which is too old to include Lowdown: https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=lowdown

Added comment there now instead.

This should be ready to be merged now.

@ottok ottok requested a review from aristocratos March 4, 2024 01:15
Copy link
Owner

@aristocratos aristocratos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, nice work.

Thanks for contributing!

@aristocratos aristocratos merged commit c767099 into aristocratos:main Mar 4, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants