SCOPE-5: reStructuredText Processor^

reporter:

kennethpjdyer

created:

2026-10-21

initiative:

INIT-1: Standard Parser

Summary^

Implement a reStructuredText processor based on the atTree reStructuredText parser functions. The goal is to ingest an .rst file and put out an .atdoc binary.

Motivation^

Autotelic Toolworks treats reStructuredText as the primary language for most projects. As such, we need a system that translates an .rst file to a binary document ready for downstream consumers.

Targets^

Goals^

  • Parse reStructuredText from file to a document structure

  • Convert document structure to JSON for printing and later caching

  • Function to build a manifest of source files and their cache targets.

  • Function to handle special directives:

    • include should register the target as a dependency and provide functions to process and add content.

    • code-block should send back to atTree to handle syntax highlighting and raise an error if the language is unsupported

    • replace should register a file-local replacement register.

  • Functions to handle verification:

    • Check substitution nodes for unmatched keys.

Non-Goals^

  • At this stage, all other directives should follow the default tree-sitter behavior.

  • Robust command-line parsing remains unsupported at this stage.

User Experience^

End User^

The end user will not directly interact with atDoc or atRst. At best, these tools are meant to use in troubleshooting issues as they arise in later development.

The atrst tool allows you to parse a reStructuredText file and view the at_document_t output as JSON.

The atdoc tool may not do anything at this stage, though eventually it should provide diagnostics on cached JSON files.

Downstream Libraries^

Downstream libraries should interact with the atRst library through an atrst_parse function that takes an atread_file_t and returns an at_document_t.

Downstream libraries should interact with atDoc through the data structures it implements and the public functions it provides to interact with these structures.

Dependency^

This project depends on reStructuredText parsing support in atTree.

Issues^

SCOPE-4: FATALF Fixes SCOPE-6: Normalize JSON Output