Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. === Prismatic ===
  2. Plugin Name: Prismatic
  3. Plugin URI: https://plugin-planet.com/
  4. Description: Display beautiful syntax-highlighted code snippets with Prism.js or Highlight.js
  5. Tags: code, css, fence, highlight, language, pre, prettify, prism, snippet, syntax
  6. Author: Jeff Starr
  7. Contributors: specialk
  8. Author URI: https://plugin-planet.com/
  9. Donate link: http://m0n.co/donate
  10. Requires at least: 4.1
  11. Tested up to: 4.6
  12. Stable tag: 1.0
  13. Version: 1.0
  14. Text Domain: prismatic
  15. Domain Path: /languages
  16. License: GPL v2 or later
  17. Display beautiful syntax-highlighted code snippets with Prism.js or Highlight.js
  18. == Description ==
  19. __The only 3-in-1 syntax highlighter!__
  20. Display beautiful code snippets with Prism.js, Highlight.js, or plain code escaping:
  21. * __Prism.js__ - Code escape + syntax highlight using [Prism.js](http://prismjs.com/)
  22. * __Highlight.js__ - Code escape + syntax highlight using [Highlight.js](https://highlightjs.org/)
  23. * __Plain Flavor__ - Code escape without syntax highlight (for custom styles)
  24. **Prism.js Features**
  25. * Supports over __30__ coding languages
  26. * Choose from all __7__ available Prism themes
  27. * Enable Prism plugin [Line Numbers](http://prismjs.com/plugins/line-numbers/)
  28. * Enable Prism plugin [Line Highlight](http://prismjs.com/plugins/line-highlight/)
  29. * Enable Prism plugin [Show Language](http://prismjs.com/plugins/show-language/)
  30. * Highlights code in post content, excerpts, and comments
  31. * Detects `language-` and `lang-` class prefixes
  32. * Limit syntax highlighting to Posts and Pages
  33. * Highlight single-line and multi-line code
  34. * Granular control over code escaping
  35. * Smart loading of CSS & JS assets
  36. **Highlight.js Features**
  37. * Supports __22__ coding languages
  38. * Choose from all __77__ available Highlight themes
  39. * Customize the Highlight.js init JavaScript
  40. * Highlights code in post content, excerpts, and comments
  41. * Limit syntax highlighting to Posts and Pages
  42. * Highlight multi-line blocks of code
  43. * Detects `language-` and `lang-` class prefixes
  44. * Enable support for no-prefix class names
  45. * Granular control over code escaping
  46. * Smart loading of CSS & JS assets
  47. **Plain Flavor Features**
  48. * Enable code escaping for post content, excerpts, and/or comments
  49. * Enable code escaping on the frontend, Admin Area, or both
  50. * Escapes single-line and multi-line code snippets
  51. **General Features**
  52. * Easy to set up & configure
  53. * Built with the WordPress API
  54. * Squeaky clean, error-free code
  55. * Born of simplicity, no frills
  56. * Lightweight, fast and flexible
  57. * Focused on performance and security
  58. * Loads CSS/JS assets only when required
  59. * Adheres to HTML coding best practices
  60. _Prismatic escapes only the essentials to keep your code clean._
  61. [Check out the screenshots](https://wordpress.org/plugins/prismatic/screenshots/) for more details!
  62. == Screenshots ==
  63. 1. Prismatic General Settings
  64. 2. Prismatic Prism.js Settings
  65. 3. Prismatic Highlight.js Settings
  66. 4. Prismatic Plain Flavor Settings
  67. 5. Prism.js : Twilight theme (choose from 7 Prism.js themes!)
  68. 6. Highlight.js : Arduino Light theme (choose from 77 Highlight.js themes!)
  69. 7. Highlight.js : Gruvbox Dark theme (choose from 77 Highlight.js themes!)
  70. 8. Cleanly escaped code without syntax highlighting (Plain Flavor)
  71. == Installation ==
  72. **Installing Prismatic**
  73. 1. Make a backup of your database
  74. 2. Upload the plugin to your blog and activate
  75. 3. Visit the plugin settings to configure options
  76. __Note:__ Please read the section below on "code escaping" to understand how it works.
  77. _[More info on installing WP plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins)_
  78. **Uninstalling**
  79. Prismatic cleans up after itself. All plugin settings will be removed from your database when the plugin is uninstalled via the Plugins screen.
  80. **Restore Default Options**
  81. To restore default plugin options, either uninstall/reinstall the plugin or visit the Prismatic General Settings > Restore default plugin options.
  82. **Usage: Syntax Highlighting**
  83. The Prismatic plugin follows the same conventions used by [Prism.js](http://prismjs.com/) and [Highlight.js](https://highlightjs.org/). Here are the basic steps:
  84. 1. Visit the Prismatic General Settings and choose your library
  85. 2. Visit the settings tab for your chosen library
  86. 3. Choose a theme and configure your options
  87. Once the settings are configured, you can enable syntax highlighting for any code snippet by doing one of the following:
  88. * Wrap multi-line code with pre & code tags: <pre><code>...</code></pre>
  89. * Wrap single-line code with code tags: <code>...</code>
  90. Note: Prism.js highlights both multi-line and single-line code snippets. Highlight.js only supports multi-line code snippets.
  91. With the proper markup in place, you can indicate a specific language by adding a class of language-*** or lang-*** to the <code> tag (where *** is the language identifier). For example, to indicate PHP as the language for a single-line code snippet:
  92. <code class="language-php"><?php echo 'Hello world'; ?></code>
  93. Likewise, to indicate HTML as the language for a multi-line code snippet (note: if you are reading this plugin's raw readme.txt file, [click here](https://wordpress.org/plugins/prismatic/installation/) to read the formatted text):
  94. <pre><code class="language-html">
  95. <table>
  96. <tr>
  97. <th>Name</th>
  98. <th>Side</th>
  99. <th>Role</th>
  100. <tr>
  101. <td>Darth</td>
  102. <td>Dark</td>
  103. <td>Sith</td>
  104. </tr>
  105. </table>
  106. </code></pre>
  107. So the prefix of the class names are the same for Prism.js and Highlight.js. The difference is the language identifier used to specify each language. Check out the following "About Prism.js" and "About Highlight.js" sections for more information.
  108. __Note:__ In addition to detecting the language- and lang- prefixes, Highlight.js also will try to auto-detect the language without it being specified. Plus as an option, you can enable the Highlight.js setting, "Support no-prefix class names" to enable use of language identifiers without any language- or lang- prefix.
  109. **Usage: Code escaping**
  110. Just like Prism.js and Highlight.js, the Prismatic plugin follows HTML coding standards. To enable code escaping:
  111. 1. Visit the Prismatic General Settings and choose your library
  112. 2. Enable "Code Escaping" via the settings tab of your chosen library
  113. 3. Do one of the following:]
  114. * Wrap multi-line code with pre &amp; code tags: &lt;pre&gt;&lt;code&gt;...&lt;/code&gt;&lt;/pre&gt;
  115. * Wrap single-line code with code tags: &lt;code&gt;...&lt;/code&gt;
  116. For example, the code snippets included in either of the following markup examples would be escaped:
  117. This is a single-line example, &lt;code&gt;&lt;?php echo 'Hello world'; ?&gt;&lt;/code&gt;.
  118. This is a multi-line code example (note: if you are reading this plugin's raw readme.txt file, [click here](https://wordpress.org/plugins/prismatic/installation/) to read the formatted text):
  119. &lt;pre&gt;&lt;code&gt;<br>
  120. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table&gt;<br>
  121. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
  122. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Name&lt;/th&gt;<br>
  123. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Side&lt;/th&gt;<br>
  124. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Role&lt;/th&gt;<br>
  125. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>
  126. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Darth&lt;/td&gt;<br>
  127. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Dark&lt;/td&gt;<br>
  128. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Sith&lt;/td&gt;<br>
  129. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>
  130. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br>
  131. &lt;/code&gt;&lt;/pre&gt;
  132. So what exactly happens when the "Code Escaping" options are enabled? Here is a summary that applies to each section (post content, excerpts, and comments):
  133. * __Frontend only__ - code snippets are escaped at runtime (no changes made to content in the database)
  134. * __Admin Area only__ - code snippets are escaped when viewed via the Admin Area (changes will be saved to database if the "Update" or "Publish" button is clicked)
  135. * __Frontend &amp; Admin Area__ - both of the previous are applied
  136. * __None__ - all code escaping is disabled
  137. Note that each library -- Prism.js, Highlight.js, and Plain Flavor -- features its own code-escape settings. So the code-escape settings that are applied depends on the currently active library. Visit the plugin's General Settings to choose your library. Then visit that library's tab to configure its code-escape settings.
  138. When code escaping is enabled for either/both the frontend or Admin Area, the plugin makes the following changes to any code contained within &lt;code&gt;&lt;/code&gt; tags:
  139. \r removed
  140. & replaced with &amp;
  141. < replaced with &lt;
  142. > replaced with &gt;
  143. trailing whitespace removed
  144. These are the _only_ changes made to your code, no other changes are made.
  145. As mentioned, the difference between code escaping on the frontend vs. the Admin Area is that, on the frontend, the above changes are made at runtime and not saved to the database; whereas in the Admin Area, the changes are made when the code is viewed via a content editor, such that any changes made will be saved to the database when the user clicks the "Update" or "Publish" button. Please keep this in mind when choosing your code-escape settings.
  146. __Important!__ As explained, enabling code escaping in the Admin Area may result in the escaped code getting saved in the database. This is fine in most cases, but there may be situations where escaping should only happen at runtime. If that is the case, or if you are unsure, choose the "Frontend only" option for the "Code Escaping" setting. The "Frontend only" option only modifies code when displayed on the frontend and does not save any changes to the database.
  147. **About Prism.js**
  148. Prism.js version used in Prismatic plugin: __1.5.1__
  149. __Prism.js resources__
  150. * [Homepage](http://prismjs.com/)
  151. * [GitHub](https://github.com/PrismJS/prism)
  152. * [Changelog](https://github.com/PrismJS/prism/blob/gh-pages/CHANGELOG.md)
  153. __License &amp; Info__
  154. /*
  155. Prism: Lightweight, robust, elegant syntax highlighting
  156. MIT license http://www.opensource.org/licenses/mit-license.php/
  157. @author Lea Verou http://lea.verou.me
  158. */
  159. __Supported Languages__
  160. Language Class
  161. Apache = apacheconf
  162. AppleScript = applescript
  163. Bash = bash
  164. C = c
  165. C# = csharp
  166. C++ = cpp
  167. C-like = clike
  168. CoffeeScript = coffeescript
  169. CSS = css
  170. Diff = diff
  171. Git = git
  172. HTTP = http
  173. Ini = ini
  174. Java = java
  175. JavaScript = javascript
  176. JSON = json
  177. Makefile = makefile
  178. Markdown = markdown
  179. Markup = markup
  180. NGINX = nginx
  181. Objective-C = objectivec
  182. Perl = perl
  183. PHP = php
  184. Python = python
  185. Ruby = ruby
  186. SASS = sass
  187. SCSS = scss
  188. SQL = sql
  189. Twig = twig
  190. YAML = yaml
  191. So for example, to specify a code block as C++, you would write:
  192. Single line: <code class="language-cpp">...</code>
  193. Multi-line: <pre><code class="language-cpp">...</code></pre>
  194. To disable Prism.js syntax highlighting for any code block, simply omit the language class.
  195. _I'm glad to add more languages, [make a suggestion](https://perishablepress.com/contact/)_
  196. **About Highlight.js**
  197. Highlight.js version used in Prismatic plugin: __9.7.0__
  198. __Highlight.js resources__
  199. * [Homepage](https://highlightjs.org/)
  200. * [GitHub](https://github.com/isagalaev/highlight.js)
  201. * [Changelog](https://github.com/isagalaev/highlight.js/blob/master/CHANGES.md)
  202. __License &amp; Info__
  203. /*
  204. Syntax highlighting with language autodetection.
  205. Copyright (c) 2006, Ivan Sagalaev https://highlightjs.org/
  206. All rights reserved. BSD3 License @ https://git.io/hljslicense
  207. */
  208. __Supported Languages__
  209. Language Class
  210. Apache = apache, apacheconf
  211. Bash = bash, sh, zsh
  212. C# = cs, csharp
  213. C++ = cpp, c, cc, h, c++, h++, hpp
  214. CSS = css
  215. CoffeeScript = coffeescript, coffee, cson, iced
  216. Diff = diff, patch
  217. HTML/XML = xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist
  218. HTTP = http, https
  219. Ini = ini
  220. JSON = json
  221. Java = java, jsp
  222. JavaScript = javascript, js, jsx
  223. Makefile = makefile, mk, mak
  224. Markdown = markdown, md, mkdown, mkd
  225. Nginx = nginx, nginxconf
  226. Objective-C = objectivec, mm, objc, obj-c
  227. PHP = php, php3, php4, php5, php6
  228. Perl = perl, pl, pm
  229. Python = python, py, gyp
  230. Ruby = ruby, rb, gemspec, podspec, thor, irb
  231. SQL = sql
  232. So for example, to specify a code block as C++, you would write:
  233. Single line: <code class="language-cpp">...</code>
  234. Multi-line: <pre><code class="language-cpp">...</code></pre>
  235. To disable Highlight.js syntax highlighting for any code block, add a class of `nohighlight`, like so:
  236. <code class="nohighlight">...</code>
  237. _I'm glad to add more languages, [make a suggestion](https://perishablepress.com/contact/)_
  238. == Upgrade Notice ==
  239. To upgrade Prismatic, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.
  240. __Note:__ uninstalling the plugin from the WP Plugins screen results in the removal of all settings from the WP database.
  241. == Frequently Asked Questions ==
  242. **Can you add another language for Prism.js or Highlight.js?**
  243. Yes, feel free to [suggest a language](https://perishablepress.com/contact/)
  244. **Got a question?**
  245. Send any questions or feedback via my [contact form](https://perishablepress.com/contact/)
  246. == Support development of this plugin ==
  247. I develop and maintain this free plugin with love for the WordPress community. To show support, you can [make a cash donation](http://m0n.co/donate), [bitcoin donation](http://m0n.co/bitcoin), or purchase one of my books:
  248. * [The Tao of WordPress](https://wp-tao.com/)
  249. * [Digging into WordPress](https://digwp.com/)
  250. * [.htaccess made easy](https://htaccessbook.com/)
  251. * [WordPress Themes In Depth](https://wp-tao.com/wordpress-themes-book/)
  252. And/or purchase one of my premium WordPress plugins:
  253. * [BBQ Pro](https://plugin-planet.com/bbq-pro/) - Pro version of Block Bad Queries
  254. * [SES Pro](https://plugin-planet.com/ses-pro/) - Super-simple &amp; flexible email signup forms
  255. * [USP Pro](https://plugin-planet.com/usp-pro/) - Pro version of User Submitted Posts
  256. Links, tweets and likes also appreciated. Thank you! :)
  257. == Changelog ==
  258. **1.0 (2016/10/21)**
  259. * Initial release