ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <bourbaki@bigfoot.com>
Subject: How to define complex descriptions?
Date: Thu, 12 Jul 2001 22:51:37 +0200	[thread overview]
Message-ID: <10334485803.20010712225137@bigfoot.com> (raw)

Well, I have this enhancements request, and it's about
descriptions. Precisely, I am thinking of descriptions with
attributes. It should then be possible to list the descriptions by
attribute. An example will probably show what I mean.

For those in Role-Playing Game the best examples are "spells".
When describing a spell, you will need:

Spell name, Class, Level, Sphere,
Range, Components, Duration, Casting Time
Area, Save, Description

It should then be possible to say
=====================
\definecomplexdescription[spell][spells]%
                         [class,level,sphere,range,comp,duration,time,area,save]

\spell[detectmagic][class=Cleric,level=1,sphere=Divination,range=Touch,
       comp={V,S},duration={1 round/level},time={1 round},
       area={1 creature},save=None]{Detect magic}

       Description of this spell, and all the info we want to put
       here, just like a standard description.
=====================

and there should be a way to set up the way this is typeset. We
could even have it with long and short descriptions ({Detect
magic}{short, one par desc}{long, multipar desc}), and the reuse
them ... ?

Typesetting could be defined through templates:
=====================
\startspelltemplate[longspell]
{\bf <name>} ({\it <sphere>})
{\bf Class:} <class>
{\bf Level:} <level>
{\bf Sphere:} <sphere>
{\bf Range:} <range>
{\bf Components:} <comp>
{\bf Duration:} <duration>
{\bf Casting Time:} <time>
{\bf Area Affected:} <area>
{\bf Save:} <save>

\begingroup
<longdesc>
\endgroup
\stopspelltemplate

\usespelltemplate[longspell]

\usespell[detectmagic] % or any other
                       % appropriate name
                       % for the command
=====================

Note how a similar approach (template) could be used, e.g., for
epigraphs. Don't know yet how to insert conditional printout (that
is, what to do when one attribute is not defined). Maybe pictures
and all the stuff that may be accessible through external
databases could/should make use of the same code?

It should also be possible to say

\completelistofspells[criterium=bylevel]

or

\completelistofspells[criterium={byclass,bylevel}]

and have appropriate lists be automatically created (with setups to
specify how much information should be put in the lists).

Is this possible (yet)? Is it feasible? Ideas? Comments?

Shall I work on it? Do you think it will be hard to implement?

Side question: is it possible to have XML and TeX intermixed?
(precisely, XML parts in a TeX file)

--
Giuseppe "Oblomov" Bilotta


             reply	other threads:[~2001-07-12 20:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-12 20:51 Giuseppe Bilotta [this message]
2001-07-15 22:21 ` Giuseppe Bilotta
2001-07-16 16:48   ` Re[2]: " Giuseppe Bilotta
2001-07-17 13:12     ` Re[3]: " Giuseppe Bilotta
2001-07-18 13:12 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10334485803.20010712225137@bigfoot.com \
    --to=bourbaki@bigfoot.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).