dunglas / ajax-syntax-highlighter Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/ajax-syntax-highlighter
License: GNU General Public License v3.0
Automatically exported from code.google.com/p/ajax-syntax-highlighter
License: GNU General Public License v3.0
=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://<your-host>/<your-directory>/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_: {{{ <link rel="stylesheet" type="text/css" href="http://<your-host>/<your-directory>/ajax-syntax-highlighter/ajax-syntax-highlighter.css" /> <script type="text/javascript" src="http://yui.yahooapis.com/combo?2.5.2/build/yahoo-dom-event/yahoo-dom-event.js&2.5.2/build/connection/connection-min.js&2.5.2/build/json/json-min.js&2.5.2/build/selector/selector-beta-min.js"></script> <script type="text/javascript" src="http://<your-host>/<your-directory>/ajax-syntax-highlighter/ajax-syntax-highlighter.js"></script> }}} Is is also recommended to use the Yahoo! UI base, fonts and reset CSS files. Put before the previous lines: {{{ <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/reset-fonts/reset-fonts.css" /> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/base/base-min.css" /> }}} Now add your snippets to your page like this: {{{ <pre><code class="language-php"><?php echo 'Hello, World'; ?></code></pre> }}} You must use the `code` tag with a `class` attribute following the HTML5 `language-<language-name>` convention. You can add a `pre` tag if needed. That's all folk !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.