Skip to content
Li Yinan edited this page Apr 18, 2015 · 8 revisions

Welcome to the cxxredoc wiki!

Syntax

All marks are presented by '[' and ']' pairs.

Tag Categories

There are Three categories of tags:

  • Structure Defines the structure of a project.
  • Block Defines textual semantics, like paragraph, lists, tables, etc. Blocks like code define their own rule of content semantics.
  • Phrase Defines text phrases, like emphasis, inline code, reference, etc.
  • Anchor Make no appearance, but place information according to its position. E.g. index entries.

Tag Format

Explicit Tag

[tagname:type@argument#id content]
  • tagname is the name of the markup
  • type is the usage of the tag, each tag has a list of available types. if type is omitted, a default type is implied.
  • argument is the optional argument for the tag's semantic, e.g., index name of the index tag. if argument is omitted, a tag may use a default value, or calculate a value from its context. argument can be multiple.
  • id the identifier for the instance of tagname.
  • content the tag's content. Each tag define what kind of content is allowed for it.

Language Tag

[:lang-id]
  • lang-id is language code like en, zh_CN, etc.

Brief Tag

[@content]
  • @ denotes a single non-letter character defined to be a brief char for an tag.

Tag List

Structure Tags

  • section
  • type: chapter, normal, def
  • content: phrase, as title
  • id: mandatory, as xref name
  • include

Anchor Tags

  • comment - /
  • :lang-id
  • Automatically groups up with different lang-id.
  • argument: ~ for continued sentence.
  • index - %
  • type: anchor, begin, end
  • id: mandatory for ranged index
  • argument: choose index name
  • content: phrase as index word, sub, see, seealso, sortas
  • sub - !
  • content: phrase as index word, sub, sortas
  • see, seealso
  • content: phrase as index word, sub
  • sortas
  • content: phrase

Block Tags

Paragraph

  • para
  • type: normal, continue, item, altcount
  • block content: phrase
  • para finishes automatically when a new block level starts
  • continue paragraphs are inserted when phrase content appear outside para

Code Block

  • codeblock
  • type: sample, synopsis, declaration, end
  • argument: syntax highlighting arguments
  • block content until codeblock:end: parsed as source, comments are handled normally
  • content: special
  • special
  • type: emphasis
  • content: text, which will be rendered specially within code
  • shadowrow - |
  • Declare the row of comment is for multi-language shadowing.
  • The line should contain only comment line.
  • |:lang Behave as a :lang in every other means.

Lists

  • list
  • type: ul, ol
  • block content until list:end: item, block tags
  • footnote
  • type: altcount
  • block content until footnote:end

Grammar

  • syntax
  • type: grammar, explanation
  • block content until syntax:end: rule, nonterminal, terminal
  • rule
  • type: alternatives, oneof
  • block content until rule:end: alternate, terminal
  • content:
  • alternate - |
  • type: expression, descriptive
  • content: phrase tags for descriptive type
  • nonterminal - ~, terminal - `
  • type: normal, opt

Table

  • table
  • type: listing, grid
  • content: phrase as label text, columns, column, border
  • id: reference
  • block content until table:end: cell, group
  • columns, column
  • border
  • cell - |
  • group - -

Figure

  • figure
  • type: graphviz
  • content: phrase as label text
  • id: reference
  • block content until figure:end: content parsed and translated by renderer.

Phrase Tags

  • enter, exit
  • type: example, note
  • ref - #
  • id: the id of the referent section.
  • grammar - ~
  • content: text of grammar non-terminal name.
  • cite
  • content: phrase of document cite name.
  • quote - "
  • content: quoted phrase
  • eval - =
  • content: entity name or expression
  • var - $
  • content: text as variable expression
  • em
  • type: text, gram, code, term, var
  • content: text phrase to be emphasized
  • def
  • content: text phrase as defined, index for definition
  • term - +
  • content: text phrase as term
  • superscript - ^, subscript - _

Summary of Brief Tags

  • / - comment
  • % - index
  • ! - sub, for index related
  • | - alternate, for syntax related
  • | - shadowrow, for codeblock comment
  • | - cell, for table
  • ~ - nonterminal, for syntax related
  • ~ - grammar, phrase
  • ` - code, phrase
  • ` - terminal, for syntax related
  • " - quote
  • = - eval
  • $ - var
  • # - ref
  • + - term
  • - - group
  • ^ - superscript
  • _ - subscript