This is a small, statically typed typed document authoring language. Templates are type-checked and translated to a simple functional language, which means that type errors occur on the templates themselves, as opposed to in the generated code, or at runtime.
The language was inspired by Forester and Mylink which use functional languages as a basis for document processing. Another source of inspiration was “A Core Calculus for Documents”, which uses evaluation rules to translate templates into other primitives in the core language, as opposed to elaboration.
The language currently naively concatenates strings together, but it might be a good idea to explore using document trees in the future.
Input document:
${let place := "world"}
Hello ${place}!
Elaborated document:
let place : Text := "world";
"\n\nHello " + place + "!"
Normalised term:
Hello world!
- Initial concrete syntax
- String templates
- Lists and list combinators
- Imports and cross-document references
- Markdown-inspired syntax hooks (headings, links, lists, etc.)
- Labelled function parameters
- Parameterised templates
- Metadata fields (for information like title, author, date, tags)
- Attributed node templates (with namespaced nodes?)
- Improve syntax (perhaps something similar to Scribble?)
- External renderers (KaTeX, Graphvis, Penrose, PlantUML, syntax highlighting, railroad diagrams, reference lists, etc)
- Datalog-style query language
- Back-ends (HTML, Markdown, TeX, RSS)
Papers:
Lightweight markup languages:
- Djot: A simpler alternative to markdown with less ambiguities
- Org Mode: Document editing language for Emacs
- Subtext: Tiny markup language geared towards index-card note-taking
- Cooklang: Recipe markup language
- mexdown: A markdown-like language that allows commands to generate parts of a document
String interpolation:
Programmable markup languages:
- Typst
- Scribble: Racket dialect for creating prose documents
- Pollen (Code): Racket dialect for creating digital books
- Papyri
Template languages:
String/Node/Document Literals:
- JSX
- Hiccup
- Elm HTML
- kotlinx.html
- ScalaTags
- Unison documentation literals
- Javascript template literals
Document DSLs:
- Verso: An Authoring Tool for Lean (Talk)
- Ur/Web
- ASP.NET Razor
- Markdoc: Markdown-based document authoring framework.
- Svelte
Quasiquoting:
Wiki markup and personal knowledge management:
- Forester
- Mylink
- Omake: cardfile format written in XML, presented with an XSL transform
- Org-roam: Emacs-based knowledge management with Org Mode
- Oscean: Wiki engine written entirely in assembler
- yon: Wiki editor in a standalone HTML file with no dependencies
- TiddlyWiki: a non-linear personal web notebook
Attributed node languages:
- Sofu
- SDLang: Simple Declarative Language
- KDL Document Language
- RELAX NG compact syntax
- XDuce (Github mirror)
- svg, idk (Mastodon thread)
Data serialisation languages:
Configuration languages:
Type checking XML Papers: