Idris Samawi Hamid ادريس سماوي حامد
17. Mai 2017 um 16:04
On Wed, 17 May 2017 07:25:41 -0600, Hans Hagen <pragma@wxs.nl> wrote:

cd:instances

While we wait for support cd:instances: How about this heuristic to
distinguish abstract commands from pre-supported instances:

=======
If slanted and containing and containing *no* capital letters, treat as
an instance.
=======

(slanted is not part of the coding, instances is)

Sure, but we have to distinguish abstract commands from pre-supported instances of abstract commands, both of which are typeset as slanted.

So we need a simple name for the genus that encompasses both abstract commands and pre-supported instances of abstract commands.

Perhaps 'generic'. All commands typeset as slanted in setup-en etc. are generic commands. So to rephrase

=======
If a command is generic and contains *no* capital letters, treat as a concrete instance.
=======

So whatever hook marks off a command to be treated as slanted is what marks it as a generic command.

Below this is the entry for \section in my own version of the setups files. All commands with instances
have the attribute variant="instance" and the predefined instances are listed under cd:instances.

Commands which are slanted in the manual are produced by a \defineXXX command which
is documented with the generated="yes" attribute. For your list you can ignore the values
under cd:sequence and use only the listed instances.

    <cd:command name="section" generated="yes" variant="instance" file="strc-sec.mkiv">
        <cd:sequence>
            <cd:instance value="section"/>
        </cd:sequence>
        <cd:arguments>
            <cd:resolve name="keyword-reference-list-optional"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
        <cd:instances>
            <cd:constant value="part"/>
            <cd:constant value="chapter"/>
            <cd:constant value="section"/>
            <cd:constant value="subsection"/>
            <cd:constant value="subsubsection"/>
            <cd:constant value="subsubsubsection"/>
            <cd:constant value="subsubsubsubsection"/>
            <cd:constant value="title"/>
            <cd:constant value="subject"/>
            <cd:constant value="subsubject"/>
            <cd:constant value="subsubsubject"/>
            <cd:constant value="subsubsubsubject"/>
            <cd:constant value="subsubsubsubsubject"/>
        </cd:instances>
    </cd:command>

Wolfgang