DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:code3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:code3 [2008-08-15 19:51] 70.152.41.31plugin:code3 [2023-12-21 19:07] (current) – new download url Aleksandr
Line 1: Line 1:
 +====== Code Replacement Plugin ======
 +
 +---- plugin ----
 +description: Client-side syntax highlighting
 +author     : Ilya Lebedev
 +email      : ilya@lebedev.net
 +type       : syntax
 +lastupdate : 2008-02-02
 +compatible : 2006-03-05+
 +depends    : 
 +conflicts 
 +similar    : code, code2
 +tags       : code, syntax, syntaxhighlight
 +
 +downloadurl: https://trello.com/1/cards/5b5ccc74f1dc9980ef51a639/attachments/5b5ce03661bc347a8cf2ac70/download/code.zip
 +bugtracker : 
 +sourcerepo : 
 +donationurl: 
 +
 +screenshot_img: https://trello.com/1/cards/5b5ccc74f1dc9980ef51a639/attachments/64554a0e07a3e98481d5daac/download/dokuwiki-plugin-code3.gif
 +----
 +
 +This plugin is identical to [[plugin:code]] by Chris Smith (actually, I've copy-pasted code from his plugin).
 +Demo page and some docs (in Russian): [[https://web.archive.org/web/20160617064708/http://debugger.ru/projects/psyhi/psyhi|http://debugger.ru/projects/psyhi/psyhi]] //(via web.archive.org)//
 +
 +===== Features =====
 +
 +  * does code coloring on the **client side**
 +  * it uses [[http://code.google.com/p/google-code-prettify/|Google Code Prettify]] library (patched, although)
 +  * client controllable line numbering of code (line numbering on/off)
 +  * client controllable open/collapse code blocks
 +  * client controllable viewing/manual highlight and copy
 +  * copy all code in a block in one click with clipboard copy button
 +  * looks professional
 +
 +===== Usage =====
 +
 +  * general use ''%%<code>some code</code>%%''
 +  * for a header ''%%<code|this is a header>some code</code>%%''
 +
 +
 +===== Compatibility =====
 +
 +Plugin has been tested in the following environments:
 +  * DokuWiki 2006-03-05+
 +  * Browsers
 +    - Internet Explorer 6,7
 +    - Opera 9.10, 9.21
 +    - Safari/Windows 3.0.2
 +    - Firefox 2.0.4
 +
 +===== Installation =====
 +
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
 +
 +===== Changelog =====
 +
 +  * **2008-08-01 Version 1.2**:
 +    * fixed text copying
 +    * added newlines recognition in markup mode
 +    * fixed insertion of empty comment lines
 +  * **2008-08-01 Version 1.1**:
 +    * added newlines recognition
 +    * fixed occasional deletion of unknown tokens
 +  * **2007-27-06 Version 1.0**:
 +    * first public release
 +    * PSyHi v0.3 used
 +
 +===== Discussion =====
 +
 +>How do I use this? I do understand Russian, is there any documentation in English?
 +>>All the required docs are placed here. You have to install this plugin, then it will take over ''<code>'' tags processing from the original [[plugin:code| code]] plugin.  --- //[[ilya@lebedev.net|Ilya Lebedev]] 2008-02-17 22:34//
 +
 +----
 +
 +The Button`s couldn't be viewed correct with Camino (1.5.4).
 +
 +----
 +
 +:!: I like this plugin quite a bit!  There are some issues I have, though:
 +  - for me, the first line of code has to begin on the same line as the ''<code>'' tag or the line numbering is off by 1. If I start my code on the next line, then line number 1 is left blank.
 +  - opening or closing brackets or parenthesis at the very beginning of a line (in my code) are chopped out! This isn't a big deal since all I have to do is add a space before the bracket or parenthesis... Could this be fixed?
 +  - oddly, code3 adds a newline after any CSS comment within the ''<code ... </code>'' tags.
 +  - could there be an option to control the size of the code window?   My code windows seem to vary depending on the size of the code they display. <del>They always seem to show 85-95% of the code only.</del> //See below.//
 +  - likewise, could there be an option to have a code block collapsed?
 +  - could there be an option for a footer to describe the code window? something like ''div.Controls span.stats'', except at the bottom left of the code box?  Well, on second thought maybe I can be happy with just the header.
 +  - I had to modify the font sizes in ''/lib/plugins/code/styles/styles.css'' since the fonts looked too small on my browsers.
 + //Juice 2008-08-15//
 +> Oddly, I was able to get the code windows to display all of my code.   Look at the (slightly convoluted) ''/lib/plugins/code/script.js'' file, then add a single space right between these two divs: <code><div class=\"CodeContainer\"><div class=\"TextContainer\"></code> This isn't exactly the fix I was looking for, though...\\   It would be nice to have (maybe) 3 options: have the code box closed, display all the code (what I'm doing now),  or display 1-5 lines of the code with a scroll bar.  //Juice 2008-08-18//
 +
 +----
 +
 +How can I control the first line number such as 0346 -> 0347 -> 0348?
  

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki