WP Manifestindependent plugin directory
manifest / editor / wp-mini-codeblock

Franklin Mini Codeblock

Minimal, fast syntax highlighting with no dependencies

by Franklin · github.com/fvdm/wp-mini-codeblock

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/fvdm/wp-mini-codeblock/archive/refs/heads/main.zip

A lightweight, dependency-free WordPress syntax highlighting plugin.

Features

  • Zero dependencies
  • Dark theme with flat colors
  • Copy-to-clipboard button
  • Fully responsive
  • Small footprint
  • Only loaded where needed
  • Optimized for fast page loading and minimal code in the editor
  • Languages: C, CSS, HTML, INI, Javascript, JSON, Lua, Path, PHP, Python, Shell, TypeScript, XML and URL
  • Gutenberg block editor support
  • System monospace font

Installation

  1. Download and extract the plugin files
  2. Upload the franklin-mini-codeblock folder to /wp-content/plugins/
  3. Activate the plugin through the WordPress admin panel
  4. Add a "Mini Code Block" in the block editor

Usage

  1. In the WordPress editor, add a new block
  2. Search for "Mini Code Block"
  3. Select your language from the dropdown
  4. Paste or type your code
  5. Publish!

The code block will appear with:

  • Syntax highlighting
  • Dark background
  • Copy button
  • Responsive design

Matomo stats

When you have a Matomo tracker in your page, the copy-button clicks will be tracked as events:

Category Interface, name copy-fmc and value code-block

To distinguish code blocks you can replace the value with a Matomo ID in the editor. Does not have to be unique.

Browser Support

  • All modern browsers (Chrome, Firefox, Safari, Edge)
  • Copy button requires Clipboard API (all modern browsers)

Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to https://unlicense.org/

Attribution (non-binding request)

This project is released under the Unlicense (public domain equivalent). Attribution is not legally required, but the author kindly asks that, where reasonable, you keep a note such as:

Mini Codeblock by Franklin – https://frankl.in

Author

Franklin | Buy me a coffee