Title: Prism Syntax Highlighter (detached)
Author: apfelbox
Published: <strong>2012年9月4日</strong>
Last modified: 2013年7月30日

---

プラグインを検索

![](https://ps.w.org/prism-detached/assets/banner-772x250.png?rev=594348)

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://s.w.org/plugins/geopattern-icon/prism-detached_090c0c.svg)

# Prism Syntax Highlighter (detached)

 作者: [apfelbox](https://profiles.wordpress.org/apfelbox/)

[ダウンロード](https://downloads.wordpress.org/plugin/prism-detached.1.5.zip)

 * [詳細](https://ja.wordpress.org/plugins/prism-detached/#description)
 * [レビュー](https://ja.wordpress.org/plugins/prism-detached/#reviews)
 *  [インストール](https://ja.wordpress.org/plugins/prism-detached/#installation)
 * [開発](https://ja.wordpress.org/plugins/prism-detached/#developers)

 [サポート](https://wordpress.org/support/plugin/prism-detached/)

## 説明

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).

### 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).

## スクリーンショット

[⌊Add the code as custom field and reference it in the rich text editor via shortcode.⌉⌊
Add the code as custom field and reference it in the rich text editor via shortcode
.⌉[

Add the code as custom field and reference it in the rich text editor via shortcode.

[⌊Code highlighting in the frontend⌉⌊Code highlighting in the frontend⌉[

Code highlighting in the frontend

[⌊You can also specify some lines, which should be marked⌉⌊You can also specify 
some lines, which should be marked⌉[

You can also specify some lines, which should be marked

[⌊Code highlighting with marked lines in the frontend⌉⌊Code highlighting with marked
lines in the frontend⌉[

Code highlighting with marked lines in the frontend

[⌊Plugin options screen⌉⌊Plugin options screen⌉[

Plugin options screen

## インストール

 1. Upload the files to your `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## FAQ

  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.

## 評価

このプラグインにはレビューがありません。

## 貢献者と開発者

Prism Syntax Highlighter (detached) はオープンソースソフトウェアです。以下の人々
がこのプラグインに貢献しています。

貢献者

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

[“Prism Syntax Highlighter (detached)” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/prism-detached)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/prism-detached/)するか、
[SVN リポジトリ](https://plugins.svn.wordpress.org/prism-detached/)をチェックする
か、[開発ログ](https://plugins.trac.wordpress.org/log/prism-detached/)を [RSS](https://plugins.trac.wordpress.org/log/prism-detached/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 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

## メタ

 *  バージョン **1.5**
 *  最終更新日 **13年前**
 *  有効インストール数 **10+**
 *  WordPress バージョン ** 3.4.0またはそれ以降 **
 *  検証済み最新バージョン: **3.5.2**
 *  言語
 * [English (US)](https://wordpress.org/plugins/prism-detached/)
 * タグ
 * [prism](https://ja.wordpress.org/plugins/tags/prism/)[syntax highlighting](https://ja.wordpress.org/plugins/tags/syntax-highlighting/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/prism-detached/advanced/)

## 評価

 5つ星中5つ星

 *  [  3 5-星レビュー     ](https://wordpress.org/support/plugin/prism-detached/reviews/?filter=5)
 *  [  0 4-星レビュー     ](https://wordpress.org/support/plugin/prism-detached/reviews/?filter=4)
 *  [  0 3-星レビュー     ](https://wordpress.org/support/plugin/prism-detached/reviews/?filter=3)
 *  [  0 2-星レビュー     ](https://wordpress.org/support/plugin/prism-detached/reviews/?filter=2)
 *  [  0 1-星レビュー     ](https://wordpress.org/support/plugin/prism-detached/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/prism-detached/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/prism-detached/reviews/)

## 貢献者

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

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/prism-detached/)