[wordpress插件] Code Snippet DM程式码片段DM

wordpress 插件 文章 2020-03-26 17:00 442 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Display your code snippets in a stylish way inside your content.

以一种时尚的方式在您的内容中显示您的代码段。

The plugin uses shortcodes and also very intuitive TinyMCE interface.

该插件使用短代码和非常直观的TinyMCE界面。

Code Snippet DM was inspired by the Carbon project.

代码段DM的灵感来自 Carbon 项目。

We created a simple way to display your code snippets but also have control over the way it appears, thus making it more stylish.

我们创建了一种简单的方法来显示您的代码段,但也可以控制其代码段的显示方式,从而使其更加时尚。

Also, on the front end in the top right you will find a Copy Code button that allows you to copy to clipboard the entired code snippet.

另外,在右上角的前端,您会发现一个 Copy Code 按钮,可用于将整个代码段复制到剪贴板。

The plugin provides you with a TinyMCE button that will allow you to display the code or an option to use a shortcode.

该插件为您提供了一个TinyMCE按钮,可让您显示代码或使用简码的选项。

You can open the shorcode [dm_code_snippet] and in the content inside and close it [/dm_code_snippet].

您可以打开短代码 [dm_code_snippet] ,然后在其中的内容中将其关闭,并关闭 [/ dm_code_snippet]

Options

选项

There are a number of options that you can use in the shortcode:

您可以在简码中使用许多选项:

    • background with options yes or no will enable/disable the color background (Default yes)

    • 背景以及选项将启用/禁用彩色背景(默认为

      li>

      li>

    • background-mobile with options yes or no will enable/disable the color background for mobile devices (Default yes

    • 背景移动设备,具有选项的选项将启用/禁用移动设备的彩色背景(默认为

      strong>)

    • strong>)

    • bg-color accepts any HEX, RGB or RGBA value to change the background color (Default #abb8c3)
    • bg-color 接受任何HEX,RGB或RGBA值以更改背景颜色(默认#abb8c3

    • theme with options light or dark that changes the code editor theme (Default dark)

    • 主题,带有选项 light dark 可以更改代码编辑器主题(默认为 dark

      >

      >

    • language with options php, javascript, css, markup, <

    • 语言,带有选项 php javascript css 标记,<

      strong>clike, python, ruby will highlight the syntaxes based on what you select for your code (Default php)

      strong> clike python ruby​​ 将根据您为代码选择的语法(默认为 php )突出显示语法

      li>

      li>

    • wrap with options yes or no will wrap the code or add a horizontal scroll bar to display it as it is (Default

    • 自动换行,并带有选项 yes 将自动换行代码或添加水平滚动条以将其原样显示(默认

      >no)

    • >否

    • copy-text this is used for the text shown on the copy button.

    • 复制文本,用于复制按钮上显示的文本。

      If it’s not added it will use the default option.

      如果未添加,它将使用默认选项。

      (Default Copy Code)

    • (默认复制代码

    • copy-confirmed this is used for the text shown after you click the copy button.

    • 已复制确认,用于单击“复制”按钮后显示的文本。

      If it’s not added it will use the default option.

      如果未添加,它将使用默认选项。

      (Default Copied)

    • (默认已复制

    Example of shortcode:

    简码示例:

    [dm_code_snippet background="yes" background-mobile="yes" bg-color="#abb8c3" theme="light" language="css" wrapped="no" copy-text="Get the

      [dm_code_snippet background =“ yes” background-mobile =“ yes” bg-color =“#abb8c3” theme =“ light” language =“ css” wrapped =“ no” copy-text =“ Get the

    Code!"

    码!”

    copy-confirmed="You have it!"]

    复制确认=“您拥有!”]

    .dm-code-snippet.dark {  

    .dm-code-snippet.dark {  

    background: $default-bg;  

    背景:$ default-bg;  

    padding: 40px 35px 45px 35px;  

    填充:40px 35px 45px 35px;  

    margin: 30px 0;

    边距:30px 0;

    }

    }

    [/dm_code_snippet]

    [/ dm_code_snippet]

    Use the TinyMCE button if you don’t want to add the shortcode yourself.

    如果您不想自己添加简码,请使用TinyMCE按钮。

    (see Screenshots)

    (请参见屏幕截图)

安装步骤

    1. Upload code-snippet-dm folder to the /wp-content/plugins/ directory.
    2. code-snippet-dm 文件夹上传到 / wp-content / plugins / 目录。

    3. Activate the plugin through the ‘Plugins’ menu in WordPress.
    4. 通过WordPress中的“插件”菜单激活插件。

    5. Start using the shortcode or TinyMCE button to display your code.
    6. 开始使用简码或TinyMCE按钮显示您的代码。

下载地址
https://downloads.wordpress.org/plugin/code-snippet-dm.zip
-EOF-

AI助手支持GPT4.0