Title: Prettify Code Syntax
Author: jesucarr
Published: <strong>15 ກຸມພາ 2013</strong>
Last modified: 21 ມີນາ 2013

---

ຄົ້ນຫາປລັກອິນ

ປລັກອິນນີ້ **ຍັງບໍ່ທັນໄດ້ຮັບການທົດສອບກັບ WordPress 3 ເວີຊັນຫຼັກຫຼ້າສຸດ**. ມັນອາດຈະ
ບໍ່ໄດ້ຮັບການເບິ່ງແຍງ ຫຼື ສະໜັບສະໜູນອີກຕໍ່ໄປ ແລະ ອາດມີບັນຫາການເຮັດວຽກຮ່ວມກັນເມື່ອ
ໃຊ້ກັບ WordPress ເວີຊັນທີ່ໃໝ່ກວ່າ.

![](https://s.w.org/plugins/geopattern-icon/prettify-code-syntax.svg)

# Prettify Code Syntax

 ໂດຍ [jesucarr](https://profiles.wordpress.org/jesucarr/)

[ດາວໂຫຼດ](https://downloads.wordpress.org/plugin/prettify-code-syntax.1.2.1.zip)

 * [ລາຍລອຽດ](https://lo.wordpress.org/plugins/prettify-code-syntax/#description)
 * [ການຣີວິວ](https://lo.wordpress.org/plugins/prettify-code-syntax/#reviews)
 *  [ການຕິດຕັ້ງ](https://lo.wordpress.org/plugins/prettify-code-syntax/#installation)
 * [ການພັດທະນາ](https://lo.wordpress.org/plugins/prettify-code-syntax/#developers)

 [ການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/prettify-code-syntax/)

## ຄຳອະທິບາຍ

The main reason for the development of this plugin was the lack of options supporting
the **HTML5 recommendation**, where the code snippets should be tagged with `pre`
followed by `code`, and optionally a class starting with `language-` and then our
language.

You can use the plugin like this:

    ```
    <pre class="prettyprint"><code class="language-php">
    // my code
    </code></pre>
    ```

Also very important is that although this plugin loads different files depending
on your configuration, it fully **supports caching** scripts ([W3 Total Cache](https://wordpress.org/extend/plugins/w3-total-cache/))
to concatenate and compress all the css and js, so the impact in performance will
be minimum.

#### Languages

This syntax highlighter is based on [Google Code Prettify](http://google-code-prettify.googlecode.com/svn/trunk/README.html)
and should work on a number of languages including **C** and friends, **Java**, **
Python**, **Bash**, **SQL**, **HTML**, **XML**, **Javascript**, **Makefiles**, and
Rust. It works passably on **Ruby**, **PHP**, **VB**, and **Awk** and a decent subset
of **Perl** and **Ruby**, but, because of commenting conventions, doesn’t work on
Smalltalk.

Other languages are supported via an extension (plugin options): **CSS**, **SQL**,**
YAML**, **Visual Basic**, **Clojure**, **Scala**, **Latek (TeX, LaTeX)**, **WikiText**,**
Erlang**, **Go**, **Haskell**, **Lua**, **OCAML**, **SML**, **F#**, **Nemerle**,**
Protocol Buffers**, **CHDL (VHDL)**, **XQ (XQuery)**, **Lisp, Scheme**, **Dart**,**
Llvm**, **Mumps**, **Pascal**, **R, S**, **RD**, **TCL**

#### Styles

**Four** different styles are provided, and they can be previewed in the plugin 
options. They are modified to make sure they don’t clash with any other styles in
your theme.

You have also the option to include your **custom style**.

If you have a style that would like to see included in the option list, just [contact me](http://www.frontendmatters.com/contact/),
or [fork me](https://github.com/jesucarr/wordpress-prettify-code-syntax).

#### Notes

 * Plugin options are at Settings > Prettify Code Syntax. Have a look at the Screenshots
   tab to see how it looks like.
 * If you don’t care too much about the HTML5 recommendation, you can skip the `
   language-` class. The code always gets detected automatically.
 * It will also work if you only use a `pre` tag without the `code` tag (but long
   lines will be wrapped instead of get horizontal scroll), or if you only use a`
   code` tag with the `prettyprint` class (but if you don’t use `pre` your spaces/
   returns won’t be maintained.)
 * Be careful using the Visual Editor tab when inserting code, as some HTML tags
   will be modified or removed.
 * Using a chaching plugin like W3 Total Cache is highly recommended.

#### Demo

You can find a [front end demo](http://www.frontendmatters.com/open-source/wordpress-plugins/prettify-code-syntax/)
here a the bottom.

## ພາບໜ້າຈໍ

 * [[
 * Language options
 * [[
 * Style options

## ການຕິດຕັ້ງ

In your WordPress installation go to Plugins > Add New, and search for “prettify
code syntax” to find and install it automatically.

You can also install it manually:

 1. Download the plugin and upload the contents to the `/wp-content/plugins/` directory,
    using FTP or the Upload tab in Plugins > Add New.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Change settings if neccessary at Settings > Prettify Code Syntax

## ຄຳຖາມທີ່ພົບເລື້ອຍ

  I want to add the tags “ or “ to my code, how can I do it without breaking the
snippet?

You can add a space before the closing `>`, like this `</code >`

  I found a bug, or have some code improvements, or have something to ask about 
the plugin. How do I contact you?

Best thing with anything related to code would be to [fork me or open an issue](https://github.com/jesucarr/wordpress-prettify-code-syntax).
For anything else you can [post a comment](http://www.frontendmatters.com/open-source/wordpress-plugins/prettify-code-syntax/)
or [contact me](http://www.frontendmatters.com/contact/).

## ການຣີວິວ

![](https://secure.gravatar.com/avatar/85bdc493b6f93ea980ab64218e99534065e59019a817a7ac0803c7555fcfa18e?
s=60&d=retro&r=g)

### 󠀁[.](https://wordpress.org/support/topic/7878552/)󠁿

 [krischik](https://profiles.wordpress.org/krischik/) 8 ກຸມພາ 2017

 [ ອ່ານການຣີວິວທັງໝົດ 12 ລາຍການ ](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/)

## ຜູ້ຮ່ວມພັດທະນາ ແລະ ຜູ້ພັດທະນາ

“Prettify Code Syntax” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້ມີສ່ວນຮ່ວມ
ໃນການພັດທະນາປລັກອິນນີ້.

ຜູ້ຮ່ວມພັດທະນາ

 *   [ jesucarr ](https://profiles.wordpress.org/jesucarr/)

[ແປ “Prettify Code Syntax” ເປັນພາສາຂອງເຈົ້າ.](https://translate.wordpress.org/projects/wp-plugins/prettify-code-syntax)

### ສົນໃຈຮ່ວມພັດທະນາບໍ່?

[ເບິ່ງລະຫັດ](https://plugins.trac.wordpress.org/browser/prettify-code-syntax/), 
ກວດເບິ່ງ [ຄັງເກັບ SVN](https://plugins.svn.wordpress.org/prettify-code-syntax/),
ຫຼື ຕິດຕາມ [ບັນທຶກການພັດທະນາ](https://plugins.trac.wordpress.org/log/prettify-code-syntax/)
ຜ່ານ [RSS](https://plugins.trac.wordpress.org/log/prettify-code-syntax/?limit=100&mode=stop_on_copy&format=rss).

## ບັນທຶກການປ່ຽນແປງ

#### 1.2

 * Add Twitter Bootstrap style
 * Isolate default style. Every style now is independent
 * Fix bug where all languages were loaded
 * Code refactoring

#### 1.1

 * Add new languages
 * Several fixes and code refactoring

#### 1.0

 * First release

## ຂໍ້ມູນກຳກັບ (Meta)

 *  ເວີຊັນ **1.2.1**
 *  ອັບເດດຫຼ້າສຸດເມື່ອ **13 ປີ ທີ່ຜ່ານມາ** ທີ່ຜ່ານມາ
 *  ການຕິດຕັ້ງທີ່ໃຊ້ງານຢູ່ **80+**
 *  ເວີຊັນ WordPress ** 3.0.1 ຫຼື ສູງກວ່າ **
 *  ທົດສອບເຖິງເວີຊັນ **3.5.2**
 *  ພາສາ
 * [English (US)](https://wordpress.org/plugins/prettify-code-syntax/)
 * ແທັກ
 * [code](https://lo.wordpress.org/plugins/tags/code/)[highlighter](https://lo.wordpress.org/plugins/tags/highlighter/)
   [markup](https://lo.wordpress.org/plugins/tags/markup/)[prettify](https://lo.wordpress.org/plugins/tags/prettify/)
   [syntax](https://lo.wordpress.org/plugins/tags/syntax/)
 *  [ມຸມມອງຂັ້ນສູງ](https://lo.wordpress.org/plugins/prettify-code-syntax/advanced/)

## ການໃຫ້ຄະແນນ

 4.2 ຈາກທັງໝົດ 5 ດາວ.

 *  [  ການວິຈານ 5 ດາວ ຈຳນວນ 6 ລາຍການ     ](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/?filter=5)
 *  [  ການວິຈານ 4 ດາວ ຈຳນວນ 4 ລາຍການ     ](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/?filter=4)
 *  [  ການວິຈານ 3 ດາວ ຈຳນວນ 1 ລາຍການ     ](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/?filter=3)
 *  [  ການວິຈານ 2 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/?filter=2)
 *  [  ການວິຈານ 1 ດາວ ຈຳນວນ 1 ລາຍການ     ](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/#new-post)

[ເບິ່ງ ຄຳຄິດເຫັນ ທັງໝົດ](https://wordpress.org/support/plugin/prettify-code-syntax/reviews/)

## ຜູ້ຮ່ວມພັດທະນາ

 *   [ jesucarr ](https://profiles.wordpress.org/jesucarr/)

## ການຊ່ວຍເຫຼືອ

ມີຄຳຖາມ ຫຼື ຕ້ອງການຄວາມຊ່ວຍເຫຼືອບໍ່?

 [ເບິ່ງຟໍຣັມການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/prettify-code-syntax/)

## ບໍລິຈາກ

ເຈົ້າຕ້ອງການສະໜັບສະໜູນການພັດທະນາຂອງປລັກອິນນີ້ບໍ່?

 [ ບໍລິຈາກໃຫ້ປລັກອິນນີ້ ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LEJAVTJUGWE3E)