Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create and maintain your own man manual

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to create and maintain your own man manual. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Install Um

Um works with Linux and Mac OS. Currently, it can only be installed using the Linuxbrew package manager on Linux systems. If you have not installed Linuxbrew, please refer to the following link:

Linuxbrew: a general package manager for Linux and MacOS

After installing Linuxbrew, run the following command to install the Um utility.

$brew install sinclairtarget/wst/um

If you will see output similar to the following, congratulations! Um is installed and ready to use.

[...] = > Installing sinclairtarget/wst/um== > Downloading https://github.com/sinclairtarget/um/archive/4.0.0.tar.gz==> Downloading from https://codeload.github.com/sinclairtarget/um/tar.gz/4.0.0-=#=# # # = = > Downloading https://rubygems.org/gems/kramdown-1.17.0.gem############################# # 100.0% files = > gem install / home/sk/.cache/Homebrew/downloads/d0a5d978120a791d9c5965fc103866815189a4e3939== > CaveatsBash completion has been installed to:/home/linuxbrew/.linuxbrew/etc/bash_completion.d== > Summary [] / home/linuxbrew/.linuxbrew/Cellar/um/4.0.0: 714 files 1.3MB, built in 35 seconds== > Caveats== > opensslA CA file has been bootstrapped using certificates from the SystemRootskeychain. To add additional certificates (e.g. The certificates added inthe System keychain), place .pem files in/home/linuxbrew/.linuxbrew/etc/openssl/certs and run/home/linuxbrew/.linuxbrew/opt/openssl/bin/c_rehash== > rubyEmacs Lisp files have been installed to:/home/linuxbrew/.linuxbrew/share/emacs/site-lisp/ruby== > umBash completion has been installed to:/home/linuxbrew/.linuxbrew/etc/bash_completion.d

Before you can make your man man pages, you need to enable bash completion for Um.

To enable bash completion, you first need to open the ~ / .bash_profile file:

$nano ~ / .bash_profile

And add the following to it:

If [- f $(brew-- prefix) / etc/bash_completion.d/um-completion.sh]; then. $(brew-- prefix) / etc/bash_completion.d/um-completion.shfi

Save and close the file. Run the following command to update the changes.

$source ~ / .bash_profile

All the preparations have been completed. Let's continue to create our * man man pages.

Create and maintain your own man manual

If you want to create your own man manual for dpkg commands. Please run:

$um edit dpkg

The above command opens the markdown template in the default editor:

My default editor is Vi, so the above command opens it in the Vi editor. Now, start adding everything about the dpkg command to this template.

Here is an example:

As you can see in the output of the figure above, I added a summary, description, and two parameter options for the dpkg command. You can add all the parts you need to the man manual. But you also need to make sure that you provide an appropriate and easy-to-understand title for each section. When you are finished, save and exit the file (if you are using the Vi editor, press ESC and type: wq).

*, use the following command to view the newly created man man page:

$um dpkg

As you can see, dpkg's man man page looks exactly the same as the official man page. If you want to edit and / or add more details to the man page, run the same command again and add more details.

$um edit dpkg

To view a list of newly created man man pages using Um, run:

$um list

All man pages will be saved in a directory named .um in the home directory

Just in case, if you don't want a particular page, just delete it, as shown below.

$um rm dpkg

To view the help section and all available general options, run:

$um-- helpusage: um um [ARGS...] The first form is equivalent to `um read `. Subcommands: um (l) ist List the available pages for the current topic. Um (r) ead Read the given page under the current topic. Um (e) dit Create or edit the given page under the current topic. Um rm Remove the given page. Um (t) opic [topic] Get or set the current topic. Um topics List all topics. Um (c) onfig [config key] Display configuration environment. Um (h) elp [sub-command] Display this help message, or the help message for a sub-command. Configure Um

To view the current configuration, run:

$um configOptions prefixed by'* 'are set in / home/sk/.um/umconfig.editor = vipager = lesspages_directory = / home/sk/.um/pagesdefault_topic = shellpages_ext = .md

In this file, you can edit and change the values of the pager, editor, default_topic, pages_directory and pages_ext options as needed. For example, if you want to save the newly created Um page in the Dropbox folder, simply change the value of pages_directory in the ~ / .um/umconfig file and change it to the Dropbox folder.

Pages_directory = / Users/myusername/Dropbox/um Thank you for reading! This is the end of this article on "how to create and maintain your own man manual". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report