Linux 软件免费装
Banner图

Easy Syntax Highlighter

开发者 snowbedding
更新时间 2025年11月11日 19:45
PHP版本: 7.0 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

syntax highlighter code highlighting code block highlight.js

下载

1.0.0 2.0.0

详情介绍:

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 How to Use
  1. 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 <code> element (e.g., <code class="language-php">).
  2. Classic Editor: Use the TinyMCE button (code icon) with the modal dialog for easy code insertion.
  3. Copy to Clipboard: Double-click any code block to instantly copy its content with visual feedback.
Use Cases

安装:

Automatic Installation
  1. Log in to your WordPress admin dashboard
  2. Navigate to Plugins > Add New
  3. Search for "Easy Syntax Highlighter"
  4. Click Install Now
  5. Activate the plugin
Manual Installation
  1. Download the plugin ZIP file
  2. Upload the plugin files to /wp-content/plugins/easy-syntax-highlighter/
  3. Activate the plugin through the Plugins menu in WordPress

屏幕截图:

  • **Gutenberg Block**
  • **Classic Editor**
  • **Frontend Display**

升级注意事项:

2.0.0 This is a major update that completely modernizes the plugin and replaces the previous highlighting library with Highlight.js. All your existing code blocks will be automatically highlighted. It is recommended to review your theme choice under Settings > Syntax Highlighter after upgrading.

常见问题:

How does syntax highlighting work?

The plugin uses the powerful Highlight.js library to automatically find and highlight code within standard WordPress "Code" blocks. There's no need to look for a special block; just use the default one, and the plugin handles the rest.

Which programming languages are supported?

The plugin supports: JavaScript, CSS, PHP, Python, Bash/Shell, SQL, Java, C++, C, C#, Ruby, Go, Rust, TypeScript, JSON, YAML, XML, HTML, Docker, Nginx, and plain text. Auto-detection is also available.

How many themes are available?

The plugin includes over 80 themes, including popular ones like GitHub, Monokai, Atom One, and many more. All themes are available in both light and dark variants.

Does this work with caching plugins?

Yes, the plugin works well with caching plugins and can complement them by ensuring proper asset loading and syntax highlighting even with cached content.

Can I customize the appearance?

Yes! Go to Settings > Syntax Highlighter to choose from over 80 different color themes using a visual theme selector. The copy-on-double-click feature is enabled by default.

Does it work with page builders?

Yes, the plugin should work with any page builder that uses the standard WordPress "Code" block. For other cases, you might need to use a custom HTML block and wrap your code in <pre><code class="language-yourlanguage">...</code></pre>.

How do I highlight specific lines?

Line highlighting is not currently supported. This feature may be added in future updates.

Is the plugin lightweight?

Yes! The plugin only loads its scripts and styles on pages that actually contain a code block, making it very performant.

更新日志:

2.0.0 1.0.0