logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

doctoc_lang_syntax - doctoc language syntax

Bugs, Ideas, Feedback

       This document, and the package it describes, will undoubtedly contain bugs and  other  problems.   Please
       report  such  in  the  category  doctools  of the TcllibTrackers [http://core.tcl.tk/tcllib/reportlist].
       Please also report any ideas for enhancements you may have for either package and/or documentation.

       When proposing code changes, please provide unifieddiffs, i.e the output of diff-u.

       Note further that attachments are strongly preferred over inlined patches. Attachments  can  be  made  by
       going  to the Edit form of the ticket immediately after its creation, and then using the left-most button
       in the secondary navigation bar.

Category

       Documentation tools

Description

       This  document contains the formal specification of the syntax of the doctoc markup language, version 1.1
       in Backus-Naur-Form. This document is intended to be  a  reference,  complementing  the  doctoclanguagecommandreference.  A beginner should read the much more informally written doctoclanguageintroduction
       first before trying to understand either this document or the command reference.

Fundamentals

       In the broadest terms possible the doctocmarkuplanguage is like SGML and similar languages. A  document
       written  in  this  language  consists  primarily  of  markup commands, with text embedded into it at some
       places.

       Each markup command is a just Tcl command surrounded by a matching pair of [ and ].  Which  commands  are
       available, and their arguments, i.e. syntax is specified in the doctoclanguagecommandreference.

       In  this  document  we specify first the lexeme, and then the syntax, i.e. how we can mix text and markup
       commands with each other.

Keywords

       doctoc commands, doctoc language, doctoc markup, doctoc syntax, markup, semantic markup

Lexical Definitions

       In the syntax rules listed in the next section

       [1]    <TEXT> stands for all text except markup commands.

       [2]    Any XXX stands for the markup command [xxx] including its arguments. Each markup command is a  Tcl
              command surrounded by a matching pair of [ and ]. Inside of these delimiters the usual rules for a
              Tcl command apply with regard to word quotation, nested commands, continuation lines, etc.

       [3]    <WHITE> stands for all text consisting only of spaces, newlines, tabulators and the comment markup
              command.

Name

       doctoc_lang_syntax - doctoc language syntax

See Also

       doctoc_intro, doctoc_lang_cmdref, doctoc_lang_faq, doctoc_lang_intro

Syntax

       The  rules listed here specify only the syntax of doctoc documents. The lexical level of the language was
       covered in the previous section.

       Regarding the syntax of the (E)BNF itself

       [1]    The construct { X } stands for zero or more occurrences of X.

       [2]    The construct [ X ] stands for zero or one occurrence of X.

       The syntax:

              toc       = defs
                          TOC_BEGIN
                          contents
                          TOC_END
                          { <WHITE> }

              defs      = { INCLUDE | VSET | <WHITE> }
              contents  = { defs entry } [ defs ]

              entry     = ITEM | division

              division  = DIVISION_START
                          contents
                          DIVISION_END

See Also