WP Manifestindependent plugin directory
manifest / editor / prettycode.plugin

PrettyCode • Syntax highlighting with CodeMirror

Code highlighting made simple, for the WordPress editor

★ 2stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/maximebj/prettycode.plugin/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

PrettyCode • Code syntax highlighting with CodeMirror

A simple block to highlight code with 20+ languages and 50+ themes, for the WordPress editor.

Description

The prettiest syntax highlighting block for the WordPress editor. Live edit your code snippets in the admin with bracket matching, customize colors with more thant 50 themes (Base16, Monokai, Material, Zenburn, Hopscotch...). Compatible with major languages: HTML, CSS, JS, JSX, Stylus, Sass, PHP, Python, C, C++, C#, Java, XML, Shell, JSON, Go, Swift...

This block uses CodeMirror. You may have seen this block before on the Advanced Gutenberg Blocks plugins few years ago. It's now an updated and standalone block.

Installation

  1. Upload the plugin files to the /wp-content/plugins/prettycode directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Go to a post and click on 'Add block'
  4. Search for 'PrettyCode'

Frequently Asked Questions

Which languages are available?

All major language are available: HTML, CSS, JS, JSX, Stylus, Sass, PHP, Python, C, C++, C#, Java, XML, Shell, JSON, Go, Swift...

Can I add more languages ?

Yes, by using the filter prettycode_languages_list.

Can I customize the appearance?

Sure! You have access to 50+ dark and light themes like Base16, Monokai, Material, Zenburn, Hopscotch...

Can I contribute?

Yep! The public repository is right here: https://github.com/maximebj/prettycode.plugin

Screenshots

Changelog

2.0.2

  • Fixed build

2.0.1

  • Fixed build

2.0

  • Upgraded to CodeMirror 6
  • Updated blockAPI version to 3
  • Fixed bugs

1.0.7

  • Fixed code editor line height

1.0.6

  • Added translation for JS files
  • Fixed a bug with PHP block

1.0

  • Initial release

Third Party

This plugins uses some third party libraries:

A big thanks to their respective creators and maintainers!