Today's wish is for folks – and by folks I mean me – to stop using Web search for programming language docs when I can get that info via CLI.
-
Today's wish is for folks – and by folks I mean me – to stop using Web search for programming language docs when I can get that info via CLI.
Perl
:perldoc
Python
:pydoc
Go
:go doc
Pydoc and godoc let you drill down to a specific package / class / function, showing docs for whatever granularity you're at.
Any language doc browsers I'm missing? Specifically thinking
ships in default language tooling
query from and render to terminal
browse and search the language's standard library (in the terminal)
-
If you run MacOS, I’d recommend looking at https://kapeli.com/dash
I do a fair bit of my programming offline and it is really nice to have when you need it.
-
@philsplace Dash is good. I've used it plenty. I'm thinking of CLI-specific stuff though. Minimize context switching for my ADHD brain.
-
@randomgeek ruby has `ri`, eg
ri Object
ri String.chomp! -
@randomgeek man would love that for node/js
-
-
@randomgeek oh shit am I gonna have to jump to demo?!
-
@genehack I hear they've improved Node.js compatibility.
-
@genehack Last time I directly poked at Deno, using Node modules was just a flat "no."
-
@randomgeek `man 3 $func` for any C standard lib stuff. Doesn't get better than that.
-
@m Is there a
man
invocation for header file docs? Like, after a bit of fiddling I found thatrandom()
comes fromstdlib.h
, part of the standard C librarylibc
.Is there
man ?? stdlib.h
orman ?? libc
? -
@randomgeek uh... not that I know of. I tend to just open the header at that point though, so maybe there is and I haven't found it...
-
Random Geekreplied to Micah last edited by [email protected]
@m This is probably where I'd pull out Dash or a similar tool, if discovery through documentation was my goal.
With
go doc
andpydoc
I often start my browsing at the package level, derived from the ancient muscle memory ofperldoc Package::Name
.I've made some serendipitous discoveries with that approach though, so I prefer tooling to support it.
-
@randomgeek pydoc is incomplete, unfortunately. It's pulling from docstrings only, but lots of Python stdlib doc is not in docstrings; it's in the source rST files. e.g. compare `pydoc urllib.parse` with https://docs.python.org/3/library/urllib.parse.html. What pydoc see is often wholly different (and lesser) documentation.
Perl's got us spoiled, frankly.
-
@trs Agreed on the Perl spoiling. I look at Pydoc as a lightweight docs browser. Just enough to keep me going on packages, classes, and functions.