Skip to content

Technical Specifications - Markdown Renderer for GitHub

Detailed technical information and version specifications for the Markdown Renderer for GitHub plugin.

Core Information

ItemSpecification
Current Version2.7.0
LicenseGPL-2.0-or-later
PHP Requirement8.1 or higher
WordPress Requirement6.0 or higher
JavaScript EngineModern ES Modules + Web Workers

Technology Stack

The plugin is built with a hybrid architecture combining robust PHP backend processing with a dynamic JavaScript frontend, enhanced with server-side rendering and background thread support.

Backend (PHP)

  • Controller: GFMR_Renderer (Singleton)
  • Asset Management: GFMR_Asset_Manager with smart feature detection
  • Metadata: Custom post meta (_gfmr_code_metadata) for optimized rendering
  • Cache: WordPress Transient API for performance
  • SSR Engine: PHP-based server-side rendering pipeline for code blocks and Mermaid diagrams

Frontend (JavaScript)

  • Core Engine: gfmr-core.js
  • Build Tool: @wordpress/scripts (based on Webpack/Vite)
  • Dynamic Loading: Intersection Observer for lazy-loading heavy libraries
  • Web Workers: Background thread syntax highlighting to keep the main thread free
  • Async Rendering: Parallel rendering pipeline for SSR and client-side hydration

Included Libraries

LibraryVersionPurpose
markdown-it14.1.0Core Markdown parsing
shiki1.xVS Code-grade syntax highlighting
mermaid10.xDiagram rendering (Flowcharts, etc.)
katex0.13+Mathematical formula rendering (LaTeX)
chart.js4.xData visualization (Bar, Pie, Line, Scatter charts)
PlantUMLServer-sideUML diagram rendering via PlantUML

Performance Architecture

The plugin is designed with a "vibrant performance" approach:

  1. Selective Loading: Assets are only enqueued if specific features (like code blocks or Mermaid diagrams) are detected in the post content.
  2. Lazy Rendering: Heavy libraries like Shiki and Mermaid are loaded asynchronously and only when needed.
  3. Optimized Metadata: Code block metadata is pre-calculated on post save to reduce frontend processing time.
  4. Caching: Rendered assets and feature detection results are cached using WordPress transients.
  5. Web Worker Highlighting: Syntax highlighting runs in a background Web Worker, preventing main thread blocking.
  6. SSR Parallel Pipeline: Code blocks and diagrams are partially rendered server-side, reducing client-side work and improving initial load time.

Development Workflow

  • Testing: PHPUnit for backend, Playwright for E2E testing
  • Linting: PHPCS (WordPress Standards), ESLint, Stylelint
  • CI/CD: GitHub Actions for automated testing and transparency