Add optional GitHub Markdown styling#121
Open
stephen-clark-bbc wants to merge 10 commits into
Open
Conversation
stephen-clark-bbc
force-pushed
the
SMC/github-markdown-styles-clean
branch
from
July 17, 2026 15:07
7a3457f to
a5da0dd
Compare
stephen-clark-bbc
force-pushed
the
SMC/github-markdown-styles-clean
branch
from
July 17, 2026 15:39
b68a521 to
7a80ed9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds build-time syntax highlighting and improved code-block presentation.
Adds line-level highlighting for standard and language-specific diffs.
Adds an optional GitHub-style presentation mode while preserving Morty Docs’ original styling as the default.
Adds GitHub-style alerts—including icons and background treatments for notes, tips, warnings, cautions, and important content.
Preserves lightweight, browser-rendered Mermaid diagrams in both presentation modes.
See
Diff highlighting
What changed
Adds markdownStyle: 'github' as an opt-in presentation mode.
Preserves the original Morty Docs presentation when the option is omitted or set to original.
Adds syntax highlighting during site generation using Highlight.js.
Provides syntax highlighting in both presentation modes.
Adds line-level highlighting for standard and language-specific diff blocks, such as diff yaml.
Includes support and test coverage for JavaScript, YAML, C#, and other supported languages.
Preserves Mermaid diagram rendering in both presentation modes.
Adds GitHub-style headings, permalinks, alerts, tables, code blocks, and responsive presentation.
Preserves separate paragraphs within Markdown alerts.
Documents the code-wrapping differences between the original and GitHub presentation modes.
Includes the Highlight.js BSD licence in the published npm package.
Preserves intentional dotfiles and dot-directories while excluding .DS_Store metadata.
Usage
transform(inputObjects, {
contentTitle: 'My documentation',
basePath: '/docs',
markdownStyle: 'github'
})
The original presentation remains the default:
transform(inputObjects, {
contentTitle: 'My documentation',
basePath: '/docs',
markdownStyle: 'original'
})
The markdownStyle option can also be omitted.
Local preview
To preview the GitHub-style presentation:
markdownStyle=github npm start
Then open:
http://localhost:8080/morty-docs/some-repo/github-markdown-style.html
To preview the original presentation:
npm start
Then open the same URL.
The local preview downloads a pinned Mermaid browser runtime and verifies its SHA-256 checksum. This asset remains inside
the ignored www directory and is not committed or included in the published package.
Security and reliability
cumulative highlighting limits.
Verification