Commit graph

24 commits

Author SHA1 Message Date
Yorhel
ccecb28835 Drop grog(1) in favor of 'groff -mandoc' + two regexes
This provides an almost 2x speedup in man page rendering time and
removes some heuristics to work around bad guesses by grog(1).

Funnily enough, this also fixes rendering of obscure man pages that
happen to use 'grap' macros; grog detected those correctly but my groff
installation doesn't actually support rendering that.

No doubt I broke rendering of other pages, will have to see.
2024-04-28 15:08:00 +02:00
Yorhel
f6a8d5c134 Add Ubuntu 21.10 2021-10-17 09:56:28 +02:00
Yorhel
eecc8e798c Workaround grog using -ms for pod2man generated sources
When I have time I'll do a search for man pages that actually *need*
-ms, as I'm getting the impression that it's never used for man pages
and all of grog's guesses for it are wrong.
2020-10-16 12:23:41 +02:00
Yorhel
bd573a4412 ManUtils: Add groff instructions after running grog
Those instructions may sometimes confuse grog and cause it to autodetect
the wrong macro package.
2020-08-07 10:23:40 +02:00
Yorhel
f0df5092c3 Rust dep updates 2019-05-25 08:27:23 +02:00
Yorhel
b36ff90c6e Fix invocation of groff 1.22.3 to pass on -P-c
Because, without that argument, groff (invoking grotty) will output
SGR escape sequences, which we're not ready to deal with.
2018-11-10 09:07:14 +01:00
Yorhel
8e5fa1e165 www: Include .so mans if found in the same package
Unfortunately, this can lead to slightly confusing scenarios, because
the exact package of the displayed man page is not very well defined.
It's possible that, when browsing from a package listing to a man page,
you may see an included file that does not come from the package you
browsed from.
E.g. https://manned.org/pwrite/5f2909f6 - that man page simply includes
pread.2, but from the URL it's unclear from which package or system it
should be included.

The only way to fix this is to add the package ID to the link format.
2017-02-26 08:52:23 +01:00
Yorhel
746889851c A few more HTML conversion improvements
- Fix segfault on empty output (bug was in XS code)
- Still better end-of-URL detection
- Recognize a few common multicharacter sections in man references
2017-01-15 20:27:16 +01:00
Yorhel
6114b17389 Experimental rewrite of grotty to html conversion in Rust
The previous C code was troublesome.
- Didn't handle long lines
- I couldn't convince myself that it was free of memory safety issues
- Needed improving anyway, there are some formatting bugs. These are
  hard to fix in the current code.

I mostly replicated the formatting bugs of the old C implementation in
Rust, and possibly added a few new bugs as well. It's not a significant
improvement right now, more testing and fixing will be needed.

The performance of both implementations is comparable, with the Rust
version being slightly faster in many cases (and slower in some others).
I did spend more time trying to optimize this Rust version than I did
with the old C code. I initially tried a naive-ish conversion of the C
code to Rust, but that turned out to be much slower and I had to resort
to using regexes and different data structures fix that.
2017-01-15 12:17:34 +01:00
Yorhel
a7352d27b9 Fix possible wrapping of MANNEDINCLUDE by removing space
This doesn't really guarantee that it won't wrap, but fixes at least one
man page.

- https://manned.org/BlockSelectionDCOPInterface/6dfdf921
2016-10-16 10:28:44 +02:00
Yorhel
17fc298217 Fix handling of URLs ending in a ⟩
I've known about this issue before, but didn't realize it was so
widespread. This fixes many links.
2016-10-16 09:11:15 +02:00
Yorhel
2da67d585c Various changes/fixes, 3 new distro versions 2015-04-28 08:27:29 +02:00
Yorhel
17476b5b54 Fix MANNEDINCLUDE formatting on e.g. zshall.1 2014-09-25 09:22:48 +02:00
Yorhel
a897c572ab ManUtils: Disable printing of warnings 2013-08-21 13:21:08 +02:00
Yorhel
f30c372f51 Decrease formatted man page size to 80 columns
I've found 90 to be a tiny bit too wide - it makes the contents overlap
with the selection box in not-very-wide windows.
2013-04-27 07:15:41 +02:00
Yorhel
91c1367923 ManUtils: Widen rendered man page to 90 columns
Looks slightly less cramped.
2012-07-17 21:38:43 +02:00
Yorhel
53857d5b84 ManUtils: Fix XSS vulnerability and rendering bug in URL formatting
The characters <>" are now simply not allowed in URLs. Incidentally,
this also fixes formatting of some URLs within brackets, e.g.
<http://blicky.net/>.
2012-07-17 21:24:55 +02:00
Yorhel
147e76d405 ManUtils: Fix render issues when grog detects multiple macro packages 2012-07-11 14:29:15 +02:00
Yorhel
eb3e6cf929 ManUtils: Fix display of double-formatted characters
Grotty outputs double-formatted characters for some (old) manual pages.
This fix ignores the second part of the double-formatting, thus making
things readable again.
2012-07-11 13:53:35 +02:00
Yorhel
5f87ab9069 Rewrote manfmt to use AnyEvent and moved it to ManUtils 2012-07-11 11:33:12 +02:00
Yorhel
fadb0a1110 s/GrottyParser/ManUtils/g 2012-07-11 11:29:15 +02:00
Yorhel
be675893f3 GrottyParser: Fix MANNEDINCLUDE link when the man name contains a dash 2012-06-18 15:14:55 +02:00
Yorhel
31e0d5ff08 Actually turn .so's into links 2012-06-16 09:27:43 +02:00
Yorhel
c47f450934 Initial commit 2012-06-15 14:23:29 +02:00