jeaye / stdman Goto Github PK
View Code? Open in Web Editor NEWFormatted C++20 stdlib man pages (cppreference)
License: MIT License
Formatted C++20 stdlib man pages (cppreference)
License: MIT License
Hi, nice work. just an fyi, for mac installation, mandb doesnt exist, instead
sudo /usr/libexec/makewhatis
will do the trick.
I think the contents section is redundant and should be removed to make space for more important information.
<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).
This is a Unicode issue with non-breaking space, I believe. It would be best to just remove any instances of it (they come in from elinks/html).
It should be appeared since c++17.
I expected it to be in color, like in your preview )
A short instruction or a link in the README how to make output colorized would be helpful.
For Ubuntu:
sudo apt-get install most
echo 'export MANPAGER="most"' >> ~/.bashrc && source ~/.bashrc
$ 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
When installing, and running sudo mandb
, I get:
mandb: warning: failed to store entry for std::filesystem::directory_entry::operator==,!=,,>=,(3)
mandb: warning: failed to store entry for std::type_index::operator==,!=,,>=,(3)
mandb: warning: failed to store entry for std::chrono::operator==,,>=,(std::chrono::leap_second)(3)
mandb: warning: failed to store entry for std::experimental::filesystem::directory_entry::operator==,!=,,>=(3)
The corresponding documentation is for, e.g.:
It seems that operators <
and >
are somehow missing in the warning text ==,!=,,>=,
, which perhaps explains the problem.
It seems that with PR #46, the man pages have been updated to a newer version 2022.02.01 while the currently latest tag is 2021.12.21.
The latest release is 2018.03.11. How about a new one? Some managers use tags to update their packages.
The version may be synced by offline archives or others.
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.
These formatting issues are not caused by stdman, but rather the way elinks is rendering the html. Some steps could be taken to massage the html into something elinks prefers.
I'm considering creating a FreeBSD port (package) for this project so the tool can be easily installed via the OS package manager.
Would it be possible to get a new release given that the last one is from 2018?
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?
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
~$ 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
~$ 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
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
There does not seem to be an entry for std::find.
The pages should list what the headers are guaranteed to contain.
See Homebrew/homebrew-core#11973
Also, what about changing versioning from 0.X to YYYY-MM-DD, to keep it clean and synced?
Currently, bash will really get in the way when typing the operator names. For example:
$ man operator+,operator-(std::time_point)
bash: syntax error near unexpected token `(`
The current solution is to quote operators entirely.
$ man "operator+,operator-(std::time_point)"
A better solution could be made that just uses common short names for the operators, like operator lt
, operator shr
, et cetera.
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.
I don't see examples in the man pages. Am I missing something?
I've noticed that some manpages have non-printing characters in them; for instance, std::rand
has this line (should be 0
):
Line 9 in 478d353
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:
whitespace (I think)
Line 42 in 478d353
;
(
stdman/man/std::iterator_traits.3
Line 71 in 478d353
Some unicode characters also don't seem to be handled correctly:
stdman/man/std::islower(std::locale).3
Line 43 in 478d353
It'd be nice if all of these could be parsed and rendered properly.
I thought I'd make an issue here out of the comment I left on the Arch AUR package for stdman
, since making this change would be an improvement on all systems, not only Arch. (The issue there was that installing the manpages to the standard location conflicted with manpages provided by gcc, and my comment--this issue--provides a solution that would be useful to package maintainers as well as normal users.)
I updated the package to install the man pages to /usr/local. They do not really belong there, but at least this restores gcc compatibility.
While it's good that you're ensuring this package doesn't conflict with the gcc package, it is explicitly forbidden to install Arch packages under /usr/local
1. In fact, you really want to install these manpages in the usual location so that users don't have to modify their MANPATH
or change /etc/man_db.conf
in order for man
to be able to find them. Resolving the conflict is easy: append a suffix (perhaps cppref
) to the section part of each manpage's filename. This is done all the time in order to deal with similar manpage conflicts:
arch-vm[1060]:~% pacman -Qo /usr/share/man/man1/passwd*
/usr/share/man/man1/passwd.1.gz is owned by shadow 4.6-1
/usr/share/man/man1/passwd.1ssl.gz is owned by openssl 1.1.0.i-1
Here's all the manpage (sub)sections currently on my system:
arch-vm[1061]:~% sed -rnz 's~^.*\.([[:print:]]+)\.gz$~\1~p' <(find /usr/share/man/man* -type f -print0) | sort -z | uniq -z | xargs -0 echo
0p 1 1m 1p 1perl 1ssl 2 3 3am 3cvc 3p 3pcap 3perl 3pm 3ssl 3t 3tiff 3x 4 5 5ssl 6 7 7ssl 8 n
Users can set MANSECT
in their environment or change the SECTION
directive in /etc/man_db.conf
if they want to change which sections are searched and in what order.
Even if this weren't the case, and even though the Arch FAQ says that Arch follows the specifications outlined in systemd's file-hierarchy(7)
manpage rather than those of the FHS, the aforementioned manpage has no mention of /usr/local
at all, so deferring to the longstanding convention (also explicitly codified by the FHS) that it exists for administrators to install stuff that they don't want the system package manager to touch would still be the best course of action. ↩
If a new release is produced I can at last flag https://aur.archlinux.org/packages/stdman as out-of-date :-)
./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`
Why can't I find things like cout?
man std::cout
No manual entry for std::cout
I get entries for std::string and std::iostream so I know the man pages installed.
Give credit where it's due.
i cant find way to access https://en.cppreference.com/w/cpp/header/functional, it seems its missing
steps to reproduce:
man functional
man std::functional
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.
It most certainly has to do with the complex table format in use at http://en.cppreference.com/w/cpp/thread/async
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.