This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
136 lines (88 loc) · 3.84 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
=== Plugin Name ===
Contributors: apfelbox
Tags: prism, syntax highlighting
Requires at least: 3.4.0
Tested up to: 3.5.2
Stable tag: 1.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Adds Prism Syntax Highlighting to WordPress, using custom fields for your code examples.
== Description ==
Integrates the [Prism Syntax Highlighting Library](https://github.com/LeaVerou/prism) in WordPress.
It is called *detached*, since the code examples are not stuffed into the rich text editor, together with all the
other texts and content, but they are added separately as custom fields and just referenced via short tags (like footnotes).
Check *Other Notes* for usage documentation.
The official development repository is [hosted on Github](https://github.com/apfelbox/Prism-Detached).
== Installation ==
1. Upload the files to your `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
== Frequently Asked Questions ==
= Why use custom tags? =
The (rich text) editor of WordPress is quite good in mangling in manually added code. This cannot happen with custom fields.
Also, I personally, think it is more user-friendly.
== Screenshots ==
1. Add the code as custom field and reference it in the rich text editor via shortcode.
2. Code highlighting in the frontend
3. You can also specify some lines, which should be marked
4. Code highlighting with marked lines in the frontend
5. Plugin options screen
== Changelog ==
= 1.5 =
* Updated PrismJS to commit: 07c0f4f6b2
* Added plugin descriptions
* Added new plugins: File Highlight, WebPlatform Docs
* Added language-code descriptions
* Added new languages: Bash (Unix Shell), C, C-like, Coffeescript, C++, Groovy, PHP, Python, Sassy CSS, and SQL
* Added new themes: Okaida, Tomorrow, Twilight
** 1.5 update brought to you by JC John Sese Cuneta (http://jcsesecuneta.com) ** thank you!
= 1.4 =
* Fixed a compatibility problem with older PHP versions (< 5.4)
= 1.3 =
* Minor optical updates of the admin interface
* Refactored nearly complete plugin
* Added support for generic extensions
* Added cached assets loader
* Added support for experimental PHP plugin
= 1.2 =
* Updated the prism library to `34f0bd5247`
= 1.1 =
* Load line-highlight correctly
* Moved html attributes to the correct tag
* Fixed wrong asset loading
= 1.0 =
* Initial commit
== Upgrade Notice ==
No upgrade notice yet, just use it and give feedback. :-)
== Usage ==
The basic procedure is:
1. Create a custom field and paste the code into it.
2. Insert the `[prism ...]` shorttag in your code, where you want the code block to appear.
= Shorttag =
`[prism key=".." language=".." line=".." line_offset=".." post=".."]`
* `key`: the name of the custom field, which contains the code (**required**)
* `language`: the language to highlight
* `line`: highlighted lines (for syntax, check the [offical docs](http://prismjs.com/plugins/line-highlight/))
* `line_offset`: the offset, with which the line numbering should start
* `post`: if you want to include a code piece of another post, you can explicitly specify the post id here
= Cached Assets loader =
The plugin includes (from v1.3 on) a cached assets loader, so that all needed assets are concatenated into
one js and one css file to minimize the HTTP requests.
To make use of the cached assets loader, just create a directory `/cache/` inside your plugin directory and make it writable for PHP.
= Supported languages =
Only the ones from the official PrismJS repository
* bash (Bash Unix Shell)
* c
* clike
* coffeescript
* cpp (C++)
* css
* groovy
* java
* javascript
* markup (like: xHTML, MathML, SVG, LaTeX, RSS, XML, OWL, etc.)
* php
* python
* scss (Sassy CSS)
* sql
= Creating Custom Extensions =
Please read the wiki page: [Creating A Custom Extension](https://github.com/apfelbox/Prism-Detached/wiki/Creating-A-Custom-Extension).