On Mon, 18 May 2020, Aditya Mahajan wrote:

On Mon, 18 May 2020, Hans Hagen wrote:

On 5/18/2020 9:09 AM, Aditya Mahajan wrote:
Hi,

What is needed to enable export of user defined macros? Consider the following example:

What am I missing in order to pass user-defined macros to the exporter?
you're probably missing documentation + a high level define command

This registers (extra) elements:

\setelementbackendtag[mycommand]
\setelementnature    [mycommand][mixed]


Thanks! This also helped me find the documentation in hybrid.pdf.

How do I pass options so that the export is

<mycommand name=whatever>...</mycommand>

(or some variant of that). I thought that

\startelement[mycommand][name=whatever]

should work (there are some such examples in the texmf tree), but it does not.

```
\setelementbackendtag[mycommand]
\setelementnature    [mycommand][mixed]

\setupbackend[export=xml, level=0]

\starttext
\startsection[title={Sample document}]
  \startparagraph
    This is a paragraph
  \stopparagraph
  \startelement[mycommand][name=whatever]
    This is mycommand
  \stopelement
\stopsection
\stoptext
```

Using `\dostarttagged{mycommand}{whatever}` does export as `<mycommand 
detail="whatever">`, and looking at the code, I don't see why `\startelement` 
should behave differently.

Thanks,
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to