docidx_lang_syntax(n)
π docidx_lang_syntax β the docidx language syntax, bestie edition π
okay so this is docidx_lang_syntax(n), a manual page from the Documentation tools collection, and it's literally the formal grammar of the docidx markup language. no cap. π
β¨ NAME β¨
docidx_lang_syntax β docidx language syntax
πΈ DESCRIPTION πΈ
okay bestie, listen. this document has the formal specification of the syntax of the docidx markup language, version 1, written out in Backus-Naur-Form. it's giving reference material, not a tutorial β it's meant to sit next to the docidx language command reference and complement it. π«Ά
real talk: if you're a beginner, go read the much more informally written docidx language introduction first, before you try to understand either this document or the command reference. this page is not the vibe check you start with. π
π¦ FUNDAMENTALS π¦
in the broadest terms possible β like, the widest possible lens β the docidx markup language is similar to SGML and languages like it. a document written in this language consists primarily of markup commands, with text embedded into it at some places. that's the whole shape of it. β¨
each markup command is just a Tcl command surrounded by a matching pair of [ and ]. which commands are available, and their arguments (i.e. their syntax), is specified in the docidx language command reference. iykyk. π
so in this document we specify the lexeme first, and then the syntax β i.e. how we can mix text and markup commands with each other. two layers, both iconic. π
π LEXICAL DEFINITIONS π
in the syntax rules listed in the next section:
- [1]
<TEXT>stands for all text except markup commands. - [2] 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. - [3]
<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 docidx documents. the lexical level of the language was covered in the previous section, so don't come for me about it. π
regarding the syntax of the (E)BNF itself:
- [1] The construct
{ X }stands for zero or more occurrences ofX. - [2] The construct
[ X ]stands for zero or one occurrence ofX.
and now, the syntax, in all its glory:
index = defs
INDEX_BEGIN
[ contents ]
INDEX_END
{ <WHITE> }
defs = { INCLUDE | VSET | <WHITE> }
contents = keyword { keyword }
keyword = defs KEY ref { ref }
ref = MANPAGE | URL | defs
at last, a rule we were unable to capture in the EBNF syntax, because it's about the arguments of the markup commands, something which is not modeled here. π
- [1] The arguments of all markup commands have to be plain text, and/or text markup commands, i.e. one of
- [1]
lb, - [2]
rb, or - [3]
vset(1-argument form).
- [1]
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. no cap, it says so right there. 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 want the glow-up. β¨
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. that's the move. π
π SEE ALSO π
docidx_introdocidx_lang_cmdrefdocidx_lang_faqdocidx_lang_intro
π KEYWORDS π
docidx commands, docidx language, docidx markup, docidx syntax, markup, semantic markup
π CATEGORY π
Documentation tools
π COPYRIGHT π
Copyright (c) 2007-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page, bestie, every single rule preserved, nothing skipped, we ate and left no crumbs π«Άβ¨ this was tcllib version 1.0 of docidx_lang_syntax(n) β go forth and parse responsibly π
π¦ 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