about summary refs log tree commit diff stats
path: root/adapter/protocol/man.nim
Commit message (Collapse)AuthorAgeFilesLines
* Move JS wrapper into Monouchabptato2024-06-031-6/+2
| | | | Operation "modularize Chawan somewhat" part 3
* js: improve jsregex interfacebptato2024-06-031-71/+63
| | | | | | | It's easier to just use nested seqs here. (This also fixes reverse-search highlighting the last capture group instead of the whole match.)
* man: quote keyword & sectionbptato2024-05-221-5/+5
|
* js: refactorbptato2024-05-081-1/+1
| | | | | | | * prefix to-be-separated modules with js * remove dynstreams dependency * untangle from EmptyPromise * move typeptr into tojs
* man: fix command path manpage linksbptato2024-03-311-5/+6
| | | | isCommand was completely broken
* libregexp: update LRE_FLAG_UTF16 namebptato2024-03-211-1/+1
| | | | upstream now calls it unicode
* man: improve processBackspace underscore handlingbptato2024-03-191-2/+6
| | | | | | it is best to base our interpretation of ^H_ on the current formatting, because a) it works predictably well on man output and b) a formatting mismatch results in manRe malfunctioning
* man: better error handlingbptato2024-03-171-35/+89
| | | | | | The "redirect stderr to stdout" scheme broke with groff/man-db, as it was spitting out warnings during execution. So now we handle stderr and stdout separately.
* man: improve header/footer conversionbptato2024-03-151-4/+11
| | | | | | | * run processBackspace on the first line, because groff likes to print formatting there too * check man references like SAMEPAGE(1) with isCommand because it's commonly found in footers
* man: work around parameter insanitybptato2024-03-151-6/+18
| | | | | | | | | | | | | | | | | | | | | This is horrible. -s means completely different things on various systems. -l does not exist on various systems. Nothing is standardized, except that man should take at least one parameter and that -k should perform a search. (Seriously, that's all.) So what we do is: * add a separate env var for overriding apropos * for man:, never use -s to specify sections * for man-k:, fall back to man, EXCEPT on FreeBSD which does not have a working section specifier on man -k (neither -S nor MANSECT does anything) * for man-l:, just pass the path wholesale to man and hope it does something useful. Also, we now set MANCOLOR to 1 so FreeBSD man gives us formatting as well.
* man: misc improvementsbptato2024-03-141-59/+71
| | | | | | | * do not use query string for arguments * accept symlinks as man binaries * improve error message reporting * run all regexes on the original line
* man: rewrite in Nimbptato2024-03-131-0/+308
Depending on Perl just for this is silly. Now we use libregexp for filtering basically the same things as w3mman2html did. This required another patch to QuickJS to avoid pulling in the entire JS engine, but in return, we can now run regexes without a dummy JS context global variable. Also, man.nim now tries to find a man command on the system even if it's not in /usr/bin/man.