Title: Melonpan Block &#8211; Code
Author: Alvaro
Published: <strong>2019 年 8 月 2 日</strong>
Last modified: 2021 年 3 月 2 日

---

搜索插件

![](https://ps.w.org/melonpan-block-code/assets/banner-772x250.png?rev=2132990)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/melonpan-block-code/assets/icon-256x256.png?rev=2147682)

# Melonpan Block – Code

 作者：[Alvaro](https://profiles.wordpress.org/melonpan/)

[下载](https://downloads.wordpress.org/plugin/melonpan-block-code.2.0.3.zip)

 * [详情](https://cn.wordpress.org/plugins/melonpan-block-code/#description)
 * [评价](https://cn.wordpress.org/plugins/melonpan-block-code/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/melonpan-block-code/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/melonpan-block-code/#developers)

 [支持](https://wordpress.org/support/plugin/melonpan-block-code/)

## 描述

[Demo](https://gutenberg-showcase.melonpan.io/melonpan-block-code) – [Documentation](https://melonpan.io/wordpress-plugins/melonpan-block-code)–
[GitHub](https://github.com/garciaalvaro/melonpan-block-code)

Block to display code, with highlighted syntax, which can be copied to the clipboard.

### Features

The block comes with the following settings:

 * **Code language**: JavaScript, CSS, PHP, etc. [Full list of languages](https://prismjs.com/#languages-list).
 * **Color theme**
 * **Label**: Top left label that can be customized. By default the code language.
 * **Copy button**: Top right button to copy the block content.
 * **Padding**
 * **Border width** and **Border radius**

### Usage

The block can be found inside the blocks inserter menu under the _Melonpan Blocks_
category.
 Once added in the post you can edit its settings on the Editor sidebar
under the Block settings panel. Switch between the previewer and editor views to
edit the code and see its styled output.

## 屏幕截图

 * [[
 * Block settings panel.

## 区块

该插件提供了 1 个区块.

 *   Melonpan Block – Code

## 安装

Installation from the WordPress admin.

 1. Log in to the WordPress admin and navigate to _Plugins > Add New_.
 2. Type _Melonpan Block – Code_ in the Search field.
 3. In the results list _Melonpan Block – Code_ plugin should appear, click **Install
    Now** button.
 4. Once it finished installing, click the _Activate_ button.
 5. That’s it, now you can go to any post where Gutenberg is enabled and start using
    the block.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Melonpan Block – Code」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Alvaro ](https://profiles.wordpress.org/melonpan/)

「Melonpan Block – Code」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/melonpan-block-code/contributors)
为本插件所做的贡献。

[帮助将「Melonpan Block – Code」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/melonpan-block-code)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/melonpan-block-code/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/melonpan-block-code/)，或通过[RSS](https://plugins.trac.wordpress.org/log/melonpan-block-code/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/melonpan-block-code/)。

## 更新日志

#### 2.0.3

 * Updated dependencies

#### 2.0.2

 * Updated dependencies

#### 2.0.1

 * Fixed bug where old instances of the block with the copy button enabled were 
   throwing a deprecation warning

#### 2.0.0

 * Major refactor
 * Updated packages

#### 1.1.0

 * Small CSS fix for WP 5.4 version.
 * Improved development environment (updated packages, added linting…)

#### 1.0.1

 * Improved code base.

#### 1.0.0

 * Initial release.

## 额外信息

 *  版本 **2.0.3**
 *  最后更新：**5 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 5.5 或更高版本 **
 *  已测试的最高版本为 **5.6.17**
 *  PHP 版本 ** 7.1 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/melonpan-block-code/) 和 [Hungarian](https://hu.wordpress.org/plugins/melonpan-block-code/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/melonpan-block-code)
 * 标签
 * [block](https://cn.wordpress.org/plugins/tags/block/)[block-editor](https://cn.wordpress.org/plugins/tags/block-editor/)
   [code](https://cn.wordpress.org/plugins/tags/code/)[prism](https://cn.wordpress.org/plugins/tags/prism/)
   [syntax highlighting](https://cn.wordpress.org/plugins/tags/syntax-highlighting/)
 *  [高级视图](https://cn.wordpress.org/plugins/melonpan-block-code/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/melonpan-block-code/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/melonpan-block-code/reviews/)

## 贡献者

 *   [ Alvaro ](https://profiles.wordpress.org/melonpan/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/melonpan-block-code/)