MarkShup architecture
MarkShup is developed as small POSIX shell and awk source files below src/. The root markshup file is a development shim that runs src/markshup.sh.
Source layout
src/markshup.shinitializes the development executable and loads the command-line interface.src/cli.shparses command-line options and dispatches file and directory conversion.src/download.shprovides shared HTTP download support.src/selfupdate.shdownloads, verifies, extracts, and applies self-updates and self-upgrades.src/mermaid.shdetects Mermaid diagrams and prepares the configured JavaScript helper.src/render.shdiscovers referenced Markdown files, assigns normalized output paths, resolves asset paths, and invokes the Markdown renderer.src/parser.awkparses Markdown and writes HTML.src/default.cssprovides the stylesheet embedded in complete documents unless--no-default-cssis used.
The parser supports headings with generated or explicit identifiers, paragraphs, hard breaks in paragraphs, block quotes, and list items using a trailing backslash or at least two trailing spaces. It supports automatic and reference-style links, images with titles, emphasis, strong emphasis, single- and double-tilde strikethrough, highlighted text, custom subscript and superscript syntax, inline code, fenced and indented code blocks, GitHub-style admonitions, nested ordered and unordered lists, definition lists, task-list markers, and GitHub-style pipe tables with aligned columns. It supports common backslash escapes for Markdown punctuation and reports unclosed fenced code blocks.
See still missing for the missing Markdown features and known compatibility issues.
Future work
- Define customizable navigation.
- Improve the default stylesheet as the renderer gains more Markdown features.