
內容簡介
Markdown Renderer for GitHub 是一款專為 WordPress 設計的外掛,能將內容轉換為美觀的 GitHub Flavored Markdown (GFM) 格式,適合技術部落格、文件網站及需要專業程式碼展示的內容。
【主要功能】
• 美觀的語法高亮顯示
• 支援 Mermaid 圖表與互動功能
• 支援多種 Chart.js 圖表類型
• 完全兼容 GitHub Markdown
• 一鍵複製程式碼功能
• 性能優化,適合 WordPress
外掛標籤
開發者團隊
② 後台搜尋「Markdown Renderer for GitHub」→ 直接安裝(推薦)
📦 歷史版本下載
原文外掛簡介
Markdown Renderer for GitHub transforms your WordPress content with beautiful GitHub Flavored Markdown (GFM) rendering. Perfect for technical blogs, documentation sites, and any content that needs professional code presentation.
Key Features:
🎨 Beautiful Syntax Highlighting
* Powered by Shiki – the same syntax highlighter used by VS Code
* Support for 100+ programming languages
* Multiple beautiful themes (GitHub Light/Dark, VS Code themes, and more)
* Automatic language detection
📊 Mermaid Diagram Support
* Create flowcharts, sequence diagrams, and more
* 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
✨ 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
* Minimal performance impact
* CDN-friendly architecture
* 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.5 or higher
PHP 8.2 or higher
Modern browser with JavaScript enabled
Recommended: 128MB+ PHP memory limit
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
Source Code Access:
* GitHub Repository: https://github.com/wakalab/markdown-renderer-for-github
* License: GPL v2 or later
* Development Branch: main
Build Instructions:
1. Install Node.js 18+
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
This plugin operates entirely self-contained and does NOT use any external third-party services.
Complete Local Operation:
* All JavaScript libraries are bundled locally within the plugin
* 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)
* No external API calls or network requests are made
Privacy & Security Benefits:
* No data is transmitted to external servers
* No tracking, analytics, or data collection
* No external dependencies that could compromise your site
* GDPR compliant by design
* Works offline and in closed networks
All functionality is fully self-contained within your WordPress installation with no external service dependencies.
Privacy
This plugin does not collect any personal data. All processing is done locally on your server.
Credits
Syntax highlighting: Shiki
Diagram rendering: Mermaid
Chart rendering: Chart.js
Markdown parsing: markdown-it
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
