Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelbox committed Jul 30, 2013
2 parents 3046162 + fc087ef commit f6d9ed0
Show file tree
Hide file tree
Showing 46 changed files with 1,113 additions and 249 deletions.
8 changes: 5 additions & 3 deletions Prism_Detached.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Plugin Name: Prism Syntax Highlighter (detached)
Plugin URI: https://github.com/apfelbox/Prism-Detached
Description: Includes the prism syntax highlighter in WordPress by using Custom Fields.
Version: 1.4
Version: 1.5
Author: Jannik Zschiesche
Update: JC John Sese Cuneta
Author URI: http://apfelbox.net
Update URI: http://jcsesecuneta.com
License: GPL2
*/

Expand All @@ -24,15 +26,15 @@ class Prism_Detached
*
* @var string
*/
const PRISM_VERSION = '34f0bd5247';
const PRISM_VERSION = '07c0f4f6b2';


/**
* The plugin version
*
* @var string
*/
const PLUGIN_VERSION = '1.4';
const PLUGIN_VERSION = '1.5';


/**
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,45 @@ To make use of the cached assets loader, just create a directory `/cache/` insid

## Supported languages

Currently only the ones from the official repository
Only the ones from the official PrismJS Git repository

* bash (Bash Unix Shell)
* c
* clike
* coffeescript
* cpp (C++)
* css
* groovy
* java
* javascript
* markup
* markup (like: xHTML, MathML, SVG, LaTeX, RSS, XML, OWL, etc.)
* php
* python
* scss (Sassy CSS)
* sql



## Supported themes

Only the ones from the official PrismJS Git repository

* Default
* Dark
* Funky
* Okaida
* Tomorrow
* Twilight


## Q&A

> Why use custom tags?
The (wysiwyg) editor of WordPress is quite good in mangling in manually added code. This cannot happen with custom fields.
The (RTE) 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
![Add the code as custom field and reference it in the wysiwyg editor via shortcode.](https://raw.github.com/apfelbox/Prism-Detached/master/screenshot-1.png)

Expand Down
29 changes: 24 additions & 5 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: apfelbox
Tags: prism, syntax highlighting
Requires at least: 3.4.0
Tested up to: 3.4.2
Stable tag: 1.4
Tested up to: 3.5.1
Stable tag: 1.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -34,7 +34,7 @@ The official development repository is [hosted on Github](https://github.com/apf

= Why use custom tags? =

The (wysiwyg) editor of WordPress is quite good in mangling in manually added code. This cannot happen with custom fields.
The (RTE) 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.


Expand All @@ -51,6 +51,15 @@ Also, I personally, think it is more user-friendly.

== 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) **

= 1.4 =
* Fixed a compatibility problem with older PHP versions (< 5.4)

Expand Down Expand Up @@ -106,9 +115,19 @@ To make use of the cached assets loader, just create a directory `/cache/` insid

= Supported languages =

Currently only the ones from the official repository
Only the ones from the official PrismJS repository

* bash (Bash Unix Shell)
* c
* clike
* coffeescript
* cpp (C++)
* css
* groovy
* java
* javascript
* markup
* markup (like: xHTML, MathML, SVG, LaTeX, RSS, XML, OWL, etc.)
* php
* python
* scss (Sassy CSS)
* sql
9 changes: 9 additions & 0 deletions lib/Prism/Detached/Extension/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ abstract public function getName ();



/**
* Returns the description of the extension
*
* @return string
*/
abstract public function getDesc ();



/**
* Returns the JavaScript files of the extension.
* The return value should be an array of relative paths to the files.
Expand Down
12 changes: 12 additions & 0 deletions lib/Prism/Detached/Extension/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ public function getName ()



/**
* Returns the name of the extension
*
* @return string
*/
public function getDesc ()
{
return 'Prism Detached Core';
}



/**
* Returns the defined JavaScripts
*
Expand Down
3 changes: 3 additions & 0 deletions lib/Prism/Detached/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class Prism_Detached_Settings
'prism' => 'Default Theme',
'prism-dark' => 'Dark',
'prism-funky' => 'Funky',
'prism-okaidia' => 'Okaidia',
'prism-tomorrow' => 'Tomorrow',
'prism-twilight' => 'Twilight',
);


Expand Down
23 changes: 17 additions & 6 deletions templates/admin_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@

<h3 style="margin-top: 40px;">Prism Core Supported languages</h3>
<ul class="ul-disc">
<li><code>css</code></li>
<li><code>java</code></li>
<li><code>javascript</code></li>
<li><code>markup</code></li>
<li><code>bash</code> - Bash (Unix Shell) script</li>
<li><code>c</code> - C programming language</li>
<li><code>clike</code> - C-like</li>
<li><code>coffeescript</code> - Coffeescript</li>
<li><code>cpp</code> - C++ programming language</li>
<li><code>css</code> - CSS</li>
<li><code>groovy</code> - Groovy</li>
<li><code>java</code> - Java</li>
<li><code>javascript</code> - JavaScript</li>
<li><code>markup</code> - markup languages: (X)HTML, XML, MathML, TeX, LaTeX, XForms, SOAP, OWL, RDF/XML, CFML, Markdown, SVG, BBCode, Wiki, Atom, RSS, etc.</li>
<li><code>php</code> - PHP</li>
<li><code>python</code> - Python</li>
<li><code>scss</code> - Sassy CSS</li>
<li><code>sql</code> - SQL</li>
</ul>


Expand Down Expand Up @@ -50,10 +60,11 @@
<?php foreach ($availableExtensions as $extension) : ?>
<tr>
<th scope="row">
<label for="extension-<?php echo esc_attr($extension->getId()); ?>"><?php echo esc_html($extension->getName()); ?></label>
<input type="checkbox" name="prism_detached_extensions[<?php echo esc_attr($extension->getId()); ?>]" id="extension-<?php echo esc_attr($extension->getId()); ?>" value="1"<?php if ($extension->isActive()) : ?> checked="checked"<?php endif; ?> />
<label for="extension-<?php echo esc_attr($extension->getId()); ?>"><b><?php echo esc_html($extension->getName()); ?></b></label>
</th>
<td>
<input type="checkbox" name="prism_detached_extensions[<?php echo esc_attr($extension->getId()); ?>]" id="extension-<?php echo esc_attr($extension->getId()); ?>" value="1"<?php if ($extension->isActive()) : ?> checked="checked"<?php endif; ?> />
<?php echo $extension->getDesc(); ?>
</td>
</tr>
<?php endforeach; ?>
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions vendor/extensions/Language_PHP/css/prism-dark.css

This file was deleted.

1 change: 0 additions & 1 deletion vendor/extensions/Language_PHP/css/prism-dark.min.css

This file was deleted.

13 changes: 0 additions & 13 deletions vendor/extensions/Language_PHP/css/prism-funky.css

This file was deleted.

1 change: 0 additions & 1 deletion vendor/extensions/Language_PHP/css/prism-funky.min.css

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/extensions/Language_PHP/css/prism.css

This file was deleted.

1 change: 0 additions & 1 deletion vendor/extensions/Language_PHP/css/prism.min.css

This file was deleted.

1 change: 0 additions & 1 deletion vendor/extensions/Language_PHP/js/prism-php.min.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@ class Prism_Detached_Extension_Prism_Autolinker extends Prism_Detached_Extension
*/
public function getName ()
{
return "Plugin: Autolinker";
return 'Plugin: Autolinker';
}



/**
* Returns the name of the extension
*
* @return string
*/
public function getDesc ()
{
return 'Converts URLs and emails in code to clickable links. Parses <a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a> links in comments.
<p>URLs and emails will be linked automatically, you don\'t need to do anything. To link some text inside a comment to a certain URL, you may use the Markdown syntax: <pre><code class="language-markdown">[Text you want to see](http://url-goes-here.com)</code></pre></p>
';
}


Expand All @@ -38,7 +52,7 @@ public function getSortOrder ()
public function getCss ()
{
return array(
"css/prism-autolinker.min.css"
'css/prism-autolinker.min.css'
);
}

Expand All @@ -52,7 +66,7 @@ public function getCss ()
public function getJavascript ()
{
return array(
"js/prism-autolinker.min.js"
'js/prism-autolinker.min.js'
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.token a{color:inherit}
.token a{color:inherit;}
2 changes: 1 addition & 1 deletion vendor/extensions/Prism_Autolinker/js/prism-autolinker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(){

if (!window.Prism) {
if (!self.Prism) {
return;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f6d9ed0

Please sign in to comment.