groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Newbie help for documenting code snippets


From: Jorgen Grahn
Subject: Re: [Groff] Newbie help for documenting code snippets
Date: Wed, 12 Jan 2005 21:53:33 +0100
User-agent: Mutt/1.4.2.1i

On Wed Jan 12 06:23:10 2005, address@hidden wrote:
> Hi all,
> 
> I would like to generate documentation for some C code, along the lines of 
> Richard Steven's books.
> 
> He usually has a numbered block of code demarcated by two lines.
> Following this is a para with the relevent line numbers set off in the left 
> margin.

I couldn't see vgrind(1) mentioned elsewhere in the thread, so I'll mention
it here.  It supports including code snippets in the main troff source,
between .vS and .vE.
See the man page at e.g. http://www.hmug.org/man/1/vgrind.html.

Did Stevens use it? No idea. The man page above doesn't mention line
numbering.

(By the way: after reading Bjarne Stroustrup's "The C++ Programming
Language", I have difficulties reading the Courier-style code snippets that
Stevens used and many authors use today. Stroustrup uses a mix of Times,
Times Italic and Times Bold Italic throughout that book, and the result is
surprisingly readable and pretty (for the mostly very short examples in that
book).  I'm almost sure he has his own little troff preprocessor which does
that for him ...)

/Jorgen

-- 
  // Jörgen Grahn       "Koka lopplummer, bada Ross, loppor borta."
\X/ <address@hidden>                                   -- Jonas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]