STXT: Introduction
STXT is a Human-First language, where documents
are readable and expressive,
and at the same time reliable for machines.
STXT is pronounced "ESS-text" — first the letter
S, thentext, like S-TEXT.
Documents
STXT is a hierarchical and semantic textual format aimed at:
- Representing documents and data clearly.
- Being extremely simple to read and write.
- Being trivial to parse in any language.
- Allowing both structured content and free text.
- Applying content rules via
@stxt.schemaor@stxt.template.
An STXT document balances human clarity with an explicit semantic structure, ideal for documents, wikis, and configurations:
# A simple email, no validation
Email:
From: John Smith
To: Mery Adams
Cc: Keyla Brown
Title: Project report
# The body is a literal text block
Body Content >>
Hello Mery!
The book is finished!
Documents with namespace and schemas
STXT allows the use of namespaces to group documents. In addition, schemas or templates can also be defined to validate the content of a document.
An Email document from the com.example.docs namespace:
Email (com.example.docs):
From: John Smith
To: Mery Adams
Cc: Keyla Brown
Title: Project report
Body Content >>
Hello Mery!!
The book is finished!!
And the template definition:
Template (@stxt.template): com.example.docs
Structure >>
Email (com.example.docs):
From: EMAIL
To: EMAIL
Cc: EMAIL
Bcc: EMAIL
Title: (?)
Body Content: (1) TEXT
Metadata (org.example.meta): (?)