https://github.com/dunglas/ajax-syntax-highlighter
Automatically exported from code.google.com/p/ajax-syntax-highlighter
https://github.com/dunglas/ajax-syntax-highlighter
Last synced: 2 months ago
JSON representation
Automatically exported from code.google.com/p/ajax-syntax-highlighter
- Host: GitHub
- URL: https://github.com/dunglas/ajax-syntax-highlighter
- Owner: dunglas
- License: gpl-3.0
- Created: 2015-03-16T12:33:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-16T12:35:58.000Z (about 10 years ago)
- Last Synced: 2024-10-05T19:22:30.340Z (8 months ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
=Ajax Syntax Highlighter=
_Ajax Syntax Highlighter_ is a small Javascript utility designed to highlight code embed in a web page in a standard compliant way.
It automatically looks for source code in the page, send it to a server-side highlighter and display the highlighted code. It also has a "view as plain text" feature._Ajax Syntax Highlighter_ is built with [http://developer.yahoo.com/yui/ Yahoo! UI] and uses [http://www.json.org/ JSON] for serialization. It is wrote by [http://lapin-blanc.net Kévin Dunglas].
It currently includes [http://qbnz.com/highlighter/ GeSHi] as server-side (PHP required) highlighter but it can be easily used with others such as [http://pygments.org/ Pygments].*[http://lapin-blanc.net/wp-content/plugins/ajax-syntax-highlighter/test.html See a demo.]*
==Install==
Unzip the archive or get _Ajax Syntax Highlighter_ via Subversion. Put the resulting directory into your Apache document root with PHP enabled (for GeSHi).
Try to load `http:////ajax-syntax-highlighter/test.html` to check if your installation is correct.
In your HTML file add the following lines in the `HEAD` section to active _Ajax Syntax Highlighter_:
{{{}}}
Is is also recommended to use the Yahoo! UI base, fonts and reset CSS files. Put before the previous lines:
{{{
}}}
Now add your snippets to your page like this:
{{{<?php
echo 'Hello, World';
?>
}}}You must use the `code` tag with a `class` attribute following the HTML5 `language-` convention. You can add a `pre` tag if needed.
That's all folk !