Markdown Renderer for GitHub

ཞིབ་བརྗོད།

Markdown Renderer for GitHub brings GitHub-quality content rendering to WordPress. Paste GitHub Flavored Markdown (GFM) – code blocks, tables, task lists, and diagrams – and it renders just like it does on GitHub.com, with no manual HTML and no copy-paste screenshots. Built for technical bloggers, documentation teams, educators, and anyone publishing code-heavy content.

Write blog posts and documentation in Markdown with automatic code highlighting for every fenced code block – READMEs, tutorials, and changelogs render beautifully as-is.

Key Features:

🎨 Beautiful Syntax Highlighting
* Powered by Shiki – the same syntax highlighter used by VS Code
* Native grammars for 30+ programming languages, with alias and approximate-grammar fallbacks for many more
* Two carefully tuned themes – GitHub Light and GitHub Dark – with automatic light/dark switching
* Automatic language detection

📊 Mermaid Diagram Support
* 9 diagram types: flowcharts, sequence, class, state, Gantt, user journey, Git graph, ER, and pie charts
* Professional diagram rendering
* Interactive zoom functionality
* Error handling with user-friendly messages

📈 Chart.js Chart Support
* Create line, bar, pie, doughnut, and more chart types
* 8 chart types including scatter, bubble, radar, and Polar Area
* Simple JSON configuration in “`chart fenced code blocks
* Responsive and interactive charts

🌱 PlantUML Diagram Support (optional, opt-in)
* UML and more from “`plantuml fenced code blocks
* PlantUML has no in-browser renderer, so diagrams are produced by an external PlantUML/Kroki server
* Ships ready to configure, but no content is sent off-site until you set a server URL and accept the privacy notice in the settings (see the Third Party Services section)

GitHub Flavored Markdown
* Tables, task lists, strikethrough
* Automatic URL linking
* Footnotes support
* 100% compatible with GitHub markdown

📋 Copy Button Feature
* One-click code copying
* GitHub-style user experience
* Full accessibility support
* Mobile-friendly design

Performance Optimized
* Asset lazy loading – libraries load only on pages that use them
* Minimal performance impact
* Self-contained – no external CDN required
* Optimized for WordPress

🌍 Developer Friendly
* Clean, semantic HTML output
* Extensive hooks and filters
* Translation ready (i18n)
* WordPress coding standards

Perfect for:
* Technical blogs and tutorials
* Documentation websites
* Code portfolios
* Educational content
* API documentation
* Developer resources

Technical Requirements

  • WordPress 6.8 or higher
  • PHP 8.2 or higher
  • Modern browser with JavaScript enabled
  • Recommended: 128MB+ PHP memory limit
  • Recommended: gzip or Brotli compression enabled for static JavaScript on your web server

Why server compression matters:
The syntax-highlighting and diagram libraries are large when uncompressed (Shiki ~2.35 MB, Mermaid ~3.2 MB) but shrink dramatically when delivered with gzip or Brotli (Shiki ~302 KB, Mermaid ~908 KB). For the best front-end performance, ensure your web server compresses static JavaScript (for example mod_deflate/mod_brotli on Apache, or the gzip/brotli directives on nginx). Most managed hosts and CDNs enable this by default. The plugin adds a Tools → Site Health check that reports whether these bundles are actually being served compressed.

Support

For support, please visit the WordPress.org support forum for this plugin. Our team actively monitors and responds to support requests.

Before posting a support request:
* Check the FAQ section above for common questions
* Ensure you’re using the latest version of the plugin
* Include your WordPress and PHP versions in your support request

Feature Requests:
We welcome feature suggestions! Please post them in the support forum with detailed descriptions of your use case.

Source Code

This plugin uses build tools for development efficiency.

Compressed File Source Code:
* build/index.js: WordPress Block Editor integration code
* Source: blocks/markdown/src/ folder
* Build: npm run build
* assets/libs/shiki/shiki.min.js: Shiki syntax highlighter (self-contained bundle, no CDN)
* Source: scripts/vendor/shiki-entry.mjs
* Build: npm run vendor:shiki

Source Code Access:
* GitHub Repository: https://github.com/my-biz-dev/markdown-renderer-for-github
* License: GPL v2 or later
* Development Branch: main

Build Instructions:
1. Install Node.js 22 LTS (see .nvmrc)
2. Install dependencies with npm install
3. Build with npm run build
4. Run tests with npm run test

Developer Resources:
* Development Environment Setup: See CLAUDE.md and docs/DEVELOPMENT.md
* Contributing: See CONTRIBUTING.md
* Build Process Details: See BUILD.md

Third Party Services

By default this plugin runs entirely on your own server. The core rendering libraries are bundled locally and make no external requests:

  • Shiki syntax highlighter – served from your WordPress installation (no CDN)
  • Mermaid diagram renderer – served from your WordPress installation (no CDN)
  • Chart.js chart renderer – served from your WordPress installation (no CDN)
  • markdown-it parser – bundled locally

Optional features that contact an external server (opt-in, off by default):

Two features can send diagram source to an external rendering server. Both are inactive until you explicitly enable, configure a server URL, and accept the in-plugin privacy notice:

  • PlantUML diagrams – PlantUML has no in-browser renderer, so the source of each “`plantuml block is sent to a PlantUML/Kroki server to produce the image.
    • Default server (configurable, or self-hostable): https://www.plantuml.com/plantuml
    • Service: PlantUML – https://plantuml.com/
  • Server-side Mermaid rendering (Kroki) – an optional mode that pre-renders Mermaid diagrams on a Kroki server for faster first paint. When enabled, the Mermaid source is sent to the configured server.
    • Default server (configurable, or self-hostable): https://kroki.io
    • Service: Kroki – https://kroki.io/

To keep diagram source private you can point either feature at a server you self-host. When both options are left in their default (disabled) state, no diagram data or any other content leaves your site.

Privacy & Security Benefits (default configuration):
* No tracking, analytics, or data collection
* No data is transmitted to external servers unless you opt in to PlantUML or server-side Mermaid rendering
* Works offline and in closed networks with the default settings

Privacy

This plugin does not collect any personal data, and with the default settings all processing happens locally on your server. If you opt in to PlantUML or server-side (Kroki) Mermaid rendering, the source text of those diagrams is sent to the rendering server you configure – choose a server you trust, or self-host one, for sensitive content.

Credits

Developer Information

This section provides essential information for developers who want to extend or customize the plugin.

For complete API documentation, architecture diagrams, and customization examples, see:
Developer Documentation on GitHub

Available Hooks and Filters

Actions:

  • gfmr_metadata_saved – Fired when code block metadata is saved
    • Parameters: $post_id (int), $metadata (array)
    • Use case: Sync metadata with external services, logging

Filters:

  • gfmr_metadata_get_metadata – Filter retrieved metadata before use

    • Parameters: $metadata (array), $post_id (int)
    • Use case: Custom language detection, metadata modification
  • gfmr_schema_data – Filter Schema.org JSON-LD data before output

    • Parameters: $schema (array), $post (WP_Post)
    • Use case: Add custom schema properties, author profiles

PHP Constants

  • GFMR_PLUGIN_FILE – Plugin main file path
  • GFMR_SLUG – Plugin slug (‘markdown-renderer-for-github’)
  • GFMR_URI – Plugin URL
  • GFMR_PATH – Plugin directory path
  • GFMR_PLUGIN_PATH – Plugin directory name (relative)
  • GFMR_PLUGIN_BASENAME – Plugin basename
  • GFMR_ASSETS_PATH – Assets directory URL

JavaScript Global Objects

  • wpGfmConfig – Plugin configuration object
  • wpGfmRenderer – Core rendering API (processCodeBlocks, renderContent, initialize)
  • wpGfmHighlighter – Highlighter wrapper instance
  • wpGfmShikiHighlighter – Actual Shiki highlighter instance
  • wpGfmUnifiedHighlight(code, lang, options) – Unified highlight function
  • wpGfmSwitchTheme(newTheme) – Theme switching function (‘light’, ‘dark’, ‘system’)
  • wpGfmRenderDiagram(content, element, options) – Diagram rendering function

Settings Option

Option name: gfmr_theme_settings

Available keys:

  • theme – Theme setting (‘light’, ‘dark’, ‘system’)
  • schema_enabled – Enable Schema.org JSON-LD output (bool)
  • schema_auto_detect_type – Auto-detect article type (bool)
  • schema_include_author – Include author in schema (bool)
  • schema_include_publisher – Include publisher in schema (bool)

Plugin Development

This plugin follows WordPress coding standards and provides clean, semantic HTML output.

Detailed Documentation:

For complete documentation including full API reference with code examples, architecture diagrams (Mermaid), step-by-step customization guides, and CSS class reference, visit:

GitHub Developer Documentation

གཏུབ་རེིས།

Blocks

This plugin provides 1 block.

  • Markdown Write in GitHub Flavored Markdown with real-time preview.

སྒྲིག་འཇུག

  1. Upload the plugin files to the /wp-content/plugins/markdown-renderer-for-github directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress.
  3. Start using the Markdown block in the Gutenberg editor, or wrap your content with [gfm-renderer] shortcode.

FAQ

What is GitHub Flavored Markdown?

GitHub Flavored Markdown (GFM) is an extension of standard Markdown that includes features like tables, task lists, syntax highlighting, and automatic URL linking. It’s the same format used on GitHub.com.

Which programming languages are supported for syntax highlighting?

The plugin ships native Shiki grammars for 30+ programming languages, including JavaScript, TypeScript, Python, PHP, Java, C, C++, C#, HTML, CSS, SQL, Go, Rust, and Ruby. Languages without a bundled grammar fall back to a close match, so many more are still highlighted. The highlighting is powered by Shiki, the same engine used by VS Code.

Can I create diagrams with this plugin?

Yes! You can create beautiful diagrams using Mermaid syntax. Nine diagram types are supported:
* Flowcharts
* Sequence diagrams
* Class diagrams
* State diagrams
* Gantt charts
* User journey diagrams
* Git graphs
* Entity relationship (ER) diagrams
* Pie charts

Can I create charts with this plugin?

Yes! You can create interactive charts using Chart.js with simple JSON configuration. Supported chart types
include:
* Line and Bar charts
* Pie and Doughnut charts
* Scatter, Bubble, Radar, and Polar Area charts

Simply use a “`chart fenced code block with your chart configuration in JSON format.

Can I render PlantUML diagrams, and does that send my content anywhere?

Yes. “`plantuml blocks are supported, but unlike Mermaid and Chart.js, PlantUML has no in-browser renderer. To draw a PlantUML diagram its source is sent to an external PlantUML/Kroki server (the default is the public https://www.plantuml.com/plantuml endpoint, and you can point it at a self-hosted server instead). This is opt-in: nothing is sent until you enable PlantUML, set a server URL, and accept the privacy notice in the settings. See the Third Party Services section for details.

Does this plugin send my content to any external service?

By default, no. Shiki, Mermaid, and Chart.js are bundled locally and run entirely on your server with no network requests. Two optional features are the exception and are off until you opt in: PlantUML rendering and server-side (Kroki) Mermaid rendering. Both send diagram source to a rendering server only after you enable and configure them. See the Third Party Services section.

Does the plugin use a CDN or work offline?

It does not use a CDN. All rendering libraries (Shiki, Mermaid, Chart.js) ship inside the plugin and are served from your own WordPress installation, so the plugin works offline and in closed or air-gapped networks. This also makes it GDPR-friendly by default. The only network traffic comes from the optional PlantUML and server-side Mermaid (Kroki) features, which stay off until you enable them.

Is the plugin mobile-friendly?

Absolutely! All features including syntax highlighting, diagrams, and the copy button work perfectly on mobile devices.

Does this affect my site’s performance?

GitHub Flavored Markdown Renderer is designed for minimal performance impact with smart asset lazy loading: the highlighting and diagram libraries load only on pages that actually use them. The libraries are large uncompressed (Shiki ~2.35 MB, Mermaid ~3.2 MB) but shrink to roughly 302 KB and 908 KB over gzip or Brotli, and the plugin adds a Site Health check that confirms your server is compressing them.

What’s the difference between the free and Pro versions?

Every rendering feature described above – GitHub Flavored Markdown, Shiki syntax highlighting, Mermaid diagrams, Chart.js charts, and PlantUML – is included in this free plugin. You do not need Pro to use any of them. The separate Pro add-on is a standalone plugin that builds on the same core and adds developer conveniences: line numbers for code blocks, advanced syntax-highlighting options, custom Shiki themes, and priority support.

Can I customize the appearance?

Yes, the plugin provides CSS variables and hooks for customization. You can easily match your theme’s design.

Is it translation ready?

Yes, the plugin is fully internationalized and translation ready. Japanese translation is included.

How do I add Markdown content?

You can use the dedicated “Markdown” block in the Gutenberg editor, or wrap your content with the [gfm-renderer] shortcode in classic editor.

Can I write blog posts in Markdown with this plugin?

Yes. Add the Markdown block to any post or page and write GitHub Flavored Markdown directly in the editor, with a live preview of the rendered result. Existing Markdown files – READMEs, docs, changelogs – can be pasted in as-is.

Does it highlight code blocks automatically?

Yes. Fenced code blocks get automatic code highlighting out of the box. Name a language for its exact grammar, or let automatic language detection pick one. Highlighting runs entirely on your own site – no external highlighter service is involved.

Do I need coding knowledge to use this plugin?

Not at all! The plugin works with standard Markdown syntax that’s easy to learn. The Gutenberg block provides a user-friendly interface with live preview.

Will this work with my theme?

Yes, GitHub Flavored Markdown Renderer is designed to work with any properly coded WordPress theme. The styling is designed to integrate seamlessly with your site’s design.

གདེང་འཇོག

There are no reviews for this plugin.

བྱས་རྗེས་འཇོག་མཁན། & གསར་འབྱེད་པ།

“Markdown Renderer for GitHub” is open source software. The following people have contributed to this plugin.

བྱས་རྗེས་འཇོག་མཁན།

དག་བཅོས་ཉིན་ཐོ།

2.9.2

  • add WordPress Playground Live Preview blueprint
  • improve readme discoverability and add settings review footer
  • Add per-language featured images for built-in multilingual mode
  • Add release smoke gate manifest and CI locale parity
  • Add Settings action link to plugin row
  • give deploy-svn.sh standalone defaults for slug/SVN vars
  • remove test-environment artifacts from wp.org screenshots
  • preserve GFM task list checkboxes through SSR/baked sanitization

2.9.1

  • add multilingual taxonomy assignments
  • keep WordPress.org readme tabs fresh and fix version cache-busting
  • isolate readiness tests from config.sh env leak (README_FILE)

2.9.0

  • add i18n .mo auto-recompile hooks and wporg/i18n audit agents
  • add WP-cross-version smoke and timing history median
  • add diff coverage and security severity gate quality gates
  • add interactive chart controls
  • add approximate grammar fallbacks for unbundled languages
  • add markdown image drop uploads
  • reveal frontend content on render pipeline failure
  • stabilise diagram-layout tests against font-metrics flake
  • use foreignObject bounds for diagram label alignment tests
  • optimize PR lint and dependency caches
  • exclude .security-allowlist.json from wp.org dist
  • reveal Mermaid SSR cache-warmed diagrams
  • wire roadmap status update into release
  • repair version-check tooling and sync composer.json version
  • unify nav waitForURL/waitForNavigation timeout to 60s
  • retry WP login in global-setup to absorb startup flakiness
  • clean up release lock via EXIT trap on early abort

2.8.1

  • improve inline code contrast and stabilize tests
  • align diagram rendering layouts
  • repair mermaid state diagram styles
  • preserve mermaid flowchart polygon transforms
  • preserve mermaid flowchart path transforms
  • keep wide mermaid diagrams readable
  • fit wide mermaid diagrams to container
  • center chart preview images
  • update mermaid server privacy gate live

2.8.0

  • live Mermaid bg color and concurrent chart rendering
  • Add cross-session diagram cache with localStorage persistence
  • Add SVN trunk cleanup script for stray readiness-results
  • scan clean dist in plugin-check instead of dev tree
  • Add shared concurrent-load guard for editor diagram libraries
  • add non-interactive mode and reduce log noise
  • Add bounded render cache helper and skip rendered Mermaid blocks
  • Show friendly notice for PlantUML suppressed diagrams
  • Add server-side Mermaid rendering via Kroki
  • add configurable PlantUML server URL
  • send a sync trigger to wakalab-site on release
  • Add per-language SEO meta description feature
  • Add interactive diagram toolbar with expand and collapse
  • add clipboard image paste with media upload
  • adaptive debounce + PlantUML completeness guard
  • skip redundant builds and vendor reinstalls
  • render baked Mermaid diagrams and code blocks in prerendered content
  • resolve stale roadmap-update.yml reference in integrated-release STEP 3.4

2.7.17

  • scope and time-box Plugin Check to prevent release hang
  • isolate E2E compose project to stop release/CI smoke collision

2.7.16

  • harden release smoke against transient nav timeouts

2.7.15

  • add WordPress.org submission readiness check suite
  • automate nightly plugin-check parallel diff (Phase 6-A)
  • Reserve placeholder space to reduce CLS/FOUC
  • load frontend styles non-render-blocking with critical CSS
  • Exclude heavy diagram pages from prerender (WP7.0 spike)
  • load Shiki grammars on demand per page languages
  • add Site Health check for diagram bundle compression
  • add Service Worker for long-term vendor caching
  • extend diagram cache TTL to 30 days with version-keyed invalidation
  • bake Chart.js into cached WebP/PNG images on render
  • bake editor-rendered diagrams to skip frontend JS
  • skip Mermaid renderer when diagrams are fully baked
  • bake SVGs into eviction-proof post meta
  • Offload Shiki highlighting to Web Worker
  • Memoize editor Mermaid/Chart renders with source-keyed cache
  • defer frontend scripts and schedule non-blocking init
  • Lazy-load Shiki and Mermaid bundles on demand
  • Chunk initial block rendering to reduce INP
  • run setup-php release jobs on ubuntu-latest (fix native runner sudo loop)
  • make wporg readiness tests resilient to missing jq/msgfmt
  • check license.txt with correct lowercase name
  • avoid set -e abort on (( count++ )) in cleanup_old_reports
  • replace bash 4 mapfile in cache-cleanup PR job
  • allow anonymous Mermaid SVG cache warming
  • add bounded schema-aware cache keys
  • make plugin check gate executable
  • restrict baked data: URIs to base64 raster images
  • harden baked data: URI handling against entity-encoded bypass
  • Route worker init failure to main-thread highlighter
  • Prevent readiness script abort from grep|head SIGPIPE under pipefail
  • Treat undeterminable readiness values as warn, not false fail