In my opinion LaTeX (or plain TeX) will suit your requirements quite
well.  It is mostly suited for producing high quality printed
documentation, but can also converted into HTML, using latex2html or
hevea.

>>>>> "Shlomi" == Shlomi Fish <[EMAIL PROTECTED]> writes:

    Shlomi> I am thinking about writing an online book called
    Shlomi> "Learning how to program in perl" which will teach those
    Shlomi> who don't know programming how to program in perl.

Well, perl is certainly not the language of my choice, but if you like 
it, go ahead.

    Shlomi> While the final book will be in HTML, I'd like to have the
    Shlomi> following requirements for the format I'll use to write
    Shlomi> it:

    Shlomi> 1. The source for every chapter should be in a separate
    Shlomi> file. (to fasten the time it takes to render it onto HTML
    Shlomi> for checking).

This is OK with TeX - you can include as many files as you want.

    Shlomi> 2. There should be logical styles like "<NOTE> ... </NOTE>" "<CODE> ...
    Shlomi> </CODE>". HTML, for example, is not good enough for being the source for
    Shlomi> this document because if I would like to change the format of all the
    Shlomi> notes, I'll have to change the HTML code in every place there is one.

LaTeX environments are the answer here.  You can change their
properties in one place and see the changes everywhere.

    Shlomi> 3. Numbering of Chapters, Sections and sub-sections; notes, assignments,
    Shlomi> exercises, etc. Also, the ability to give an ID to a closure and then
    Shlomi> reference it from the outside based on its ID.

Autonumbering and references are the basic functionality of TeX.

    Shlomi> 4. The ability to place text in several files from one source file. For
    Shlomi> instance if I have the following meta-code:
    Shlomi> <exercise>
    Shlomi> <text>
    Shlomi> Write a program that prints all the numbers between 1 and 100, that do are
    Shlomi> not equally divided by 3.
    Shlomi> </text>
    Shlomi> <solution>
    Shlomi> <pre>
    Shlomi> for($a=1;$a<=100;$a++)
    Shlomi> {
    Shlomi>     if ($a % 3 != 0)
    Shlomi>     {
    Shlomi>             print $a, "\n";
    Shlomi>     }
    Shlomi> }
    Shlomi> </pre>
    Shlomi> </solution>
    Shlomi> </exercise>

    Shlomi> Then I'd like what between the "<text> ... </text>" tags to appear in the
    Shlomi> text of the chapter, while the solution in a separate solutions file.
    Shlomi> (with a link to it from the text).

I'm not sure about how to do this (maybe I do not understand you
clearly), but maybe HyperTeX (or whatever it is called) can help you
here.

    Shlomi> The closest thing I now of for this kind of thing is SGML, but I don't
    Shlomi> know if it is flexible enough for my needs. Do you know if there's a DTD
    Shlomi> available for such purposes. I don't know how to write SGML DTD's on my
    Shlomi> own.

SGML is certainly very flexible, but I don't know whether it has been
used for the purposes close to yours.  TeX, on the other side, has
been used for decades for different teaching stuff, including most
mathematics books you've ever seen and also (surprise!) the famous
"Introduction to Algorithms" by Cormen and Co.

    Shlomi> Another option I can think about is writing my own generator in perl while
    Shlomi> using XML::Parser. The problem is that it is quite a lot of coding.

    Shlomi> Do you know if there's any solution that fits the needs I
    Shlomi> described above?

As another option you may consider Lout.  Unfortunately, I don't know
a thing about it.

Regards,
Andre

-- 
================================================================
#                       Andre E. Bar'yudin                     #
#           Home page: http://www.cs.huji.ac.il/~baryudin      #
#                  E-mail: [EMAIL PROTECTED]             #
#                      Phone: (972)-53-812-026                 #
================================================================


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to