[wordpress插件] Code Snippet代码段

wordpress 插件 文章 2020-03-27 01:30 456 0 全屏看文

AI助手支持GPT4.0

评分
20
描述

Code Snippet was created by Roman Roan and originally hosted at http://blog.enargi.com.

代码段由Roman Roan创建,最初托管在http://blog.enargi.com。

It is powered by the GeSHi engine and is quite possibly the best syntax highlighting engine for WordPress.

它由GeSHi引擎提供动力,很可能是WordPress的最佳语法突出显示引擎。

A large number of languages are supported and it can be easily extended.

支持多种语言,可以轻松扩展。

Since his blog is no longer functioning, I’m attempting to keep his wonderful contribution available so I’ve given it a home at http://blog.hackerforhire.org/code-snippet/.

由于他的博客不再运行,因此我试图保持他的出色贡献,因此我在http://blog.hackerforhire.org/code-snippet/上找到了主页。

If you find any bugs with it, let me know and I will do my best to resovle them.

如果您发现任何错误,请告诉我,我会尽力解决它们。

Usage

用法

The original author recommended always wrapping your code in a

 tag;

原始作者建议始终将代码包装在

标记中;

however, most times you generally don’t need to.

但是,大多数情况下通常不需要。

To use it, simply surround your code with as such and specify your language type:

要使用它,只需将您的代码括起来,并指定您的语言类型:

[code lang=”c”]

[code lang =“ c”]

int main(int argc, char** argv) { return 0;

int main(int argc,char ** argv){返回0;

}

}

[/code]

[/ code]

And the result is:

结果是:

int main(int argc, char** argv) { return 0;

int main(int argc,char ** argv){返回0;

}

}

Supported Languages

支持的语言

This tool uses the GeSHi library.

此工具使用GeSHi库。

Any supported language there should work just fine with Code Snippet.

那里的任何受支持的语言都应该可以与代码段一起正常工作。

See http://qbnz.com/highlighter/ for details.

有关详细信息,请参见http://qbnz.com/highlighter/。

安装步骤

    1. Copy archive to wp-content/plugins directory
    2. 将存档复制到wp-content / plugins目录

    3. Extract the zip file
    4. 解压缩zip文件

    5. When extracted properly you should have following directory structure: /wp-content/plugins/codesnippet
    6. 正确提取后,您应该具有以下目录结构:/ wp-content / plugins / codesnippet

    7. Since I have not torn through the code, the plugin will probably not work if extracted/copied in diffrenet directory.
    8. 由于我没有撕开代码,因此如果将其提取/复制到diffrenet目录中,则该插件可能无法正常工作。

    9. Enable the plugin in the Plugin interface
    10. 在“插件”界面中启用插件

下载地址
https://downloads.wordpress.org/plugin/codesnippet-20.zip
-EOF-

AI助手支持GPT4.0