docbook / docbook

The DocBook schemas
78 stars 23 forks source link

Have a typedefsynopsis? #109

Closed dourouc05 closed 5 years ago

dourouc05 commented 5 years ago

In the same vein as #107 and #108, I propose a way to represent C and C++ typedefs, i.e. a shortcut for a long type name that is supposed to be used in user code instead of the long name (inline: <typedefname>; synopsis: <typedefsynopsis>).

    ## First the inline elements. 
    db.programming.inlines |= qdt.typedefname

    qdt.typedefname.role.attribute = attribute role { text }
    qdt.typedefname.attlist =
       qdt.typedefname.role.attribute?
       & db.common.attributes
       & db.common.linking.attributes
    qdt.typedefname = element typedefname { qdt.typedefname.attlist, db._text }

    ## Then the synopsis.
    db.synopsis.blocks |= qdt.typedefsynopsis

    qdt.typedefsynopsis.attlist = 
       db.common.attributes
       & db.common.linking.attributes
       & db.language.attribute?
    qdt.typedefsynopsis = 
      element typedefsynopsis {
        qdt.typedefsynopsis.attlist, 
        qdt.typedefname, 
        db.programming.inlines*
      }
dourouc05 commented 5 years ago

Once more, as per https://lists.oasis-open.org/archives/docbook-tc/201810/msg00010.html.

shudson310 commented 5 years ago

Superceded by #111