doctoc_lang_syntax(3tcl)

πŸŽ€ NAME πŸŽ€

doctoc_lang_syntax β€” the whole entire syntax of the doctoc language, bestie πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this doc is the formal specification of the syntax of the doctoc markup language, version 1.1, written out in Backus-Naur-Form. It's a reference, like, it pairs with the doctoc language command reference, they're besties 🫢.

Fr fr, if you're a beginner? Go read the way more informally written doctoc language introduction first before you try to understand this doc or the command reference. No cap, it'll save you 😭

✨ FUNDAMENTALS ✨

In the broadest terms possible, the doctoc markup language is giving SGML and similar languages, honestly. A document written in this language is primarily markup commands, with text embedded into it at some places. Like text is the guest star, not the main character πŸ‘‘

Every single markup command is literally just a Tcl command surrounded by a matching pair of [ and ]. Which commands you actually have available, and their arguments (aka their syntax), is specified over in the doctoc language command reference. iykyk πŸ“–

So in this doc we specify first the lexeme, and then the syntax β€” meaning how we can mix text and markup commands with each other. Two whole steps, we're being thorough πŸ’…


🌸 LEXICAL DEFINITIONS 🌸

So in the syntax rules listed in the next section:

  1. <TEXT> stands for all text except markup commands. Just vibes, no brackets.
  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 ]. And inside of these delimiters, the usual rules for a Tcl command apply with regard to word quotation, nested commands, continuation lines, etc. So like, the normal Tcl rules, not new ones, periodt.
  3. <WHITE> stands for all text consisting only of spaces, newlines, tabulators, and the comment markup command. Just the invisible girlypops ✨

πŸ”₯ SYNTAX πŸ”₯

The rules listed here specify only the syntax of doctoc documents. The lexical level of the language was already 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 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

😭 BUGS, IDEAS, FEEDBACK 😭

This document, and the package it describes, will undoubtedly contain bugs and other problems. It's giving humble tbh. Please report such in the category doctools of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. And please also report any ideas for enhancements you may have for either the package and/or the documentation β€” we want them, fr fr 🫢

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

Heads up bestie: attachments are strongly preferred over inlined patches. You can make an attachment 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 πŸ‘‘

doctoc_intro, doctoc_lang_cmdref, doctoc_lang_faq, doctoc_lang_intro


⭐ KEYWORDS ⭐

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


🌈 CATEGORY 🌈

Documentation tools


Copyright (c) 2007-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page, bestie ✨ this was doctoc_lang_syntax, section 3tcl, coming to you from tcllib 1.0 β€” slay, ate, no crumbs, periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from