Literate Programming with Embedded Snapshots (wip experiment)
  • OCaml 94.1%
  • Shell 2.8%
  • Text 2.4%
  • Dune 0.5%
  • Makefile 0.2%
Find a file
2026-09-08 12:31:06 +02:00
.github Upgrade CI 2026-09-08 12:31:06 +02:00
.vscode Spell entries 2026-04-09 15:15:03 +02:00
actions Add SPDX license headers to install scripts 2026-04-09 11:36:21 +02:00
doc Modernize blog to match crs/dunolint (author byline, card-style list) 2026-08-18 22:13:08 +02:00
src Add stdlib list util 2026-04-09 15:15:18 +02:00
test Tweak title case 2026-05-10 13:43:43 +02:00
third-party-license Add third-party licenses for zola and zolanight 2026-04-09 11:34:10 +02:00
.gitattributes Initial import 2026-03-14 19:54:04 +01:00
.gitignore Ignore local coverage tool for now 2026-04-02 14:40:26 +02:00
.headache.config Initial import 2026-03-14 19:54:04 +01:00
.ocamlformat Upgrade ocamlformat to 0.29.0 2026-03-24 09:10:09 +01:00
CHANGES.md Prepare changelog 2026-08-14 13:59:44 +02:00
CODE_OF_CONDUCT.md Adopt OCaml Code Of Conduct 2026-03-15 09:52:50 +01:00
CODEOWNERS Initial import 2026-03-14 19:54:04 +01:00
COPYING Initial import 2026-03-14 19:54:04 +01:00
COPYING.HEADER Use SPDX-FileCopyrightText in headers 2026-03-17 15:58:50 +01:00
COPYING.LESSER Initial import 2026-03-14 19:54:04 +01:00
COPYING.LINKING Initial import 2026-03-14 19:54:04 +01:00
dune Initial import 2026-03-14 19:54:04 +01:00
dune-project Add more dependency to dev pkg 2026-08-14 14:37:35 +02:00
dune-workspace.5.3 Upgrade CIs 2026-04-12 14:07:12 +02:00
dune-workspace.5.4 Upgrade CIs 2026-04-12 14:07:12 +02:00
dune-workspace.5.5 Upgrade CI 2026-09-08 12:31:06 +02:00
dunolint Import work in progress doc and examples 2026-03-15 08:25:09 +01:00
headache.sh Remove left-over unused var (shellcheck) 2026-03-17 12:09:02 +01:00
Makefile Set up zola documentation site with diataxis framework 2026-04-09 11:28:57 +02:00
mdexp-dev.opam Add more dependency to dev pkg 2026-08-14 14:37:35 +02:00
mdexp-tests.opam Simplify toplevel test infrastructure using Unix stdlib and env:[] 2026-04-02 15:57:47 +02:00
mdexp.opam Bump and require pplumbing 0.0.17 2026-04-02 15:10:31 +02:00
NOTICE.md Initial import 2026-03-14 19:54:04 +01:00
README.md Add mention of diataxis (readme and doc site) 2026-04-09 17:49:00 +02:00
REVIEW.md Fix some typos 2026-05-18 16:47:06 +02:00

mdexp

Introduction

Welcome to mdexp, a literate programming tool to assist in maintaining documentation files where part of the content is generated and checked during compilation via embedded snapshots.

Current State

🚧 This project is currently under construction and is very experimental and unstable. It is not documented and has some significant limitations and issues at the moment. Come back in a little while!

Acknowledgements

mdexp is rooted in the tradition of literate programming, where documentation and executable code coexist in a single source.

Documentation framework

The documentation for this project is organized following the Diátaxis framework by Daniele Procida.

Expect-test frameworks

The expect-test paradigm — where expected output is captured inline and updated via snapshot — is central to mdexp's design. We are grateful to the following projects:

  • Cram by Brodie Rao -- literate style of interleaving commands and expected output
  • ppx_expect by Jane Street -- inline expect-test framework and snapshot paradigm for OCaml
  • Windtrap by Thibaut Mattio -- testing library for OCaml with support for embedded snapshots

We also studied some snapshot-testing frameworks in other languages while designing mdexp's parser, in particular insta and expect-test in Rust, and snaptest by TigerBeetle and Oh Snap! in Zig.

We also acknowledge the following projects that share the goal of mixing prose with executable code and verified output. We list them here without attempting a detailed comparison.

  • mlt_parser by Jane Street -- parses .mlt files that interleave org-mode markup, OCaml toplevel sessions, and expect-test output.
  • mdx (ocaml-mdx) -- a widely used tool in the OCaml ecosystem for executing code blocks in markdown and validating their output, including code snippets embedded in odoc documentation (mli and mld files).
  • Jupyter -- widely used notebook environment for interactive computing across many languages, combining documentation with executable code cells and inline output. See also ocaml-jupyter for an OCaml kernel.
  • mdBook -- Rust's book-authoring tool, with built-in support for testing Rust code samples and integration with the Rust Playground for browser-executable examples.
  • zig-doctest by Loris Cro -- a tool for testing code snippets embedded in Zig documentation and books, with support for expected-failure scenarios.