
內容簡介
這是一個使用 Google code prettify 腳本的語法突顯外掛程式,具有快速和輕量的優點,支援最多 31 種預設不同的顏色主題。
即使程式碼包含嵌入式連結、行號等內容,仍然能正常運作。
可以選擇是否顯示行號。
支援 31 種預設色彩主題。
體積輕巧:下載量小,執行時不會阻塞頁面載入。
支援所有類似 C、Bash 和 XML 的語言,無需指定語言。
可擴充語言處理器來支援其他語言,可以指定語言。
廣泛使用,且具有良好的跨瀏覽器支援。
提供兩種快捷碼:[SyntaxHL][/SyntaxHL] 和 [SyntaxHLNumbers][/SyntaxHLNumbers],後者會顯示行號。
使用方法和常見問題請參考Easy Syntax Highlighter Document
此外掛程式的靈感來自於:
https://github.com/google/code-prettify
https://github.com/jmblog/color-themes-for-google-code-prettify
外掛標籤
開發者團隊
原文外掛簡介
Easy Syntax Highlighter is a powerful WordPress plugin that helps improve your website’s code presentation by providing beautiful syntax highlighting. Using the latest Highlight.js library, it supports over 20 programming languages with 80+ color themes, copy-to-clipboard functionality, and seamless integration with both classic and Gutenberg editors.
Features
Modern Highlight.js Engine: Uses the latest Highlight.js library for fast, accurate syntax highlighting
80+ Themes Included: Over 80 themes for both light and dark modes, all stored locally for offline compatibility
Unlimited Language Support: Supports 20+ programming languages including JavaScript, PHP, Python, CSS, HTML, SQL, Bash, and more
Modern JavaScript: Promise-based loading with proper error handling and performance optimizations
Performance Optimized: Smart asset loading—only loads when code blocks are present on the page
Security Focused: Proper input sanitization and output escaping
Admin Interface: Clean, modern settings page with visual theme selector integrated with WordPress admin
Localization Ready: Translation-ready with proper text domains
Backward Compatible: Automatic migration from old plugin versions
How to Use
Gutenberg Block Editor: Use the default WordPress “Code” block. The plugin automatically detects the language and highlights it. There is no language setting in the sidebar; detection is automatic. If you need to force a language, edit the block as HTML and add a class to the element (e.g., ).
Classic Editor: Use the TinyMCE button (code icon) with the modal dialog for easy code insertion.
Copy to Clipboard: Double-click any code block to instantly copy its content with visual feedback.
Use Cases
Technical blogs and tutorials
Documentation websites
Programming courses and educational content
Developer portfolios
API documentation
Code examples and snippets
Support
For support, bug reports, or feature requests, please visit: Github
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues on GitHub.
License
This plugin is licensed under the GPLv2 or later.
License URI: https://www.gnu.org/licenses/gpl-2.0.html
