[wordpress插件] CODE FACE SYNTAX HIGHLIGHTER代码面部语法突出显示

wordpress 插件 文章 2020-03-26 14:40 472 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin is intended to provide on-demand syntax highlighting for programming code.

此插件旨在为编程代码提供按需语法突出显示。

It supports many programming languages.

它支持多种编程语言。

Code blocks are automatically detected within the HTML of your posts through JavaScript.

通过JavaScript在您的帖子的HTML中自动检测代码块。

Only
  


  

the needed language highlighting resources are loaded.

所需的语言突出显示资源已加载。

Supported languages:
  

支持的语言:
  

C++, C#, CSS, Delphi, Java, JavaScript, PHP, Python, Ruby, SQL, VB, XML/HTML.

C ++,C#,CSS,Delphi,Java,JavaScript,PHP,Python,Ruby,SQL,VB,XML / HTML。

This package includes the “syntaxhighlighter” project: http://www.dreamprojections.com/syntaxhighlighter

此软件包包括“ syntaxhighlighter”项目:http://www.dreamprojections.com/syntaxhighlighter

INSTALLATION

安装

To install this plugin, unzip and copy the “codeface” directory into your
  

要安装此插件,请解压缩并将“ codeface”目录复制到您的
  

plugins directory.

插件目录。

This is typically /wp-content/plugins.

通常是/ wp-content / plugins。

Next, check that the theme you are using contains the following PHP function
  

接下来,检查您使用的主题是否包含以下PHP函数
  

call: “wp_footer();”.

致电:“ wp_footer();”。

This will be typically found somewhere in the
  

通常可以在
的某个地方找到  

“footer.php” file.

“ footer.php”文件。

If your theme doesn’t contain this call, copy the following code into your footer above the closing tag:

如果您的主题不包含此调用,请将以下代码复制到结束标记上方的页脚中:

  

  <?php wp_footer(); 

?>

?>

Finally, log into the WordPress Admin section and activate the plugin.

最后,登录WordPress Admin部分并激活插件。

USAGE

用法

To highlight the code syntax of a given post, open the post for editing.

要突出显示给定帖子的代码语法,请打开该帖子以进行编辑。

You should see two tabs “Visual” and “Code” above the rich text editor WordPress
  

您应该在富文本编辑器WordPress上方看到两个标签“ Visual”和“ Code”。
  

provides.

提供。

Click the “Code” tab.

点击“代码”标签。

From there you can edit the HTML of your post.

从那里,您可以编辑帖子的HTML。

To use code highlighting, you’ll have to wrap your example code in a

要使用代码突出显示,您必须将示例代码包装在

<

<< / p>

pre> or
   

pre>或
   

tag and pick the CSS class name for your language (see class names
  

标记并选择您所用语言的CSS类名称(请参阅类名称
  

below).

下面)。

For example:

例如:

  
       

  
 <?php require_once“ myFile.php”; 

?>

?>

NOTE: It’s recommended you do NOT use tags in your posts.

注意:建议您不要在帖子中使用标签。

It
  


  

tends to freak out WordPress and you can end up loosing part or all of your
  

往往会吓坏WordPress,您最终可能会失去部分或全部
  

post.

帖子。

Code Face supports syntax highlighting for many different languages.

Code Face支持许多不同语言的语法突出显示。

You can select the appropriate language by adding a “class” attribute to the

您可以通过向“ ”添加“类别”属性来选择合适的语言

<

<< / p>

pre> or tag, like the example above.

pre>或标签,如上面的示例。

Here are the class names you can use and the language they represent:

以下是您可以使用的类名称及其代表的语言:

    CSS Class Name      Language     ------------------  --------     cplusplus-codeface  C++     csharp-codeface     C#     css-codeface        CSS     delphi-

  CSS类名称语言------------------ -------- cplusplus-codeface C ++ csharp-codeface C#css-codeface CSS delphi-

codeface Delphi java-codeface Java js-codeface JavaScript python-codeface Python php-codeface PHP ruby-codeface Ruby sql-codeface SQL vb-codeface VB xml-codeface XML html-codeface HTML (alias for XML)

代码面Delphi Java代码面Java js代码面JavaScript python代码面Python php代码面PHP红宝石代码面Ruby sql代码面SQL vb代码面VB xml代码面XML html代码面HTML(XML的别名)

>

>

When you finish editing your post, save it.

完成帖子的编辑后,将其保存。

Code Face will automatically detect the code blocks and highlight them for you when you view it on the
  

当您在
上查看时,Code Face将自动检测代码块并为您突出显示它们  

front-end.

前端。

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

AI助手支持GPT4.0