25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.txt 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. === Prismatic ===
  2. Plugin Name: Prismatic
  3. Plugin URI: https://perishablepress.com/prismatic/
  4. Description: Display beautiful syntax-highlighted code snippets with Prism.js or Highlight.js
  5. Tags: code, snippets, syntax, highlight, language, snippet, pre, prettify, prism, css, fence
  6. Author: Jeff Starr
  7. Contributors: specialk
  8. Author URI: https://plugin-planet.com/
  9. Donate link: https://m0n.co/donate
  10. Requires at least: 4.1
  11. Tested up to: 4.9
  12. Stable tag: 1.6
  13. Version: 1.6
  14. Requires PHP: 5.2
  15. Text Domain: prismatic
  16. Domain Path: /languages
  17. License: GPL v2 or later
  18. Display beautiful syntax-highlighted code snippets with Prism.js or Highlight.js
  19. == Description ==
  20. > GDPR-compliant: Prismatic does not collect any user data
  21. __The only 3-in-1 syntax highlighter!__
  22. Display beautiful code snippets with Prism.js, Highlight.js, or plain code escaping:
  23. * __Prism.js__ - Code escape + syntax highlight using [Prism.js](http://prismjs.com/)
  24. * __Highlight.js__ - Code escape + syntax highlight using [Highlight.js](https://highlightjs.org/)
  25. * __Plain Flavor__ - Code escape without syntax highlight (for custom styles)
  26. **Prism.js Features**
  27. * Supports __41__ coding languages
  28. * Choose from all __8__ available Prism themes
  29. * Enable Prism plugin [Line Numbers](http://prismjs.com/plugins/line-numbers/)
  30. * Enable Prism plugin [Line Highlight](http://prismjs.com/plugins/line-highlight/)
  31. * Enable Prism plugin [Show Language](http://prismjs.com/plugins/show-language/)
  32. * Highlights code in post content, excerpts, and comments
  33. * Detects `language-` and `lang-` class prefixes
  34. * Limit syntax highlighting to Posts and Pages
  35. * Highlight single-line and multi-line code
  36. * Granular control over code escaping
  37. * Smart loading of CSS & JS assets
  38. **Highlight.js Features**
  39. * Supports __31__ coding languages
  40. * Choose from all __79__ available Highlight themes
  41. * Customize the Highlight.js init JavaScript
  42. * Highlights code in post content, excerpts, and comments
  43. * Limit syntax highlighting to Posts and Pages
  44. * Highlight multi-line blocks of code
  45. * Detects `language-` and `lang-` class prefixes
  46. * Enable support for no-prefix class names
  47. * Granular control over code escaping
  48. * Smart loading of CSS & JS assets
  49. **Plain Flavor Features**
  50. * Enable code escaping for post content, excerpts, and/or comments
  51. * Enable code escaping on the frontend, Admin Area, or both
  52. * Escapes single-line and multi-line code snippets
  53. **General Features**
  54. * Easy to set up & configure
  55. * Built with the WordPress API
  56. * Squeaky clean, error-free code
  57. * Born of simplicity, no frills
  58. * Lightweight, fast and flexible
  59. * Focused on performance and security
  60. * Loads CSS/JS assets only when required
  61. * Adheres to HTML coding best practices
  62. * Regularly updated and "future proof"
  63. _Prismatic escapes only the essentials to keep your code clean._
  64. [Check out the screenshots](https://wordpress.org/plugins/prismatic/screenshots/) for more details!
  65. == Screenshots ==
  66. 1. Prismatic General Settings
  67. 2. Prismatic Prism.js Settings
  68. 3. Prismatic Highlight.js Settings
  69. 4. Prismatic Plain Flavor Settings
  70. 5. Prism.js : Twilight theme (choose from 7 Prism.js themes!)
  71. 6. Highlight.js : Arduino Light theme (choose from 77 Highlight.js themes!)
  72. 7. Highlight.js : Gruvbox Dark theme (choose from 77 Highlight.js themes!)
  73. 8. Cleanly escaped code without syntax highlighting (Plain Flavor)
  74. == Installation ==
  75. **Installing Prismatic**
  76. 1. Make a backup of your database
  77. 2. Upload the plugin to your blog and activate
  78. 3. Visit the plugin settings to configure options
  79. __Note:__ Please read the section below on "code escaping" to understand how it works.
  80. _[More info on installing WP plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins)_
  81. **Uninstalling**
  82. Prismatic cleans up after itself. All plugin settings will be removed from your database when the plugin is uninstalled via the Plugins screen.
  83. **Restore Default Options**
  84. To restore default plugin options, either uninstall/reinstall the plugin or visit the Prismatic General Settings > Restore default plugin options.
  85. **Usage: Syntax Highlighting**
  86. 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:
  87. 1. Visit the Prismatic General Settings and choose your library
  88. 2. Visit the settings tab for your chosen library
  89. 3. Choose a theme and configure your options
  90. Once the settings are configured, you can enable syntax highlighting for any code snippet by doing one of the following:
  91. * Wrap multi-line code with pre & code tags: <pre><code>...</code></pre>
  92. * Wrap single-line code with code tags: <code>...</code>
  93. __Note:__ Prism.js highlights both multi-line and single-line code snippets. Highlight.js only supports multi-line code snippets.
  94. With the proper markup in place, you can indicate a specific language by adding a class of `language-abc` or `lang-abc` to the <code> tag (where "abc" is the language identifier). For example, to indicate PHP as the language for a single-line code snippet:
  95. <code class="language-php"><?php echo 'Hello world'; ?></code>
  96. Likewise, to indicate HTML as the language for a multi-line code snippet:
  97. <pre><code class="language-html">
  98. <table>
  99. <tr>
  100. <th>Name</th>
  101. <th>Side</th>
  102. <th>Role</th>
  103. <tr>
  104. <td>Darth</td>
  105. <td>Dark</td>
  106. <td>Sith</td>
  107. </tr>
  108. </table>
  109. </code></pre>
  110. Alternately, the language class may be placed on the &lt;pre&gt; tag, for example:
  111. <pre class="language-html"><code>
  112. <table>
  113. <tr>
  114. <th>Name</th>
  115. <th>Side</th>
  116. <th>Role</th>
  117. <tr>
  118. <td>Darth</td>
  119. <td>Dark</td>
  120. <td>Sith</td>
  121. </tr>
  122. </table>
  123. </code></pre>
  124. Basically, the prefix of the class names (i.e., "lang-" or "language-") are the same for Prism.js and Highlight.js. The difference is the language identifier (e.g., "css" or "html") used to specify each language. Check out the following "About Prism.js" and "About Highlight.js" sections for more information.
  125. __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.
  126. > Pro Tip: For both Prism.js and Highlight.js, language class names also work when added to the &lt;pre&gt; tag.
  127. **Usage: Code escaping**
  128. Just like Prism.js and Highlight.js, the Prismatic plugin follows HTML coding standards. To enable code escaping:
  129. 1. Visit the Prismatic General Settings and choose your library
  130. 2. Enable "Code Escaping" via the settings tab of your chosen library
  131. 3. Do one of the following:
  132. * Wrap multi-line code with pre &amp; code tags: &lt;pre&gt;&lt;code&gt;...&lt;/code&gt;&lt;/pre&gt;
  133. * Wrap single-line code with code tags: &lt;code&gt;...&lt;/code&gt;
  134. For example, the code snippets included in either of the following markup examples would be escaped (note that the class attribute is not required for code escaping).
  135. This is a single-line example:
  136. <code class="language-php"><?php echo 'Hello world'; ?></code>
  137. This is a multi-line code example:
  138. <pre><code class="language-html">
  139. <table>
  140. <tr>
  141. <th>Name</th>
  142. <th>Side</th>
  143. <th>Role</th>
  144. <tr>
  145. <td>Darth</td>
  146. <td>Dark</td>
  147. <td>Sith</td>
  148. </tr>
  149. </table>
  150. </code></pre>
  151. 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):
  152. * __Frontend only__ - code snippets are escaped at runtime (no changes made to content in the database)
  153. * __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)
  154. * __Frontend &amp; Admin Area__ - both of the previous are applied
  155. * __None__ - all code escaping is disabled
  156. Note that each library &mdash; Prism.js, Highlight.js, and Plain Flavor &mdash; 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.
  157. 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:
  158. \r removed
  159. & replaced with &amp;
  160. < replaced with &lt;
  161. > replaced with &gt;
  162. trailing whitespace removed
  163. These are the _only_ changes made to your code, no other changes are made.
  164. 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.
  165. __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.
  166. **About Prism.js**
  167. Prism.js version used in Prismatic plugin: __1.14.0__
  168. __Prism.js resources__
  169. * [Homepage](http://prismjs.com/)
  170. * [GitHub](https://github.com/PrismJS/prism)
  171. * [Changelog](https://github.com/PrismJS/prism/blob/gh-pages/CHANGELOG.md)
  172. __License &amp; Info__
  173. /*
  174. Prism: Lightweight, robust, elegant syntax highlighting
  175. MIT license http://www.opensource.org/licenses/mit-license.php/
  176. @author Lea Verou http://lea.verou.me
  177. */
  178. __Supported Languages__
  179. Language Class
  180. Apache = apacheconf
  181. AppleScript = applescript
  182. Bash = bash
  183. C = c
  184. C# = csharp
  185. C++ = cpp
  186. C-like = clike
  187. CoffeeScript = coffeescript
  188. CSS = css
  189. Diff = diff
  190. Git = git
  191. Go = go
  192. GraphQL = graphql
  193. Groovy = groovy
  194. HTTP = http
  195. Ini = ini
  196. Java = java
  197. JavaScript = javascript
  198. JSON = json
  199. Kotlin = kotlin
  200. LaTeX = latex
  201. Lua = lua
  202. Makefile = makefile
  203. Markdown = markdown
  204. Markup = markup
  205. NGINX = nginx
  206. Objective-C = objectivec
  207. Pascal = pascal
  208. Perl = perl
  209. PHP = php
  210. PowerShell = powershell
  211. Python = python
  212. Ruby = ruby
  213. SASS = sass
  214. SCSS = scss
  215. SQL = sql
  216. Swift = swift
  217. Twig = twig
  218. TypeScript = typescript
  219. Visual Basic = visual-basic
  220. YAML = yaml
  221. So for example, to specify a code block as C++, you would write:
  222. Single line: <code class="language-cpp">...</code>
  223. Multi-line: <pre><code class="language-cpp">...</code></pre>
  224. Alternate: <pre class="language-cpp"><code>...</code></pre>
  225. To disable Prism.js syntax highlighting for any snippet, simply omit the language class.
  226. _I'm glad to add more languages, [make a suggestion](https://perishablepress.com/contact/)_
  227. **About Highlight.js**
  228. Highlight.js version used in Prismatic plugin: __9.12.0__
  229. __Highlight.js resources__
  230. * [Homepage](https://highlightjs.org/)
  231. * [GitHub](https://github.com/isagalaev/highlight.js)
  232. * [Changelog](https://github.com/isagalaev/highlight.js/blob/master/CHANGES.md)
  233. __License &amp; Info__
  234. /*
  235. Syntax highlighting with language autodetection.
  236. Copyright (c) 2006, Ivan Sagalaev https://highlightjs.org/
  237. All rights reserved. BSD3 License @ https://git.io/hljslicense
  238. */
  239. __Supported Languages__
  240. Language Class
  241. Apache = apache, apacheconf
  242. AppleScript = applescript, osascript
  243. Bash = bash, sh, zsh
  244. C# = cs, csharp
  245. C++ = cpp, c, cc, h, c++, h++, hpp
  246. CSS = css
  247. CoffeeScript = coffeescript, coffee, cson, iced
  248. Diff = diff, patch
  249. Go = go, golang
  250. Groovy = groovy
  251. HTML/XML = xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist
  252. HTTP = http, https
  253. Ini = ini
  254. JSON = json
  255. Java = java, jsp
  256. JavaScript = javascript, js, jsx
  257. Kotlin = kotlin
  258. Lua = lua
  259. Makefile = makefile, mk, mak
  260. Markdown = markdown, md, mkdown, mkd
  261. Nginx = nginx, nginxconf
  262. Objective-C = objectivec, mm, objc, obj-c
  263. PHP = php, php3, php4, php5, php6
  264. Perl = perl, pl, pm
  265. PowerShell = powershell, ps
  266. Python = python, py, gyp
  267. Ruby = ruby, rb, gemspec, podspec, thor, irb
  268. Shell Session = shell
  269. SQL = sql
  270. Swift = swift
  271. TypeScript = typescript, ts
  272. So for example, to specify a code block as C++, you would write:
  273. Single line: <code class="language-cpp">...</code>
  274. Multi-line: <pre><code class="language-cpp">...</code></pre>
  275. Alternate: <pre class="language-cpp"><code>...</code></pre>
  276. To disable Highlight.js syntax highlighting for any code block, add a class of `nohighlight`, like so:
  277. <code class="nohighlight">...</code>
  278. _I'm glad to add more languages, [make a suggestion](https://perishablepress.com/contact/)_
  279. == Upgrade Notice ==
  280. 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.
  281. __Note:__ uninstalling the plugin from the WP Plugins screen results in the removal of all settings from the WP database.
  282. == Frequently Asked Questions ==
  283. **Can you add another language for Prism.js or Highlight.js?**
  284. Yes, feel free to [suggest a language](https://perishablepress.com/contact/)
  285. **Got a question?**
  286. Send any questions or feedback via my [contact form](https://perishablepress.com/contact/)
  287. == Support development of this plugin ==
  288. I develop and maintain this free plugin with love for the WordPress community. To show support, you can [make a cash donation](https://m0n.co/donate), [bitcoin donation](https://m0n.co/bitcoin), or purchase one of my books:
  289. * [The Tao of WordPress](https://wp-tao.com/)
  290. * [Digging into WordPress](https://digwp.com/)
  291. * [.htaccess made easy](https://htaccessbook.com/)
  292. * [WordPress Themes In Depth](https://wp-tao.com/wordpress-themes-book/)
  293. And/or purchase one of my premium WordPress plugins:
  294. * [BBQ Pro](https://plugin-planet.com/bbq-pro/) - Super fast WordPress firewall
  295. * [Blackhole Pro](https://plugin-planet.com/blackhole-pro/) - Automatically block bad bots
  296. * [Banhammer Pro](https://plugin-planet.com/banhammer-pro/) - Monitor traffic and ban the bad guys
  297. * [USP Pro](https://plugin-planet.com/usp-pro/) - Unlimited front-end forms
  298. Links, tweets and likes also appreciated. Thank you! :)
  299. == Changelog ==
  300. **1.6 (2018/05/07)**
  301. * Updates Prism.js from 1.11 to 1.14
  302. * Adds VBA `visual-basic` and Pascal `pascal`
  303. * Adds new Prism theme: "Tomorrow Night"
  304. * Improves support for Gutenberg Editor
  305. * Adds support for Go langauge (golang)
  306. * Updates Prism.js to version 1.11.0
  307. * Removes unused font file, `FontAwesome.otf`
  308. * Tests on WordPress 5.0 (alpha)
  309. **1.5 (2017/10/22)**
  310. * Adds "Requires PHP" to plugin file headers
  311. * Tests on WordPress 4.9
  312. **1.4 (2017/07/31)**
  313. * Fixes several PHP Warnings
  314. * Updates Highlight.js to version 9.12.0
  315. * Adds new languages for Highlight.js and Prism.js
  316. * Adds GPL license text file
  317. * Tests on WordPress 4.9 (alpha)
  318. **1.3 (2017/03/24)**
  319. * Updates some URLs to HTTPS
  320. * Updates Prism.js to version 1.6
  321. * Updates Highlight.js to version 9.11.0
  322. * Adds new languages for Highlight.js and Prism.js
  323. * Tweaks plugin settings styles
  324. * Replaces global `$wp_version` with `get_bloginfo('version')`
  325. * Tests on WordPress version 4.8
  326. **1.2 (2016/11/16)**
  327. * Adds support for AppleScript in Highlight.js
  328. * Updates plugin URL in core files and readme.txt
  329. * Changes stable tag from trunk to latest version
  330. * Adds `&raquo;` to rate this link on Plugins screen
  331. * Adds strong tags to admin notices on settings page
  332. * Refines styles for popup dialog on settings page
  333. * Tests on WordPress version 4.7 (beta)
  334. **1.1 (2016/10/24)**
  335. * Updates/adds some links
  336. * Updates default language file
  337. * Tests on WordPress version 4.7 (alpha)
  338. **1.0 (2016/10/21)**
  339. * Initial release