docidx_lang_syntax(3tcl)

✨ docidx_lang_syntax β€” the docidx language syntax, but make it make sense ✨

okay bestie, so this is the docidx_lang_syntax page from the 3tcl manual, part of the Documentation tools crew πŸ’–. It's the formal one. The specification one. And yes, she's a lot, but I got you.


🌸 NAME 🌸

docidx_lang_syntax β€” the docidx language syntax. that's it, that's the name, she's simple like that πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So this document right here contains the formal specification of the syntax of the docidx markup language, version 1, written in Backus-Naur-Form. It's a reference, okay? It's the reference that complements the docidx language command reference.

bestie if you're a beginner, do NOT start here. like, genuinely. go read the much more informally written docidx language introduction first, and only then come back and try to understand either this document or the command reference. trust me on this one πŸ™ˆ

πŸŽ€ FUNDAMENTALS πŸŽ€

In the broadest terms possible, the docidx 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. yes, text is the garnish, the markup is the meal, periodt.

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), is specified in the docidx language command reference.

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. vibe check first, structure second πŸ’œ


🌈 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.

πŸ’« SYNTAX πŸ’«

The rules listed here specify only the syntax of docidx documents. The lexical level of the language was covered in the previous section. (as in, the last section. the one right up there. you got this ✨)

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:

index     = defs
            INDEX_BEGIN
            [ contents ]
            INDEX_END
            { <WHITE> }

defs      = { INCLUDE | VSET | <WHITE> }
contents  = keyword { keyword }

keyword   = defs KEY ref { ref }
ref       = MANPAGE | URL | defs

And 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. she's too powerful for the grammar, iconic honestly πŸ‘‘

  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).

πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

This document, and the package it describes, will undoubtedly contain bugs and other problems. not me being self-aware 😭 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 want them 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. (iykyk πŸ’…)

πŸ‘‘ SEE ALSO πŸ‘‘

  • docidx_intro
  • docidx_lang_cmdref
  • docidx_lang_faq
  • docidx_lang_intro

πŸ“ KEYWORDS πŸ“

docidx commands, docidx language, docidx markup, docidx syntax, markup, semantic markup


🌸 CATEGORY 🌸

Documentation tools


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


okay that's the whole page bestie, every flag, every rule, every bracket, nothing skipped πŸ’– This was tcllib version 1.0, docidx_lang_syntax(3tcl), and honestly? she ate. go forth and write valid docidx, you absolute main character 🌟

πŸ“¦ where this page comes from