Hi Tommaso,
\startttyping is a generated command (\definetyping[typing]) and to show
the command with \showdefinition you have to use
\showdefinition [starttyping:instance:typing]
or
\showdefinition [starttyping:instance:argument:typing]
A complete list with all arguments can be found in setup-mapping-en.pdf.
The output of \definition is wrong because there is a wrong check for
the number
of arguments for the command (because you can pass a list of commands).
The \showdefinition command needs also a small change because when you
use a instance (e.g. \showdefinition [starttyping:instance:typing]) the
caption
shows the passed argument (e.g. Definition 1 \starttyping:instance:typing)
and not the correct command (e.g. Definition 1 \starttyping).
Wolfgang
Tommaso Gordini schrieb am 25.11.18 um 09:03:
Hi Wolfgang,
thank you very much for your code, which works very well.
I still have a few doubts about one thing: is it possible that the
commands you suggested to me do not work with all ConTeXt commands?
For example, if I write
\usemodule [setups]
\starttext
\showdefinition [starttyping]
\stoptext
I get in the PDF
missing: starttyping
It's correct?
The second question concerns the \definition command.
As you can see in the attached PDF, a «and 1» appears below the
definition. It's correct?
Thank you in advance
Il giorno sab 24 nov 2018 alle ore 12:29 Wolfgang Schuster
<wolfgang.schuster.li...@gmail.com
<mailto:wolfgang.schuster.li...@gmail.com>> ha scritto:
Tommaso Gordini schrieb am 24.11.18 um 11:45:
> Hello, list.
>
> In my ConTeXt guide, I need to show the syntax of ConTeXt commands.
>
> Below I paste a MWE showing the different possible commands, but
I do
> not know if there are others.
> I see, however, that the result is different depending on the
command
> used.
>
> Do you have any advice to give to me? Which of the commands in the
> code should I use in a guide? Or better: do they have to be used
> according to needs?
>
> Are there other commands of this kind?
\usemodule[setups]
\starttext
When you describe a command, e.g.
\type{\startdescription{\cmdbasicsetup[...]} ... \stopdescription}:
\startbuffer [basicsetup]
\cmdbasicsetup [startxtable]
\stopbuffer
\typebuffer [basicsetup]
\getbuffer [basicsetup]
When you show the syntax of a command without the options:
\startbuffer [shortsetup]
\cmdshortsetup [startxtable]
\stopbuffer
\typebuffer [shortsetup]
\getbuffer [shortsetup]
When you show the syntax of a command with the options:
\startbuffer [fullsetup]
\cmdfullsetup [startxtable]
\stopbuffer
\typebuffer [fullsetup]
\getbuffer [fullsetup]
When you want to show the name of a command (similar to \tex{type}):
\startbuffer [internal]
\cmdinternal {startxtable}
\stopbuffer
\typebuffer [internal]
\getbuffer [internal]
When you want to show the syntax of a command as a float:
\startbuffer [showdefinition]
\showdefinition [startxtable]
\stopbuffer
\typebuffer [showdefinition]
\getbuffer [showdefinition]
When you want to refer to the definition:
\startbuffer [definition]
\definition [startxtable]
%\definition [startxtable,startembeddedxtable]
\stopbuffer
\typebuffer [definition]
\getbuffer [definition]
\page
When you have a generated command (e.g. \tex {placefigure}):
\startbuffer [instance]
\cmdbasicsetupinstance {placefloat} {figure}
\cmdshortsetupinstance {placefloat} {figure}
\cmdfullsetupinstance {placefloat} {figure}
\stopbuffer
\typebuffer [instance]
\getbuffer [instance]
\stoptext
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________