[NTG-context] Attributes

St├ęphane Goujet stephane.goujet at wanadoo.fr
Sun Apr 20 15:14:59 CEST 2014


Hello,

  I would like to know what is the recommended way to use attributes in
Context.

  I manage to use use them with numbers, i.e. :
in Context : \attribute123=1
in Lua     : has_attribute(my_node, 123)

  But I would like to make that cleaner and use named attributes.
What is the Context way to declare and set attributes? Is it something
like this?
\defineattribute[myattr]
\dosetattribute{myattr}{1}

  And how do I then access them from Lua? Should it look like
has_attribute(mynode, attributes.myattr)
  or
has_attribute(mynode, attributes.xxxxx("myattr"))
  or something else?

Goodbye,
  Stéphane.


More information about the ntg-context mailing list