Skip to content
mathworksPublic

About

MATLAB DocMaker is a tool for generating MATLAB toolbox documentation from Markdown documents and MATLAB scripts

Resources

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Repository files navigation

MATLAB® DocMaker 🐣

MATLAB DocMaker CI

DocMaker is a tool for generating MATLAB toolbox documentation.

With DocMaker, you can:

  • write documentation in Markdown and convert to HTML for viewing in MATLAB
  • run MATLAB code blocks in documents and include textual and graphical output
  • create MATLAB documentation index files from a Markdown table of contents

DocMaker requires MATLAB R2021a or later. Documentation generated by DocMaker can be viewed in much older releases of MATLAB, and offline.

DocMaker's default cmark Markdown converter uses a MEX wrapper around cmark-gfm. It supports GitHub-Flavored Markdown tables, strikethrough, autolinks, and task lists. Emoji shortcodes such as :smile: are expanded using the gemoji database before parsing. Conversion runs locally without network access; shortcodes are left unchanged in code spans and blocks, HTML tags, link destinations, and escaped forms. docconvert, docindex, and DocMakerTask also accept Converter="github" or Converter="gitlab" to use a hosted Markdown API, which sends Markdown to the service and requires network access. GitLab conversion requires a personal access token; see Markdown conversion.

User documentation

DocMaker ships with documentation that you can browse online, including:

Developer documentation

The repository contains a top-level MATLAB project.

Development requires MATLAB R2022b or later for the MATLAB Build Tool, and a MATLAB-supported C compiler for building the MEX. Configure the compiler in MATLAB with mex -setup C.

Tasks are provided to:

  • check: check code issues and project configuration
  • mex: generate cmark-gfm version and emoji sources, then compile the MEX for the current MATLAB platform
  • test: run unit tests
  • doc: generate documentation
  • package: package as a MATLAB Toolbox file (.mltbx)
  • clean: delete derived artifacts

Error identifiers

DocMaker uses these standard docmaker: error and warning identifiers:

  • AlreadyExists
  • InvalidResponse
  • InvalidValue
  • NotFound
  • OperationFailed
  • PermissionDenied
  • Timeout
  • Unavailable
  • UnsupportedOperation
  • UnsupportedValue

Build and test the local converter

The repository pins cmark-gfm and gemoji as Git submodules. Initialize them from the repository root before building:

git submodule update --init --recursive

From the repository root in MATLAB, open the project and build the MEX with:

buildtool mex

The mex task generates build/cmark-gfm/cmark-gfm_version.h and build/cmark-gfm/emoji_map.c, then compiles the cmark-gfm sources directly into tbx/docmaker/+docmaker/cmarkmd2html.<mexext>. A separately installed cmark-gfm library is not required.

Run the full check and test workflow with:

buildtool clean
buildtool test

The test task runs check and mex first. The clean task removes the generated source files and compiled MEX; they are disposable build outputs.

Continuous integration

The docmaker-ci.yml workflow runs test-mini on Ubuntu 24.04 for pull requests not targeting master and pushes to master. Pull requests targeting master run test-full: native MEX tests on Linux, Windows, and both Mac architectures, plus Linux compatibility tests on older MATLAB releases. Intel Mac uses R2025b; the other platforms use the latest MATLAB release. Compatibility jobs select the newest supported Ubuntu LTS per MATLAB release where GitHub-hosted runners are available; R2021a uses Ubuntu 22.04 best-effort because its officially supported Ubuntu 20.04 runner is no longer hosted by GitHub.

Published release tags must match vMAJOR.MINOR.PATCH exactly and point to a commit reachable from master. CI builds and tests the Windows and Mac MEX files, stages them on Linux, builds the toolbox with buildtool('package'), verifies that all four platform MEX files are included, and publishes the MLTBX as a GitHub Release. Manual drafts also support SemVer prerelease and build versions: their tag and title keep the full version, while release notes come from the matching MAJOR.MINOR.PATCH changelog section.

The Actions UI can run docmaker-ci.yml manually in test-mini, test-full, package, or draft mode on a selected ref. draft builds the toolbox and creates a GitHub draft release using the version in tbx/docmaker/Contents.m, without the tag ancestry check or File Exchange publishing. The workflow must first be merged to master to appear in the UI. Manually built toolboxes are uploaded as workflow artifacts. See .github/workflows/docmaker-ci.md for details.

The submodule commits are pinned by the parent repository. When updating a dependency, select an explicit upstream release, rebuild and test, then review the submodule changes. Keep project integration code in src; do not edit files inside ext/cmark-gfm or ext/gemoji.

About

DocMaker is developed by David Sampson and Ken Deeley from MathWorks on GitHub.

DocMaker converts Markdown to HTML using cmark-gfm, gemoji, MathJax, and GitHub Markdown CSS.


©️ MathWorks 2024-2026

About

MATLAB DocMaker is a tool for generating MATLAB toolbox documentation from Markdown documents and MATLAB scripts

Resources

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages