PrettyCode • Code syntax highlighting with CodeMirror

描述

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.

Third Party

This plugins uses some third party libraries:

  • WordPress create-block by gziolo – https://www.npmjs.com/package/@wordpress/create-block
  • CodeMirror – https://github.com/codemirror/CodeMirror
  • react-codemirror2 by scniro – https://github.com/scniro/react-codemirror2

A big thanks to their respective creators and maintainers!

屏幕截图

区块

该插件提供了 1 个区块.

  • PrettyCode A code syntax highlighting block for your snippets of all major languages.

安装

  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’

常见问题

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

评价

2022 年 3 月 8 日
Merci d’avoir transposé le bloc en standalone, il était vraiment cool dans AGB.
阅读所有2条评价

贡献者及开发者

「PrettyCode • Code syntax highlighting with CodeMirror」是开源软件。 以下人员对此插件做出了贡献。

贡献者

「PrettyCode • Code syntax highlighting with CodeMirror」插件已被翻译至 1 种本地化语言。 感谢所有译者为本插件所做的贡献。

帮助将「PrettyCode • Code syntax highlighting with CodeMirror」翻译成简体中文。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

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