WP Manifestindependent plugin directory
manifest / content / cc-prism-highlighter

CC Prism Highlighter

CC Prism Highlighter is a lightweight WordPress plugin that conditionally loads Prism.js syntax highlighting only on singular posts or pages that contain Prism-compatible code blocks.prism Highlighter

by Chance Lin · github.com/cclintw/cc-prism-highlighter

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/cclintw/cc-prism-highlighter/archive/refs/heads/main.zip

Readme

CC Prism Highlighter

CC Prism Highlighter is a lightweight WordPress plugin that conditionally loads Prism.js syntax highlighting only on singular posts or pages that contain Prism-compatible code blocks.

It is designed for technical articles, tutorials, documentation websites, developer notes, and long-form posts that include code examples.

Features

  • Detects <pre><code class="language-xxx"> code blocks
  • Loads Prism.js assets only when needed
  • Supports common languages such as HTML, CSS, JavaScript, PHP, Python, SQL, CSV, Git, and HTTP
  • Includes line numbers, toolbar, show-language, and copy-to-clipboard support through the bundled Prism build
  • Provides a clean custom code block style
  • Translation ready with the cc-prism-highlighter text domain

Usage

<pre><code class="language-php">
echo 'Hello World';
</code></pre>

Installation

  1. Upload the plugin folder cc-prism-highlighter to /wp-content/plugins/
  2. Activate the plugin in WordPress admin
  3. Add Prism-compatible code blocks to posts or pages
  4. View the post or page on the frontend

Third-Party Libraries

This plugin bundles Prism.js.

Changelog

1.0.0

  • Initial release

Read the full README on GitHub →