MMX Documentation

Welcome! This is a sample documentation site built with MMX, a small, file-based documentation generator. The page you are reading lives in index.mmx and the whole site is generated from .mmx files in the pages/ folder.

What you will find here

The sidebar on the left is the table of contents. The pages are grouped by topic:

A short tour of MMX

MMX files are plain text. The first line is the page title (a # h1 heading). Everything else is normal text with a few small additions:

You do not need a build step in your editor. Write the .mmx files, run MMX, and you get a static site of HTML files you can open directly or upload to any web host.

How this site is organised

The structure under 1Example/input/ is:

input/
  config.mcfg        -- title, version, language, sidebar text
  index.mmx          -- the page you are reading
  assets/            -- images, videos, audios and code samples
  pages/             -- all the other pages of the documentation
    Examples/
    Multimedia/
    Tests/

Open any page from the sidebar to see how it is written. The source is the single source of truth -- if you spot a typo or want to expand a page, edit the corresponding .mmx file and regenerate the site.

Describing a folder with indexText.mmx

Every folder under pages/ gets an auto-generated index.html listing its children under an Index heading. To add a short description to that landing page, just drop a file called indexText.mmx inside the folder:

pages/
  Multimedia/
    indexText.mmx   <- folder description (not a real page)
    Audios.mmx
    Videos.mmx
    Images.mmx

Anything you write in indexText.mmx (headings, lists, images, code blocks…) is rendered between the folder name and the auto-generated Index list. The file itself is never listed in the sidebar and does not appear in the search index, so it is safe to use as a pure folder blurb. If you want full control over the landing page, write an index.mmx in the folder instead -- that one is rendered normally and the auto-generator steps aside.
Example of a folder with this

Hiding or showing the auto-generated Index

Sometimes you do not want the auto-generated directory list at all -- for instance, when the indexText.mmx already enumerates every page in the folder with friendly descriptions and a second list would be noise. MMX gives you two layers of control over that list:

1. Project-wide default: noDefaultIndex in config.mcfg

Add this line to 1Example/input/config.mcfg:

noDefaultIndex = true

This is a per-project switch, not a per-folder one, so it is a one-line way to flip the default behaviour for the whole site.

2. Per-folder override in indexText.mmx

The first non-blank line of indexText.mmx may carry a single directive token that overrides the project default for that folder. Two tokens are recognised, case-insensitively:

The directive is consumed by the build (it is stripped from the content before parsing) and never appears in the rendered page, so you can write it on the very first line without polluting the description.

Resolution rules:

| noDefaultIndex (config) | Directive in indexText.mmx | Result |
| --- | --- | --- |
| false (default) | _none_ | Index shown |
| false (default) | #noDefaultIndex | Index hidden |
| true | _none_ | Index hidden |
| true | #defaultIndex | Index shown |

The per-folder directive always wins. When the index is hidden, the folder landing page contains only the folder name (H1) and the description from indexText.mmx -- no <hr> divider, no <h2>Index</h2>, no list.

Example: project hides the index, except where it helps

A typical setup for a small docs site where the landing descriptions already list every page:

# 1Example/input/config.mcfg
noDefaultIndex = true
# 1Example/input/pages/Multimedia/indexText.mmx
#defaultIndex

## About this folder

This folder is a **reference for every kind of media** you can embed in an
MMX page: regular images, inline icons, audio, video, and iframes.

- **Audios** -- the `!!(path/to/audio)` block directive.
- **Videos** -- the `!!!(path/to/video)` block directive.
- **Images** -- the `![](path/to/image)` block directive.
- **Inline images** -- the `<-path->` inline syntax.
- **Iframes** -- the `#iframe(...)` directive.

In this case the project default hides the index in every folder, and the Multimedia folder opts back in because the author wants both the description and the standard list (e.g. to surface newly added media pages that have not been added to the bullet list yet).

Live example of #defaultIndex in action -- the project config currently uses noDefaultIndex = false, so this folder keeps the index even without the directive, but the directive on the first line is what documents the behaviour here.