Commit 7cc1e8d3 authored by Antoine Beaupré's avatar Antoine Beaupré

switch to mandoc renderer after tests

parent ce841965
......@@ -326,6 +326,12 @@ class MandocRenderer(CommandRenderer, ManpageRenderer):
.. todo:: this assumes cross-references are done with the ``.Xr``
macro, which is unfortunately not often the case in my
tests. so some manual cross-ref will be required here.
.. todo:: croaks on the ``kodi(1)`` manpage, a weird redirect,
which we should handle manually here. the fix, according
to ``mandoc(1)`` is to chdir to the correct relative
directory. looking at ``zshall(1)``, ``.so`` looks like
an "include" directive.
'''
command = 'mandoc -T html -Ofragment,man=../man%%S/%%N.%%S.html %(source)s'
......@@ -373,7 +379,7 @@ class Man2htmlRenderer(CommandRenderer, ManpageRenderer):
#: quick switch to toggle default manpage rendering implementation
DefaultManpageRenderer = W3mRenderer
DefaultManpageRenderer = MandocRenderer
def find_files(directory, patterns):
......
......@@ -115,9 +115,26 @@ Here is how the actual output compares:
``man2html`` was originally chosen because it is the fastest, includes
an index and is not too opiniated about how the output is
formatted. Unfortunately, it would fail to parse a lot of manpages,
like the ones from the ``gnutls`` project. ``w3m`` was used as a
fallback, even though it actually calls ``man`` itself to do part of
the rendering.
like the ones from the ``gnutls`` project.
Then ``w3m`` was used as a fallback, even though it actually calls
``man`` itself to do part of the rendering. It required a bunch of
hacks to fix the markup.
So then the ``mandoc`` package was used, and it was significantly
faster. In the test corpos (452 manpages), mandoc would render all
pages in 23 seconds, while w3m would render them in twice that
time.
Time for w3m::
77.29user 13.02system 1:26.04elapsed 104%CPU (0avgtext+0avgdata 63800maxresident)k
Time for mandoc::
15.70user 4.75system 0:26.40elapsed 77%CPU (0avgtext+0avgdata 55992maxresident)k
So about five times faster.
Index
~~~~~
......
......@@ -50,7 +50,6 @@ Nice to have
Those are not really necessary but could improve the service.
- switch to mandoc renderer, it's faster and cleaner
- unify site and render? a .mdwn file is like a .1.gz file, basically,
except it's not extracted from a .deb
- 100% test coverage (about 80% now), `edit cii
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment