Use ScribeFire to insert syntax highlighting in your blog

Source: Internet
Author: User

The effect is as follows

This is the Code button that we added in ScribeFire, and clicking this button will appear

Enter the code directly in the Codehere.

View HTML

You can see that the <pre> tag has been added.

Here are the configuration instructions:

The configuration process references this article: Install the WordPress client ScribeFire under Linux CentOS and add the code highlighting feature

The first floor is reserved for the great God.

The great God says that ScribeFire's editor is the TINYMCE API, the result of the great God analysis above

So, in fact, our configuration work is for TINYMCE API

According to the Great God's article, first

CD ~/.config/google-chrome/default/extensions/

Open the ScribeFire plugin under Chrome, click F12, go to developer mode, and Ctrl+f, find chrome-extension

followed by a long string of characters corresponding to the ScribeFire folder, enter this folder

CD elkkomimknapgodalnkjeddkjnjkfmfp/

Edit Events.js File

Vim Events.js

Find Tinymce.init and add code as instructed in the diagram

Editor.addbutton (' _code ', {    text: ' Code ',    icon:false,    onclick:function () {    //Alerts the currently Selected contents    tinyMCE.activeEditor.selection.setContent ("<pre>codeHere</pre>");    });

In order to better suit the highlight style of the blog park, you can do the following settings

Editor.addbutton (' _code ', {    text: ' Code ',    icon:false,    onclick:function () {    //Alerts the currently Selected contents    tinyMCE.activeEditor.selection.setContent ("<pre class=\" brush:cpp;gutter:true;\ "> Codehere</pre> ");    });

Save, then reopen ScribeFire to see our newly added button.

In edit view, add a border to the input code:

Enter in the current folder

Vim Skin/editor_content.css

Edit the Content.css file and add it at the end of the file

pre{    border:1px dashed #C1CDC1;}

Save

At this point, the configuration is complete! enjoy!

Use ScribeFire to insert syntax highlighting in your blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.