STXT

Built for humans. Reliable for machines.

Start the tutorial Open the playground Tools

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, then text, like S-TEXT.

Documents

STXT is a structured, indentation-based text language aimed at:

  • Representing documents and data clearly.
  • Being simple to read and write.
  • Being trivial to parse in any programming language.
  • Allowing both structured content and free text.
  • Applying content rules via @stxt.schema or @stxt.template.

An STXT document combines readability with an explicit semantic structure, which makes it suitable 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. Schemas or templates can also be defined to validate the content of a document.

An Email document from the com.example.docs namespace, together with the template that validates it:

# The document
Email (com.example.docs):
	From: John Smith <[email protected]>
	To: Mery Adams <[email protected]>
	Cc: Keyla Brown <[email protected]>
	Title: Project report
	Body Content >>
		Hello Mery!!
		The book is finished!!

# Its 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): (?)