Joas,On 7/20/2105 11:28 AM Joas Yannick wrote: > > > On 7/20/2105 0:50 AM Hans Hagen wrote: > > So how would you like to use lua? Is the data stored in lua? > > Yes, I imagine that the data (for instance, the value of > the keys "number", "name", "abbreviation", "title", etc.) > is stored somewhere when the compilation process reads, say, > "\startbiblebook", and that they are available to define the > the formatting done by "\startbiblebook". > > Thank you.I have found this wiki: http://wiki.contextgarden.net/Commands_with_KeyVal_argumentsBut since I do not know Lua, I would appreciate that someone gets me started with my example.
\starttexdefinition unexpanded startPoemThis type of code can easily be used to deal with the names, numbers, and abbreviations you describe in your requirements.
\begingroup
\dosingleempty\dostartPoem
\stoptexdefinition
\starttexdefinition dostartPoem [#SETUPS]
\getrawparameters[Poem][inset=2em,indent=0em,before=,font=,
language=en,#SETUPS]
\grabbufferdata[Poem][startPoem][stopPoem]
\stoptexdefinition
\starttexdefinition stopPoem
\obeylines
\language[\Poemlanguage]
\Poembefore
\Poemfont
\setupnarrower[left={\dimexpr\Poemindent+\Poeminset\relax},
right=\Poeminset,
before=]
\startnarrower[left,right]
\startparagraph
\setupindenting[-\Poemindent,yes]
\inlinebuffer[Poem]
\stopparagraph
\stopnarrower
\endgroup
\blank[halfline]
\stoptexdefinition