doctools_lang_syntax(n)
β¨ doctools_lang_syntax β¨
okay bestie, welcome to the doctools language syntax page π
this is a doctools_lang_syntax(n) situation, filed under Documentation tools, and it's literally the whole grammar. grab a snack, we're going full nerd. π
πΈ NAME πΈ
doctools_lang_syntax β the syntax of the doctools language, no cap.
π DESCRIPTION π
This document contains the formal specification of the syntax of the doctools markup language, version 1, written out in Backus-Naur-Form. β¨
It's meant to be a reference, like, it complements the doctools language command reference β it's not the intro, it's the receipts. π
π«Ά bestie pls β if you're a beginner, go read the much more informally written doctools language introduction FIRST, before you even try to understand this document or the command reference. this one is giving "reference shelf", not "tutorial". π
π¦ FUNDAMENTALS π¦
In the broadest terms possible, the doctools markup language is LaTeX-like, instead of like SGML and similar languages. yes, we're that kind of family. π
A document written in this language consists primarily of text, with markup commands embedded into it. that's the whole vibe.
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 doctools language command reference. iykyk.
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. π§
β LEXICAL DEFINITIONS β
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 doctools documents. The lexical level of the language was covered in the previous section. π
π 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 construct
LIST_BEGIN<X>stands for the markup commandlist_beginwithXas its type argument.
π The syntax π
okay here it is, the main character. exact, untouched, periodt:
manpage = defs
MANPAGE_BEGIN
header
DESCRIPTION
body
MANPAGE_END
{ <WHITE> }
defs = { INCLUDE | VSET | <WHITE> }
header = { TITLEDESC | MODDESC | COPYRIGHT | REQUIRE | defs | xref }
xref = KEYWORDS | SEE_ALSO | CATEGORY
body = paras { SECTION sbody }
sbody = paras { SUBSECTION ssbody }
ssbody = paras
paras = tblock { (PARA | NL) tblock }
tblock = { <TEXT> | defs | markup | xref | an_example | a_list }
markup = ARG | CLASS | CMD | CONST | EMPH | FILE
| FUN | LB | METHOD | NAMESPACE | OPT | OPTION
| PACKAGE | RB | SECTREF | STRONG | SYSCMD | TERM
| TYPE | URI | USAGE | VAR | WIDGET
example = EXAMPLE
| EXAMPLE_BEGIN extext EXAMPLE_END
extext = { <TEXT> | defs | markup }
a_list = LIST_BEGIN<arguments> argd_list LIST_END
| LIST_BEGIN<commands> cmdd_list LIST_END
| LIST_BEGIN<definitions> def_list LIST_END
| LIST_BEGIN<enumerated> enum_list LIST_END
| LIST_BEGIN<itemized> item_list LIST_END
| LIST_BEGIN<options> optd_list LIST_END
| LIST_BEGIN<tkoptions> tkoptd_list LIST_END
argd_list = [ <WHITE> ] { ARG_DEF paras }
cmdd_list = [ <WHITE> ] { CMD_DEF paras }
def_list = [ <WHITE> ] { (DEF|CALL) paras }
enum_list = [ <WHITE> ] { ENUM paras }
item_list = [ <WHITE> ] { ITEM paras }
optd_list = [ <WHITE> ] { OPT_DEF paras }
tkoptd_list = [ <WHITE> ] { TKOPTION_DEF paras }
ate. no crumbs. β¨
π BUGS, IDEAS, FEEDBACK π
ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. it's giving "software". π
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 the package and/or the documentation. we love a glow-up suggestion. π
When proposing code changes, please provide unified diffs, i.e the output of diff -u. π₯
π also note: 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 way.
π SEE ALSO π
doctools_introdoctools_lang_cmdrefdoctools_lang_faqdoctools_lang_intro
β KEYWORDS β
doctools commands, doctools language, doctools markup, doctools syntax, markup, semantic markup
π CATEGORY π
Documentation tools
π COPYRIGHT π
Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page bestie, we did it π
β¨ this was brought to you by tcllib, version 1.0, and the doctools_lang_syntax(n) manual page β go forth and mark up your docs, you gorgeous genius π«Άπ
π¦ 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 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