ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to define complex descriptions?
@ 2001-07-12 20:51 Giuseppe Bilotta
  2001-07-15 22:21 ` Giuseppe Bilotta
  2001-07-18 13:12 ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-07-12 20:51 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to define complex descriptions?
  2001-07-12 20:51 How to define complex descriptions? Giuseppe Bilotta
@ 2001-07-15 22:21 ` Giuseppe Bilotta
  2001-07-16 16:48   ` Re[2]: " Giuseppe Bilotta
  2001-07-18 13:12 ` Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-07-15 22:21 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

Hello people,

I developed a first draft of a small TeX program which will
hopefully become the "complex descriptions" module. It is rather
well document, I believe, and pretty functional. The template idea
is implemented in an extremely costly and inefficient, but
useful, way.

Have fun in testing this code. Of course, the indexing and sorting
part is still not present.

--
Giuseppe "Oblomov" Bilotta

[-- Attachment #2: t-cpldsc.tex.bz2 --]
[-- Type: application/octet-stream, Size: 2592 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[2]: How to define complex descriptions?
  2001-07-15 22:21 ` Giuseppe Bilotta
@ 2001-07-16 16:48   ` Giuseppe Bilotta
  2001-07-17 13:12     ` Re[3]: " Giuseppe Bilotta
  0 siblings, 1 reply; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-07-16 16:48 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

Hello people,

A slightly patched version to accept \long descriptions (aka
descriptions consisting of multiple paragraphs).

--
Giuseppe "Oblomov" Bilotta

[-- Attachment #2: t-cpldsc.tex.bz2 --]
[-- Type: application/octet-stream, Size: 2602 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[3]: How to define complex descriptions?
  2001-07-16 16:48   ` Re[2]: " Giuseppe Bilotta
@ 2001-07-17 13:12     ` Giuseppe Bilotta
  0 siblings, 0 replies; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-07-17 13:12 UTC (permalink / raw)
  Cc: ntg-context

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

Hello people,

the description module has been extended and renamed to "t-xdesc"
(eXtended DESCriptions). A draft of the listing features has been
added.

--
Giuseppe "Oblomov" Bilotta

[-- Attachment #2: t-xdesc.tex.bz2 --]
[-- Type: application/octet-stream, Size: 3053 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to define complex descriptions?
  2001-07-12 20:51 How to define complex descriptions? Giuseppe Bilotta
  2001-07-15 22:21 ` Giuseppe Bilotta
@ 2001-07-18 13:12 ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2001-07-18 13:12 UTC (permalink / raw)
  Cc: ntg-context

At 08:51 PM 7/12/2001 +0000, Giuseppe Bilotta wrote:
>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.

after some searching in my idea-* files, i found something \definesortset 
that can be of help; i have to make it running before i come back to it -)

another entry point can be blocks, where one can also pass parameters

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-07-18 13:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-12 20:51 How to define complex descriptions? Giuseppe Bilotta
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

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).