comp.lang.ada
 help / color / mirror / Atom feed
From: Nick Roberts <nick.roberts@acm.org>
Subject: Re: Literate Programming in Ada, AdaDoc, AdaBrowse
Date: Mon, 11 Oct 2004 21:28:05 +0100
Date: 2004-10-11T21:28:05+01:00	[thread overview]
Message-ID: <2t08mmF1p0n19U1@uni-berlin.de> (raw)
In-Reply-To: <2sqmccF1oit5sU1@uni-berlin.de>

Nick Roberts wrote:

> Time for the latest hairbrained scheme from your uncle Nicky.
> ...

Thanks to everyone for your replies.

I still feel that AdaDoc, AdaBrowse, and other suggested solutions don't
quite do what I personally want. Maybe it's a bit 'horses for courses'.

Anyway, I think I'm going to experiment with a program that, in effect,
regenerates the web files from the source files. Except that I'll use
normal Texinfo files for the 'web' files (with the addition of a few
special macros).

In the source files, each fragment will start with a comment that
contains its title between two special symbols. The symbols will be a
pair of =####= for a top-level fragment, a pair of =###= for the next
level down, and so on. Within the Texinfo files, I'll use the @lpfrag
macro, followed the fragment's name, to insert the actual text of a
fragment (with sub-fragments reduced to references).

This way, source files can be amended and recompiled without making
something else invalid, and the Texinfo files (having been processed
by my program) can be processed in the normal way to produce HTML or
other formats.

A source file will look like this:

~~~

=####= Overall program =####=
   =###= Mix the ingredients =###=
   ... mix
   =###= Bake them in oven =###=
      =##= Open oven door =##=
      ... open
      =##= Put things in oven =##=
      ... put in

~~~

The original Texinfo file might look like this:

~~~

Opening the oven door is easy, all you have to do is...

@lpfrag Open oven door

Mixing ingredients is tricky if you don't use the ...

@lpfrag Mix the ingredients

Putting things into the oven requires gloves ...

@lpfrag Put things in oven

Baking things in an oven takes steps, first ...

@lpfrag Bake them in oven

Making a cake ...

@lpfrag Overall program

~~~

Which would be expanded into (something like) the following:

~~~

Opening the oven door is easy, all you have to do is...

@verbatim Open oven door
... open
@end verbatim

Mixing ingredients is tricky if you don't use the ...

@verbatim Mix the ingredients
... mix
@end verbatim

Putting things into the oven requires gloves ...

@verbatim Put things in oven
... put in
@end verbatim

Baking things in an oven takes steps, first ...

@verbatim Bake them in oven
@lpref Open oven door
@lpref Put things in oven
@end verbatim

Making a cake ...

@verbatim Overall program
@lpref Mix the ingredients
@lpref Bake them in oven
@end verbatim

~~~

Anyway, I'll experiment with this a bit. To be honest, I suspect it
would be easier to write my processing program in a langauge such as
Python or Perl. Any recommendations? (Gawk?)

I do think that the documentation produced by this technique would
be supplemented, perhaps very usefully, by the output of AdaDoc or
AdaBrowse.

-- 
Nick Roberts



  parent reply	other threads:[~2004-10-11 20:28 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-09 17:44 Literate Programming in Ada, AdaDoc, AdaBrowse Nick Roberts
2004-10-09 18:39 ` Wes Groleau
2004-10-09 21:04   ` Nick Roberts
2004-10-09 21:39     ` stephane richard
2004-10-09 23:40     ` Wes Groleau
2004-10-10 16:39     ` Simon Wright
2004-10-12  0:42       ` Georg Bauhaus
2004-10-11  7:33     ` Ole-Hjalmar Kristensen
2004-10-09 19:21 ` Pascal Obry
2004-10-09 21:47   ` Nick Roberts
2004-10-09 23:20     ` Björn Persson
2004-10-10  8:28       ` Oliver Kellogg
2004-10-10 10:03         ` Björn Persson
2004-10-10 15:27           ` Stephen Leake
2004-10-09 23:49     ` Wes Groleau
2004-10-10 10:36     ` Pascal Obry
2004-10-10 11:26       ` Marius Amado Alves
2004-10-18  8:17         ` Jacob Sparre Andersen
2004-10-18 11:15           ` Marius Amado Alves
2004-10-18 12:46             ` Björn Persson
2004-10-18 15:39               ` Marius Amado Alves
2004-10-18 13:47             ` Jacob Sparre Andersen
2004-10-09 22:54 ` Lionel Draghi
2004-10-09 22:56 ` Björn Persson
2004-10-09 23:55   ` Wes Groleau
2004-10-10  1:02     ` Björn Persson
2004-10-10 14:02       ` Wes Groleau
2004-10-10  3:29 ` Steve
2004-10-10 14:08   ` Wes Groleau
2004-10-10 15:06     ` Steve
2004-10-10 15:20   ` Stephen Leake
     [not found]   ` <rlsfz4jdjuj.fsf@jacob.crs4.it>
2004-10-15 13:33     ` Marius Amado Alves
2004-10-16  1:50     ` Steve
2004-10-16 19:46       ` Jacob Sparre Andersen
2004-10-17  3:46         ` Steve
2004-10-10  8:21 ` Stephane Riviere
2004-10-11 23:02   ` Björn Persson
2004-10-11 23:31     ` Missing features in NaturalAdaBrowseDoc Lionel Draghi
2004-10-12  0:14       ` tmoran
2004-10-12 12:58       ` Marc A. Criley
2004-10-12 21:20         ` Lionel Draghi
2004-10-12 17:49       ` Stephane Riviere
     [not found]         ` <416c48a7$0$28918$636a15ce@news.free.fr>
2004-10-12 21:18           ` Lionel Draghi
2004-10-13 16:38           ` Stephane Riviere
2004-10-14 19:56             ` Lionel Draghi
2004-10-15 16:59               ` Stephane Riviere
2004-10-12 17:29     ` Literate Programming in Ada, AdaDoc, AdaBrowse Stephane Riviere
2004-10-10  9:34 ` Andre
2004-10-10 15:24   ` Stephen Leake
2004-10-10 18:04     ` Andre
2004-10-11 23:32     ` Lionel Draghi
2004-10-12  0:13       ` Björn Persson
2004-10-10 15:13 ` Stephen Leake
2004-10-11 20:28 ` Nick Roberts [this message]
2004-10-11 22:26   ` Björn Persson
2004-10-12 14:09     ` Nick Roberts
2004-10-13  5:01       ` Pylinius
2004-10-13 16:06         ` Nick Roberts
2004-10-13 17:17     ` Pascal Obry
2004-10-17 18:47   ` Bernhard Mulder
2004-10-18 18:06     ` Nick Roberts
2004-10-19  4:41       ` Bernhard Mulder
2004-10-19  9:52         ` Peter Hermann
2004-10-19 10:01         ` Nick Roberts
2004-10-23 21:39           ` Bernhard Mulder
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox