delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/27/05:45:32

From: Cherniavsky Beni <cben AT crosswinds DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Announce: troff emulator in sed (was ANNOUNCE: DJGPP port of Groff 1.16 uploaded)
Date: Tue, 27 Jun 2000 12:33:31 +0200
Organization: Technion
Lines: 36
Message-ID: <395882FB.6E9BCED1@crosswinds.net>
References: <200006251527 DOT LAA08082 AT delorie DOT com>
NNTP-Posting-Host: 132.68.54.8
Mime-Version: 1.0
X-Mailer: Mozilla 4.06 [en] (WinNT; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> Groff is a document-formatting and typesetting package.  It belongs to an
> older generation of word-processing software that is not WYSIWYG;
> instead, you edit the document source with a text editor, intersperse the
> text with special directives that specify fonts and formatting
> parameters, and then submit the source to a batch processor which produces
> a ready-to-print or ready-to-read document.  troff, a program that is
> standard on Unix, is used, even today, to write manual pages (those *.1
> files you find in the man subdirectory of the DJGPP installation tree),
> but it can also be used for writing very large and complex documents.
> (Another, more modern program from the family of batch word-processors is
> TeX.)

I was once (when my interent access was spare) left with some man pages
(of RCS - the version I downloaded didn't include preformatted versions) and
no ?roff anywhere around my computer.  The sources were not too friendly too
read but I had "that book" on unix explaining ?roff basics and listing its
standard library macros.  So I sat down and worte a monsterous `sed' script that
proccessed them into readable text.  I added some bells-and-whisteles:
extracting the macro definistion in the source to another sed script,
highlighting things with ^H (use `less' to view) and stiffing dummy characters
between non-highlighted chars, running `fold' to fill paragraphs and removing
that dummy chars.  It's 5 or 6 sed scripts together and a batch file to run it.

If anybody is interested in it, for curiosity or because he doesn't want to
download groff (the later is not a recommended reason; it outputs only text and
not always good) reply and i'll post the scripts or put them on a web page and
post a pointer.

Only mess-dos could have inspired such a dirty hack.  Have a nice hacking,
people.
-- 
Beni Cherniavsky <cben AT crosswinds DOT net>
                 (also scben AT t2 in technion)
The world is the greatest of all hacks.  Admire its bulletproofness - 
only one reboot was ever done, even it was a soft (wet) one!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019