doctoc_lang_syntax(n)
π doctoc_lang_syntax(n) β the doctoc language syntax, bestie edition π
okay so you found the manual page called doctoc_lang_syntax(n) and it lives in the Documentation tools section of the manual. she's a whole reference doc, no cap. let's get into it π
β¨ NAME β¨
doctoc_lang_syntax β doctoc language syntax. that's it, that's the name, she's literal π
πΈ DESCRIPTION πΈ
so this document is the formal specification of the syntax of the doctoc markup language, version 1.1, written in Backus-Naur-Form. it's giving reference material, and it's meant to complement the doctoc language command reference β like, they're besties, they hold hands π€
real talk though: if you're a beginner, read the much more informally written doctoc language introduction first before you try to understand either this document or the command reference. this one is highkey not the vibe for a first date, okay? do yourself a favor π«Ά
π¦ FUNDAMENTALS π¦
in the broadest terms possible, the doctoc markup language 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. so it's commands with little text sprinkles, not text with little command sprinkles. noted β¨
each markup command is just a Tcl command surrounded by a matching pair of [ and ]. which commands are available, and their arguments, i.e. syntax β all of that is specified in the doctoc language command reference. not here. go read that one for the deets π
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. lexemes first, then the mixing. order matters bestie π§
π LEXICAL DEFINITIONS π
so in the syntax rules listed in the next section:
<TEXT>stands for all text except markup commands.- Any
XXXstands 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. <WHITE>stands for all text consisting only of spaces, newlines, tabulators and the comment markup command.
π SYNTAX π
the rules listed here specify only the syntax of doctoc documents. the lexical level of the language was covered in the previous section, so don't come for me if you skipped it π
regarding the syntax of the (E)BNF itself
- The construct
{ X }stands for zero or more occurrences ofX. - The construct
[ X ]stands for zero or one occurrence ofX.
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
like, look at her go π that's the whole grammar, and yes she is iconic for it.
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. not me being honest about it but here we are π
please report such in the category doctools of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. please also report any ideas for enhancements you may have for either package and/or documentation. we love ideas, fr fr π
when proposing code changes, please provide unified diffs, 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. do it that way, bestie, it's the move β¨
π SEE ALSO π
doctoc_introdoctoc_lang_cmdrefdoctoc_lang_faqdoctoc_lang_intro
go read these too, they're the friend group πΈ
β KEYWORDS β
doctoc commands, doctoc language, doctoc markup, doctoc syntax, markup, semantic markup
π CATEGORY π
Documentation tools
π COPYRIGHT π
Copyright (c) 2007-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, periodt π this one shipped as part of tcllib, version 1.0, for the manual page doctoc_lang_syntax(n) β mwah, take care of her, she's documentation royalty π«Άβ¨
π¦ where this page comes from
- alpine 3.24: tcl-lib-doc 1.21-r1 Β· BSD-2-Clause
- epel 9: tcllib 1.21-1.el9 Β· BSD
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- opensuse-leap 16.0: tcllib 1.21-bp160.1.2 Β· TCL
- Copyright (c) 2007-2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms