Formatted C++20 stdlib man pages (cppreference)

Overview

C++ stdlib man pages

stdman is a tool that parses archived HTML files from cppreference and generates groff-formatted manual pages for Unix-based systems. The goal is to provide excellent formatting for easy readability. stdman has been tested on Linux and OS X.

Sample

Installation

There's no need to compile stdman if you just want to install the man pages. Instead, just run:

./configure
make install # as a user with appropriate permissions to install

If you need to pass options to configure, you can do so. See ./configure --help for more updated information.

Troubleshooting

If you're getting 'no manual entry for std::foo' or you're seeing the libstdc++ man pages (characterized by a huge list of typedefs when you run man std::string), see the following. By default, stdman will install to /usr/local; on some systems, the manpath does not look there first. To fix this, you have two options:

  • Install to /usr/share:
./configure --prefix=/usr # will replace existing libstdc++ pages
make install
  • Manage your MANPATH in your ~/.bashrc (or similar):
export MANPATH=/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man

If your output is not colorized

You either need to set your pager up to colorize man pages, or you need to install a pager to do this for you. less will not do this by default, but it's easy enough to add. most will do this by default, but it doesn't ship with vim-like navigation.

To configure less:

# Colors
default=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 2)
purple=$(tput setaf 5)
orange=$(tput setaf 9)

# Less colors for man pages
export PAGER=less
# Begin blinking
export LESS_TERMCAP_mb=$red
# Begin bold
export LESS_TERMCAP_md=$orange
# End mode
export LESS_TERMCAP_me=$default
# End standout-mode
export LESS_TERMCAP_se=$default
# Begin standout-mode - info box
export LESS_TERMCAP_so=$purple
# End underline
export LESS_TERMCAP_ue=$default
# Begin underline
export LESS_TERMCAP_us=$green

To install most:
Arch: pacman -S most
Ubuntu: apt-get install most

export MANPAGER=most # in ~/.bashrc or similar

Building/Generating

Should you want to build the source to make modifications and/or generate your own man pages, simply:

make generate # will build stdman and generate man pages

NOTE: make generate expects sources will be in the ./reference/en/cpp directory by default. See ./configure --help to modify this.

Compilation/Generation Dependencies

  • C++11 (recommended GCC 4.9 or clang 3.4 or greater)
  • elinks (recommended 0.12pre6 or greater)
  • gzip (recommended 1.3.12 or greater)

NOTE: Generation not tested on Windows/cygwin.

Comments
  • Can't open man page for std::ref and others

    Can't open man page for std::ref and others

    $ man std::ref
    No manual entry for std::ref
    

    while

    $ man -k std::ref
    std::ref,std::cref(3), std::ref(3), std::cref(3) - std::ref,std::cref
    std::reference_wrapper(3) - std::reference_wrapper
    std::reference_wrapper::get,std::reference_wrapper::operatorT&(3), std::reference_wrapper::get(3), std::reference_wrapper::operatorT&(3) - std::reference_wrapper::get,std::reference_wrapper::operatorT&
    std::reference_wrapper::operator()(3) - std::reference_wrapper::operator()
    std::reference_wrapper::operator=(3) - std::reference_wrapper::operator=
    std::reference_wrapper::reference_wrapper(3) - std::reference_wrapper::reference_wrapper
    

    The following works:

    $ man std::ref,std::cref
    
    opened by k4rtik 9
  • configure: remove unnecessary code

    configure: remove unnecessary code

    • remove the 'rm -f Makefile' line: the sed line that follows that line truncates the file if it exists and creates it if it doesn't. there is no need to remove the file prior.

    • remove functions log_start() and log_end(): these functions are not used.

    opened by wilhelmtell 8
  • Sync to en.cppreference.com version 201803011

    Sync to en.cppreference.com version 201803011

    Update man pages to the latest version of the offline book. Please feel free to let me know if there is anything else to be done. Thanks for your really useful project.

    opened by badshah400 7
  • No manual entry for member functions

    No manual entry for member functions

    Hi, i have a problem when using stdman. I can only get man page of the class, and get "no manual entry" message for all the member functions.

    ~$ man std::string::c_str
    No manual entry for std::string::c_str
    

    I refered to issue #22, and followed the Troubleshooting in README file. still can not get it work. Could you help to check it?

    • os
    ~$ lsb_release -a
    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 16.04.2 LTS
    Release:	16.04
    Codename:	xenial
    
    • the last few lines of man std::string image
    • files in install dir
    ~$ ls -ltr /usr/local/share/man/man3 | grep "std::string"
    -rw-r--r-- 1 root root  534 Apr 11 22:04 std::hash(std::string_view,std::wstring_view,std::u16string_view,std::u32string_view).3.gz
    -rw-r--r-- 1 root root  767 Apr 11 22:04 std::hash(std::string,std::wstring,std::u16string,std::u32string,std::pmr::string,.3.gz
    -rw-r--r-- 1 root root 2603 Apr 11 22:04 std::string.3.gz
    -rw-r--r-- 1 root root 2946 Apr 11 22:04 std::stringstream.3.gz
    -rw-r--r-- 1 root root 2195 Apr 11 22:04 std::stringbuf.3.gz
    -rw-r--r-- 1 root root  529 Apr 11 22:04 std::stringstream::operator=.3.gz
    -rw-r--r-- 1 root root  319 Apr 11 22:04 std::stringstream::rdbuf.3.gz
    -rw-r--r-- 1 root root  464 Apr 11 22:04 std::stringstream::swap.3.gz
    
    • configure in .bashrc
    ~$ cat ~/.bashrc | tail -n 2
    export MANPAGER="/bin/sh -c \"col -b | vim -c 'set ft=man ts=8 nomod nolist nonu noma' -\""
    export MANPATH=/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man
    
    opened by heirish 6
  • cannot completion when pressing man std::string::  + tab

    cannot completion when pressing man std::string:: + tab

    I saw the gif that pressing std::string:: + tab will show all std::string's sub function, but it didn't show anything. output is as follows:

    man std::string:: 
    No manual entry for std::string::
    

    os : linux centos6.2

    opened by ltang666 5
  • Regenerate with v20201016 (from unofficial releases)

    Regenerate with v20201016 (from unofficial releases)

    Man pages are regenerated with the HTML books from the unofficial source (mentioned by the cppreferece) and not the official one. The reason is that, the latest official release dates back to June 2019!

    Notes from the release:

    v20201016 Latest

    • Update content from the website.
    • Remove new ads (BuySellAds)

    One problem with the generated files was that, there were a lot of trailing blanks in them. So I removed them with:

     find man ! -type d -exec sed -i'' 's/[[:blank:]]*$//' {} \;
    

    Hopefully, that didn't create any unwanted result.

    opened by reverseila 4
  • Fix #39

    Fix #39

    Cpprefenre have changed their wiki to add template in header part: Previous format:

    std::basic_string::find
    

    Current format:

    std::basic_string<CharT,Traits,Allocator>::find
    

    To remove the template with regex will fix the current break

    opened by theidexisted 4
  • `apropos` does not show CPPreference manpages

    `apropos` does not show CPPreference manpages

    Thank you very much for providing this converter!

    I've found a minor issue here: the command apropos (aka man -k) uses a "whatis" database built using the command mandb to show a list of manual pages matching a given keyword (at least on Linux).

    The program mandb fails to extract the expected information from the CPPreference manpages because they do not have a "NAME" section.

    The following patch fixes this:

    diff --git a/src/groff.hpp b/src/groff.hpp
    index 1554a62..db1d41a 100644
    --- a/src/groff.hpp
    +++ b/src/groff.hpp
    @@ -39,7 +39,9 @@ class groff
           /* First two lines are always the same. */
           state.lines[0] = ".TH " + name + " 3 "
                            "\"" + state.creation_date + "\" \"" + state.version + " | http://cppreference.com\" "
    -                       "\"C++ Standard Libary\"";
    +                       "\"C++ Standard Libary\""
    +                       "\n" ".SH NAME\n" +
    +                        name + " \\- " + name + "\n" ;
           state.lines[1] = "Synopsis";
    
           groff_detail::section(state.lines);
    

    Note that I simply use the name of the method as its description. It's very rough, maybe there is a way to extract a one-line description from the text.

    bug 
    opened by eclig 4
  • Configure options don't work

    Configure options don't work

    ./configure --datarootdir $HOME/tmp/stdman/root/ --mandir $HOME/tmp/stdman/root/man
    Configuring stdman
    Platform: Linux
    
    Reference location: ./reference/en/cpp
    Install prefix: /usr/local
    Install data prefix: /usr/local/share
    Install man prefix: /usr/local/share/man
    Temporary man location: ./man
    Generation will be on 8 threads
    
    Populating Makefile
    Done configuring stdman
    
    To install, use `sudo make install`
    
    opened by hroncok 3
  • Preserve timestamps on installation

    Preserve timestamps on installation

    Passing -p to install will preserve the timestamps from the original files. This helps ensure that builds from the same source are reproducible [1].

    Tested with both BSD and GNU install [2, 3], so this will work on both macOS and Linux.

    [1] See https://reproducible-builds.org. [2] https://man7.org/linux/man-pages/man1/install.1.html [3] https://www.freebsd.org/cgi/man.cgi?query=install

    opened by carlocab 2
  • Regenerate with v20220201 (from unofficial releases)

    Regenerate with v20220201 (from unofficial releases)

    v20220201

    Man pages are regenerated with the HTML books from the unofficial source 1 (mentioned by the cppreferece.com in their website2) and not the official one.

    Release Notes

    v20220201

    • Update content from the website.

    Build Process

    Here's is the details of build process, for those who may want to contribute:

    • Note that, this build has been done on a Macbook Air M1. the prerequisites for this build are:
      • findutils
      • gsed
      • elinks
    1. fork, clone and create a branch
    git clone [email protected]/<username>/stdman && cd $_
    git switch -C update/v20220201
    
    1. download the latest html-book and extract it
    wget -c https://github.com/PeterFeicht/cppreference-doc/releases/download/v20220201/html-book-20220201.zip
    unzip html-book-20220201.zip -d html-book
    
    1. create a directory for reference html files and mv html files to thre
    mkdir -p reference/en/
    mv html-books/reference/en/cpp/ reference/en/
    
    1. configure and generate man pages
    ./configure --reference=./reference/en/cpp
    make generate
    
    1. install and test man pages (check the date at the end of a man page)
    sudo make install
    sudo /usr/libexec/locate.updatedb (macos)
    man std::wstringstream
    
    1. remove trailing whitespace from generated man pages
    gfind man | xargs -I{} gsed -i'' 's/[[:blank:]]*$//' {} # macos
    find man | xargs -I{} sed -i'' 's/[[:blank:]]*$//' {} # gnu
    
    1. stage changes, clean untracked files and push changes to remote
    git add -u && git clean -xfd
    git commit && git push origin update/v20220201
    
    opened by reverseila 2
  • Non-printing characters in some manpages

    Non-printing characters in some manpages

    I've noticed that some manpages have non-printing characters in them; for instance, std::rand has this line (should be 0):

    https://github.com/jeaye/stdman/blob/478d353c73bec79bbbad833a31c50eecd4578b46/man/std::rand.3#L9

    According to grep, there's around 200 files that have the characters, which, comparing to the website versions, seem to almost always be characters in <span> tags, such as 0, a ;, a (, or whitespace, like the below:

    1. whitespace (I think) https://github.com/jeaye/stdman/blob/478d353c73bec79bbbad833a31c50eecd4578b46/man/std::accumulate.3#L42

    2. ; https://github.com/jeaye/stdman/blob/478d353c73bec79bbbad833a31c50eecd4578b46/man/std::condition_variable::wait_until.3#L66

    3. ( https://github.com/jeaye/stdman/blob/478d353c73bec79bbbad833a31c50eecd4578b46/man/std::iterator_traits.3#L71

    Some unicode characters also don't seem to be handled correctly:

    https://github.com/jeaye/stdman/blob/478d353c73bec79bbbad833a31c50eecd4578b46/man/std::islower(std::locale).3#L43

    It'd be nice if all of these could be parsed and rendered properly.

    opened by JCGoran 0
  • Minor cleanup coding format of <code>...</code>

    Minor cleanup coding format of ...

    <code>...</code> is still there. I'm not sure this tag should be automatically handled by asciidoctor, if so it should be some option to fully clean it up I guess.

    At any rate, it would be great to clean this tag up.

    PS. I'm using release tag 2018.03.11 if using latest commit, generated man page files' filename *.3 will also include template argument like std::something<Arg1,Arg2>:: .... (that is for another issue).

    opened by haxpor 0
  • cannot completion when pressing man std::string:: + tab

    cannot completion when pressing man std::string:: + tab

    I install this by Homebrew at mac. brew install stdman and find the problem as title describes.

    I restart Terminal.app but still find it not work.

    Thanks in advance.

    opened by xxyyttxx 1
  • equations in docs

    equations in docs

    When I opened man page for std::normal_distribution I found out that the equation is not displayed correctly. It looks like this: f(x; μ,σ) =

                  1
                  σ
                  √
                  2π
    
                  exp⎛
                  ⎜
                  ⎝
    
                  -1
                  2
    
                  ⎛
                  ⎜
                  ⎝
    
                  x-μ
                  σ
    
                  ⎞
                  ⎟
                  ⎠2
                  ⎞
                  ⎟
                  ⎠
    

    and it should be all in one line.

    opened by robgal519 7
  • std::async Synopsis formatting is messed up

    std::async Synopsis formatting is messed up

    Formatting of synopsis section of man std::async is messed up to the point of being undecipherable, no matter what terminal window height I try.

    screen shot 2016-05-28 at 20 58 34

    It most certainly has to do with the complex table format in use at http://en.cppreference.com/w/cpp/thread/async

    opened by k4rtik 1
Releases(2018.03.11)
Owner
Jeaye Wilkerson
I'm a leader, a problem solver, and a hacker with a passion for privacy and security.
Jeaye Wilkerson
Formatted C++20 stdlib man pages (cppreference)

C++ stdlib man pages stdman is a tool that parses archived HTML files from cppreference and generates groff-formatted manual pages for Unix-based syst

Jeaye Wilkerson 865 Dec 28, 2022
MAN - Man is Thread Pool in C++17

Introduction MAN is a ThreadPool wrote in C++17. The name is chosen because, at least in France, it is said that men are not able to do several things

Antoine MORRIER 6 Mar 6, 2022
Custom implementation of C stdlib malloc(), realloc(), and free() functions.

C-Stdlib-Malloc-Implementation NOT INTENDED TO BE COMPILED AND RAN, DRIVER CODE NOT OWNED BY I, ARCINI This is a custom implmentation of the standard

Alex Cini 1 Dec 27, 2021
Online version of the greatest card game known to man

10Flips Online version of the greatest card game known to man Client The client is made using Emscripten. Installing # Get the emsdk repo git clone ht

Oskar Mendel 2 Oct 26, 2021
Now I shall sing the second kingdom there where the soul of man is cleansed, made worthy to ascend to Heaven.

Inferno® is a distributed operating system, originally developed at Bell Labs, but now developed and maintained by Vita Nuova® as Free Software. Appli

null 3 Jul 26, 2022
Slender Man Returns is a game inspired by the original indie game Slender

Slender Man Returns is a game inspired by the original indie game Slender: The Eight Pages, but redesigned to run on the popular Unity game engine. Ported to PSVita. Original project by Rosario Terranova.

null 8 Jul 5, 2022
Set of tools for No Man's Sky

NMS-Tools Set of tools for No Man's Sky. NMS-Extract Shut up! Give me the latest version! Extractor that scans a directory (should be the PCBANKS fold

Hugo Peters 27 Jun 29, 2022
PAC-MAN emulator written in Zig

zig-pacman A PAC-MAN emulator written in Zig to showcase the zig80 library. Requires Zig, zigmod, and SDL2. Usage usage: pacman [-htda] [-c <ratio>] [

Matthew 3 Jan 24, 2022
C++ 98/11/14 manual pages for Linux/MacOS

cppman C++ 98/11/14/17/20 manual pages for Linux, with source from cplusplus.com and cppreference.com. Features Supports two backends (switch it with

Wei-Ning Huang 1.1k Jan 3, 2023
PageBuster - dump all executable pages of packed processes.

PageBuster Ever wanted to dump all the executable pages of a process? Do you crave something capable of dealing with packed processes? We've got you c

rev.ng 188 Oct 10, 2022
Offical repo for "Moynihan, M., Ruano, S., Pagés, R. and Smolic, A., 2021. Autonomous Tracking For Volumetric Video Sequences"

MeshTracker A segmentation-based tracking algorithm for registering volumetric video meshes (ply/obj) in C++. This is the official implementation of t

V-Sense 22 Nov 7, 2022
This is kdmapper but it doesn't use ExAllocatePool instead it allocates pages to avoid being in BigPoolTable,

KDMapper without allocating memory in BigPoolTable Original creator https://github.com/z175 Improved by https://github.com/TheCruZ TheCruz has intergr

tygo lokum 36 Jan 3, 2023
Remap ELF LOAD segments to huge pages

Quick start Not recommended as a production solution, but it's a very fast way to benchmark if your application benefits from remapping your text and

null 19 Dec 21, 2022
A command-line tool to generate Linux manual pages from C source code.

mangen A command-line tool to generate Linux manual pages from C source code. Description mangen is, as said above, a program to generate Linux manual

null 2 Nov 15, 2021
Manual mapper that uses PTE manipulation, Virtual Address Descriptor (VAD) manipulation, and forceful memory allocation to hide executable pages. (VAD hide / NX bit swapping)

Stealthy Kernel-mode Injector Manual mapper that uses PTE manipulation, Virtual Address Descriptor (VAD) manipulation, and forceful memory allocation

Charlie Wolfe 137 Jan 3, 2023