NOTE: THIS PLUGIN DOES NOT AND WILL NEVER EXECUTE ANY TYPE OF CODE ON YOUR WORDPRESS SITE!
This PLUGIN can be seen as an extension of Google Prettify made Available for WordPress.
Users can now embed code snippets in their wordpress posts making use of Google prettify.
You get to choose from a wide-range of programming languages and a wide-range of themes including sunburst.
This Plugin relies on 3rd party services under these circumstances;
- Copy function – This will enable you copy the shortcodes to your codesnippets
- Icons – This will enable us render icons on the plugin Admin’s page and on Frontend
- Styling your Code Box – This will make your code snippets to be attractive
The 3rd party services are listed below;
- ClipboardJs – https://clipboardjs.com/
- FontAwesome – http://fontawesome.io/
- Google Prettify – https://github.com/googlearchive/code-prettify/
- Google Prettify Color Themes – https://jmblog.github.io/color-themes-for-google-code-prettify/
HOW TO USE
INSERT CODE SNIPPET
- Head Over to Insert Code page to Add a New Code Snippet.
- On the page, add a title for the new snippet.
- Select the Language you’re working with.
- Type in the code in the code box and when you’re done, click on Preview.
- Click on Save to save your code snippet.
NOTE: YOUR CODE SNIPPETS ARE STORED AS PLAIN TEXT TO PREVENT ITS EXECUTION
CONFIGURE CODE SNIPPET
- Head Over to Configure Code tab to Modify An Already Existing Code Snippet.
- On the page, you can change the title for the snippet.
- Change the Language you’re working with.
- Modify the code in the code box and when you’re done, click on Update.
NOTE: THIS UPDATE WILL ENCODE AND STORE YOUR CODE SNIPPETS AS PLAIN TEXT TO PREVENT ITS EXECUTION
- Click on Copy button at the right to Copy the shortcode for the snippet.
- In any of your posts, place the copied shortcode, save the post and click on preview to see the MAGIC.
- You can also Delete the snippet or perform some bulk actions on it.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Head Over to Get Started to learn How to add your first code snippet.
How does the plugin work?
Install it, head over to Insert tab and add a new title for the code snippet, select a language for the snippet, type in the code in the code box, click on preview and if you are okay with it, click on save to save your snippet.
“Coding Blocks” 是开源软件。 以下人员对此插件做出了贡献。贡献者
- It supports up to 44 Languages.
- It supports up to 34 Color Themes.
- We Added Settings Page. (More description in Changelog file).
- We Added Preview Page. (More description in Changelog file).
- We Removed Code Labels on code blocks (In re-development process).
- We Redesigned Admin UI.
- Block Sync Now Available (You can update all your code snippets with one tap to reflect your current plugin settings)
- It supports just 6 Languages.
- It has Just one default theme which is Sunburst Google prettify + night glory.
- A brief description of your code snippet is attached at the header section.
- A copy button is attached to each of your code snippet.