Michael Lazzaro:
# On Monday, November 11, 2002, at 05:08  AM, Angel Faus wrote:
# >> I very much dislike XML for writing.  It'd be nice to use some kind
# > I agree with you. XML is very unpleasant to write.
# 
# I certainly agree with that, but I was thinking of something 
# very basic 
# -- just enough to get it into a database, for example.  You'd 
# just copy 
# a standard template and fill in the fields.  Like perhaps:
# 
# <section>
# <id> 1.1.2.1 </id>
# <title> Numeric Context </title>
# <text>
# Numeric Context is a <glossary>context</> full of cheesy 
# goodness.  For 
# example, the following code will put <code>$obj</> in <code>int</> 
# context:
# <code>
#      my int $i = $obj;
#   </code>
# .... blah blah blah ...
# </text>
# <see>
#      <also> Context </also>
#      <also> Numeric Values </also>
# </see>
# <tests>
#      ...
# </tests>
# </section>

What's wrong with this?

=section 1.1.2.1 Numeric Context

Numeric Context is a context full of cheesy goodness.  For example, the 
following code will put C<$obj> in C<int> context:

        my int $i = $obj;

....blah blah blah...

=seealso Context

=seealso Numeric Values

=tests

....

That's 14 lines to XML's 23 (XML is nearly twice as many lines!), and
the POD is much less cluttered.

You're probably looking at that and wondering, "what about the
glossary?"  Well, cross-referencing glossary entries is just this in
Perl 6:

        $text =~ s:each / (%glossary_entries) /<a
href="glossary.html#%glossary_entries{$1}">$1</a>/;

Where %glossary_entries's values are a unique entry ID of some sort.
And if that's not easy enough for you, you can always add a G<word>
construct, or even use L<Glossary/word>.

--Brent Dax <[EMAIL PROTECTED]>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

Wire telegraph is a kind of a very, very long cat. You pull his tail in
New York and his head is meowing in Los Angeles. And radio operates
exactly the same way. The only difference is that there is no cat.
    --Albert Einstein (explaining radio)

Reply via email to