Document processing -- modern deroff(1)?

Liste des GroupesRevenir à col misc 
Sujet : Document processing -- modern deroff(1)?
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.os.linux.misc
Date : 15. Aug 2024, 06:30:25
Autres entêtes
Message-ID : <li5i3hFl6f1U1@mid.individual.net>
User-Agent : Pan/0.160 (Toresk; f608461; Linux-6.11.0-rc3)
So I'm (finally) writing a book, and using groff -mom macros
for typesetting.  Wanted to run what I have so far through
style(1) and diction(1), which on Linux requires one to
run the input through deroff(1) first.

Linux doesn't seem to have deroff.

So, here is my q&d solution:

$ cat mini_deroff.pl
#!/usr/bin/perl

%roffchars = ('.',1,' ',1,"\",1);

while(<>)
{
if(/^\.PP/) { print "\n"; }
next if (exists($roffchars{substr($_,0,1)}));
print;
}
exit 0;

Constructive comments appreciated.

BTW, if there's interest in the document processing, I have
a Makefile that eases the pain of processing, including
a "make look" rule that gens the pdf and views it.

Also, if anyone knows where there is source for a working
Linux deroff(1), would very much appreciate the pointer.
So far I found the OpenBSD one, but it seems to rely on
a lot of preprocessor macros that Linux doesn't have.

Finally, one last look on Google, and I found a version
of deroff for Debian... but it seems to be dated 1996, and doesn't
grok -mom macros.  (It is, however, written in lex, which
might be an opportunity for me to learn that lingo and
fix it...)

--
-v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
   OS: Linux 6.11.0-rc3 Release: Mint 21.3 Mem: 258G
   "Cause of crash: Inadvertent contact with the ground."

Date Sujet#  Auteur
15 Aug 24 * Document processing -- modern deroff(1)?8vallor
15 Aug 24 +- Re: Document processing -- modern deroff(1)?1Lawrence D'Oliveiro
15 Aug 24 +* Re: Document processing -- modern deroff(1)?2Nuno Silva
16 Aug 24 i`- Re: Document processing -- modern deroff(1)?1vallor
15 Aug 24 +* Re: Document processing -- modern deroff(1)?2Rich
16 Aug 24 i`- Re: Document processing -- modern deroff(1)?1vallor
15 Aug 24 +- Re: Document processing -- modern deroff(1)?1Carlos E.R.
17 Aug 24 `- Re: Document processing -- modern deroff(1)?1Peter 'Shaggy' Haywood

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal