Skip to content

digiopsys/mtx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mtx — monad txt xpansion

One monad, infinite expansion. Readable in source, powerful rendered.

A plain-text expansion syntax. Semicolon trigger. Dot closer. Plain text stays plain. Nothing formats unless you type ; — formatting is opt-in, always.


Why mtx?

The markdown problem

  • _underscores_ trigger italic — breaks variable_names
  • **stars** trigger bold — breaks shell globs
  • # triggers headings — breaks code comments
  • > triggers blockquote — breaks shell redirects
  • --- triggers horizontal rules — breaks visual separators

Markdown hijacks common characters. Your plain text is never safe.

The HTML problem

HTML is powerful but unreadable in source. Open tags, close tags, matching names, entity escaping. Tag soup.

The mtx solution

One trigger character: ; Everything else is plain text. Formatting is opt-in.

;==== PAGE TITLE ;.
;===- section heading ;.

plain text stays plain. single enter = line break.
double enter = new paragraph.

;^ bold ;. and ;% italic ;. and ;` code ;. — all inline.
;- bullet item ;.
;] link text ;. ;} https://example.com ;.

One trigger. 10 closers. Zero ambiguity.


The semcon rule

semcon = semicolon character.

  • One semcon = always an operator trigger (never "just text")
  • Duo semcon = always a literal semicolon in output
  • No third meaning. No exceptions. Every level. Every context.
;          one semcon — operator trigger
;;         duo semcon — literal ; in output

Three levels

Level What Extension Use for
lvl1 Headings only .tx.txt or .txt Notes, plans, config docs
lvl2 Full doc markup .mt.txt Guides, specs, READMEs
lvl3 HTML replacement .ht.txt Web pages, forms, layouts

Levels are usage preferences, not parser restrictions. The parser handles all syntax at every level.

Plain .txt files need a header on line 1: ;#mtx;.;#mn;.


10 closers

Every closer is ; + 1 character. One job each.

Closer Name Closes
;. inline headings, bold, italic, links, items
`; ` block
;" attribute class, id, style, generic attrs
;z raw zone SVG, MathML, passthrough
;x table cell cells opened by ;[
;c contained inner inline (nested formatting)
;v void elements with no content
;b branch parent list with children
;, sequence datapod items, attr values
;> key-value datapod keys, attr keys

The bottom-row keyboard closers: z x c v b — ergonomic and memorable.


Quick comparison

Headings

;==== H1 ;.         mtx — fixed width, deterministic
# H1                markdown — # also means comment in bash/python/yaml
<h1>H1</h1>        html — tag soup

Bold

;^ bold ;.          mtx — explicit trigger + closer
**bold**            markdown — ** also appears in shell globs
<strong>bold</strong>  html — verbose

Lists

Plain text lists already work — single enter = line break:

apples
bananas
cherries

1. first step
2. second step
3. third step

When you want structure (styled bullets, numbered <ol>, nesting), use mtx syntax:

;- item ;.          mtx bullet — ;- is always a bullet
;1. first ;.        mtx numbered — proper <ol>
- item              markdown — - also used in yaml, CLI flags
<li>item</li>       html — needs ul/li wrapping

Links

;] text ;. ;} url ;.        mtx — same ; pattern
[text](url)                  markdown — brackets clash with code syntax
<a href="url">text</a>      html — verbose

lvl3 — HTML replacement

mtx replaces HTML with readable 2-character codes:

;\d.;?:card;"                <div class="card">
  ;\s0;?:label;" name: ;.     <span class="label">name: </span>
  ;\i5;\a:type;>text;" ;v     <input type="text">
;|                           </div>

Every HTML element mapped. Attributes, void elements, containers — all in mtx syntax. Readable rendered AND unrendered.


Engines & tools

Tool What Repo
mtxweb PHP web engine — parse mtx to HTML digiopsys/mtxweb
mtxhill Syntax highlighter (VS Code, micro, vim) Coming soon

Planned transpilers

Source Output Harnesses
.mt.txt .md Doc conversion for markdown tools
.ht.txt .html Full page conversion
.cc.txt .c xmlrpc tag syntax
.jt.txt .js Marko / Svelte tag syntax
.jo.txt .json jq fork
.xm.txt .xml xmlstarlet / minixml fork
.qd.txt Drizzle ORM JavaScript ORM
.qj.txt JOOQ Java query builder
.qe.txt EdgeQL EdgeDB
.qr.txt Redis ORM Redis data store
.qs.txt SQL Generic SQL
.rs.txt Rust markup.rs tag syntax
.go.txt Go html/template
.am.txt Assembly Future
.bs.txt Bash Future
.vl.txt Verilog Future

One syntax. One trigger. Every output format.


Design principles

  • Plain text is default. Formatting is opt-in.
  • ; is the only trigger. No character traps.
  • 10 closers, all ; + 1 char. Zero ambiguity.
  • One escape rule everywhere: ;; = literal ;
  • .txt is the universal extension.
  • lvl2 is a strict subset of lvl3. Zero conversion cost.
  • Readable rendered AND unrendered.
  • .md-inert — mtx inside .md files renders as plain text.

Links


License

MIT

About

MTX monad txt xpansion language syntax, the monad language, the mtx language syntax | readable in source, powerful rendered.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors