Bug 244894 - Okular should be able to display ditroff output.
Summary: Okular should be able to display ditroff output.
Alias: None
Product: okular
Classification: Applications
Component: New backend wishes (show other bugs)
Version: 0.9.5
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
Depends on:
Reported: 2010-07-16 21:30 UTC by Christopher Yeleighton
Modified: 2011-01-25 20:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Yeleighton 2010-07-16 21:30:55 UTC
Version:           0.9.5 (using KDE 4.3.5) 
OS:                Linux

Manual pages for legacy Unix tools use a special macro language that produces intermediate graphic output called ditroff.  The on-line viewer for such pages, called gxditview, is defective in many ways: it does not support copying and searching text and the viewing commands are unlike in other KDE programs.  It also cannot display localized pages. [1]
The KDE alternative for gxditview is kio_man, a virtual device that allows viewing legacy manual pages as Web pages.  However, there is little chance that it will ever produce acceptable output for all manual pages, especially in view of the fact that such pages can use internal custom macros while the man2html engine behind kio_man can process only predefined macros.  There are pages such as ftp(1) that use predefined macros only but they still display wrong text under kio_man because it does not support all required constructs properly.  Moreover, man2html generates invalid HTML code (Bug 238534) and it seems to be more straightforward to support ditroff than to fix man2html.
Therefore I find it desirable for Okular to support ditroff output where the ditroff device would be a suitable X11 device or a special device for Ocular (which would have to be added to groff, but this can be done administratively without patching groff source).

Reproducible: Always

Steps to Reproduce:
1. groff '-TX100' '-X' '-mandoc' 'groff/src/devices/grolbp/grolbp.n' '-z' >'grolbp.dit'
2. desktop-lanuch 'grolbp.dit'
3. Choose "Okular".

Actual Results:  
2. "Choose program" dialog box.
3. Okular cannot open this file.

Expected Results:  
2. Okular should launch and invoke the ditroff backend to display the manual page.

OS: Linux (x86_64) release
Compiler: gcc

[1] <URL:http://lists.gnu.org/archive/html/bug-groff/2010-06/msg00019.html>
Comment 1 Albert Astals Cid 2010-07-18 23:02:29 UTC
Won't happen anytime soon unless someone from the outside of the Okular teams comes and contributes patches. If you want to do that please contact us before doing any work
Comment 2 Christopher Yeleighton 2010-07-19 08:37:08 UTC
My plan is to grab the view and the model from XDitView, make it l10n-compatible (because it is not), and replace the controller with Okular.
Comment 3 Christopher Yeleighton 2011-01-25 19:05:25 UTC
Blocks bug 238534.
Comment 4 Pino Toscano 2011-01-25 19:14:58 UTC
(In reply to comment #3)
> Blocks bug 238534.

Of course not.
Comment 5 Christopher Yeleighton 2011-01-25 20:32:01 UTC
All right, I thought it was obvious.  Here is my reasoning:

  1. There is no reliable way to get content from a ditroff source without actually processing it with troff.
  2. There is no reliable way to get consistent and valid HTML output from groff.
  3. There is no reliable way to get xditview to display documents in non-Latin scripts.
  4. It is not possible to make groff send PostScript to Okular, and even if it were, this path is probably an overkill.