[wordpress插件] Codeblocks Extended with PrismJSPrismJS扩展的代码块

wordpress 插件 文章 2020-03-26 19:10 566 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

Codeblocks Extended with PrismJS was born of a personal need for a lightweight code highlighter, with special functionality.

使用PrismJS扩展的代码块诞生于个人对具有特殊功能的轻量级代码突出显示的需求。

Many of the other PrismJS based plugins in the repository were either outdated, or were lacking features that I was looking for.

存储库中的许多其他基于PrismJS的插件要么已经过时,要么缺少我一直在寻找的功能。

Features:

功能:

    • Integrates the latest PrismJS build, with the most common langauges used.
    • 集成了最新的PrismJS版本,并使用了最常用的语言。

    • Integrates the PrismJS line-numbers plugin, to automatically number lines of code.
    • 集成了PrismJS行号插件,以自动为代码行编号。

    • Integrates the PrismJS line-highlight plugin to allow you to highlight specific lines of code.
    • 集成了PrismJS行高亮插件,使您可以突出显示特定的代码行。

    • Integrates ClipboardJS + custom jQuery to add a “Copy to Clipboard” button to each code block.
    • 集成了ClipboardJS +自定义jQuery,以向每个代码块添加一个“复制到剪贴板”按钮。

    • Custom Text Editor button to wrap selected text with the most commmon
       and  classes, and replacing special characters with their HTML safe equivalents.

    • “自定义文本编辑器”按钮用于以最常用的
         类包装所选文本,并用其HTML安全等效项替换特殊字符。

      li>

      li>

    • Custom Visual Editor / TinyMCE dropdown button, with the most common languages to wrap selected text.
    • “自定义视觉编辑器” /“ TinyMCE”下拉按钮,其中包含用于包装所选文本的最常用语言。

    • Since this works via wrapping
       and  tags with classes, you can use all custom class settings that PrismJS offers.
    • 由于这是通过将
         标记与类一起包装而起作用的,因此您可以使用PrismJS提供的所有自定义类设置。

    • No shortcodes to mess with, so you don’t have to worry about losing whitespace between editor modes.
    • 没有短代码可弄乱,因此您不必担心在编辑器模式之间丢失空格。

    • No settings page needed: Just activate it and go!
    • 无需设置页面:只需激活它即可!

    For a full list of languages supported and more information on this plugin’s use, please check out the FAQ.

    有关所支持语言的完整列表以及有关此插件使用的更多信息,请查看常见问题解答。

    Note: This does NOT auto-detect the language.

    注意:这不会自动检测语言。

    Most plugins that do so brute force the languages or require file extensions, resulting in a much heavier plugin.

    多数这样做的插件会强行使用语言或需要文件扩展名,从而导致插件重得多。

    The decision was made to keep this as light-weight as possible.

    决定使它尽可能轻巧。

    Note 2: This is designed to work with the Classic Editor.

    注2:此功能旨在与经典编辑器一起使用。

    It does not currently work in Gutenberg blocks.

    目前在古腾堡(Gutenberg)街区无法使用。

    Thanks to Mike @ WP Bullet for the banner and icon.

    感谢Mike @ WP项目符号作为横幅和图标。

安装步骤

    1. Upload the plugin files to the /wp-content/plugins/prism-js directory, or install the plugin through the WordPress plugins screen directly.
    2. 将插件文件上传到 / wp-content / plugins / prism-js 目录,或直接通过WordPress插件屏幕安装插件。

    3. Activate the plugin through the ‘Plugins’ screen in WordPress
    4. 通过WordPress中的“插件”屏幕激活插件

    5. That’s it!
    6. 就是这样!

下载地址
https://downloads.wordpress.org/plugin/codeblocks-extended.zip
-EOF-

AI助手支持GPT4.0