Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| info:dw:creole [2021/03/04 12:17] – créée radeff | info:dw:creole [2024/09/18 05:33] (Version actuelle) – radeff | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Creole Plugin | + | = ++ Creole Plugin |
| + | |||
| + | //note Fred: un plugin bien utile pour travailler directement en [[info: | ||
| plugin Creole Markup for DokuWiki | plugin Creole Markup for DokuWiki | ||
| https:// | https:// | ||
| - | <code dokuwiki> | + | very close to the syntax used by DokuWiki. |
| - | ====== Creole Plugin ====== | + | |
| - | + | ||
| - | ---- plugin ---- | + | |
| - | description: | + | |
| - | author | + | |
| - | email : freaks@dokuwiki.org | + | |
| - | type : syntax | + | |
| - | lastupdate : 2020-12-13 | + | |
| - | compatible : !2013-05-10, | + | |
| - | depends | + | |
| - | conflicts | + | |
| - | similar | + | |
| - | tags : formatting, markup_language, | + | |
| - | + | ||
| - | downloadurl: | + | |
| - | sourcerepo: | + | |
| - | bugtracker: | + | |
| - | ---- | + | |
| - | + | ||
| - | ===== Description ===== | + | |
| - | [[http:// | + | Only those elements differ: |
| * [[# | * [[# | ||
| Ligne 40: | Ligne 23: | ||
| If you use this plugin to support the Creole syntax, you might want to list your wiki at http:// | If you use this plugin to support the Creole syntax, you might want to list your wiki at http:// | ||
| - | |||
| - | ===== Installation ===== | ||
| - | |||
| - | To install the Creole plugin | ||
| - | |||
| - | * Go to the Admin page and then [[plugin: | ||
| - | * Search for the plugin " | ||
| - | * Use the '' | ||
| - | |||
| - | In the Configuration Settings you can change the Markup precedence over the DokuWiki syntax if you like. | ||
| - | |||
| - | :!: Since release 2020-08-21 the creole plugin is incompatible with DokuWiki release Greebo and the releases before it. If you are using DokuWiki releases before Hogfather then the latest compatible release is [[https:// | ||
| - | |||
| - | ===== Components ===== | ||
| ==== Listblock ==== | ==== Listblock ==== | ||
| Ligne 113: | Ligne 82: | ||
| DokuWiki and Creole 1.0 do not care about (single) line breaks. Creole 0.3, however, does treat line breaks in the source as line breaks in the output. | DokuWiki and Creole 1.0 do not care about (single) line breaks. Creole 0.3, however, does treat line breaks in the source as line breaks in the output. | ||
| - | This component is mainly the same as Chris Smith' | + | This component is mainly the same as Chris Smith' |
| Previous versions of this plugin matched Creole 0.3 and so linebreaks were kept as linebreaks. From now on, linebreaks will be replaced by whitespace to match Creole 1.0. The config option '' | Previous versions of this plugin matched Creole 0.3 and so linebreaks were kept as linebreaks. From now on, linebreaks will be replaced by whitespace to match Creole 1.0. The config option '' | ||
| Ligne 190: | Ligne 159: | ||
| This is '' | This is '' | ||
| - | ===== Bugs / Feature Requests ===== | ||
| - | Please report bugs or feature requests at the [[https:// | ||
| - | |||
| - | ===== Further Resources ===== | ||
| - | |||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | |||
| - | ===== Changes ===== | ||
| - | |||
| - | {{rss> | ||
| - | |||
| - | ===== Todo ===== | ||
| - | |||
| - | * make toolbar work | ||
| - | * update to Creole 1.0 specs (work in progress) | ||
| - | * < | ||
| - | |||
| - | ===== Discussion ===== | ||
| - | |||
| - | Very nice! The image notation in the Creole Markup however conflicts with the syntax for plugins in DokuWiki. If DokuWiki is planning to change at some point in time to Creole, it might be wise to switch to the proposed ' | ||
| - | --- // | ||
| - | |||
| - | > I don't know if a plugin can override the toolbar code, but I hard-coded reversed headings some time ago using [[tips: | ||
| - | >As for the converter: I once thought about writing a little script, but then decided to make it by hand. But if you want to do so. It should be relatively easy: Just go trough the text of each of your pages (with old syntax) and replace each occurrence of a headline with a unique symbol (like ' | ||
| - | > As for the other syntax changes: You don't have to change anything, as DW understands both old and new syntax for lists and no-wiki. --- // | ||
| - | |||
| - | >> Good point about the replacement. The reverse header tags page is only semi-useful to me: I really don't want to patch a single line of code, I only want to use plugins that can be installed via the plugin manager. The reason is that even though I am setting up the wiki and hacking around is no problem at all, I won't be the one maintaining it in the future, so I should and will not assume that the future maintainer will be able to cope with actual source code. // | ||
| - | |||
| - | >>> | ||
| - | |||
| - | >>>> | ||
| - | |||
| - | <code perl> | ||
| - | # | ||
| - | # revheaders | ||
| - | # Convert DokuWiki headers to Creole headers | ||
| - | |||
| - | foreach (@ARGV) { | ||
| - | $original = $metaformat = ''; | ||
| - | $filename = $_; | ||
| - | open WIKIPAGE, ("< | ||
| - | while (< | ||
| - | $original .= $_; | ||
| - | $_ =~ s/ | ||
| - | $_ =~ s/ | ||
| - | $_ =~ s/ | ||
| - | $_ =~ s/ | ||
| - | $_ =~ s/ | ||
| - | $metaformat.= $_; | ||
| - | } | ||
| - | $metaformat =~ s/ | ||
| - | $metaformat =~ s/ | ||
| - | $metaformat =~ s/ | ||
| - | $metaformat =~ s/ | ||
| - | $metaformat =~ s/ | ||
| - | open BACKUP, "> | ||
| - | print BACKUP $original; | ||
| - | open WIKIPAGE, ("> | ||
| - | print WIKIPAGE $metaformat; | ||
| - | } | ||
| - | </ | ||
| - | >>>> | ||
| - | >>>> | ||
| - | |||
| - | I couldn' | ||
| - | <code bash> | ||
| - | perl -i.bak -pe ' | ||
| - | </ | ||
| - | To do it on a whole folder (but be sure to be in the right folder!): | ||
| - | <code bash> | ||
| - | perl -i.bak -pe ' | ||
| - | </ | ||
| - | Or by searching, also in subfolders: | ||
| - | <code bash> | ||
| - | find / | ||
| - | </ | ||
| - | --- [[user> | ||
| - | |||
| - | Thank you, for this very nice plugin. | ||
| - | |||
| - | Wanted to point out that going to Creole 1.0 is not a big leap. I wrote a couple additions for the [[http:// | ||
| - | > I actually got superscript and the new table header syntax working. | ||
| - | |||
| - | >> < | ||
| - | |||
| - | There is a problem with the parser. An expression like < | ||
| - | |||
| - | Also, a new chapter is started when you try to put a double-stroked right arrow (=>, < | ||
| - | |||
| - | Creole 1.0 has already been out, any plan to update this plugin to support it? --- //DAY 2010-01-22 14:18// | ||
| - | |||
| - | To make ' | ||
| - | |||
| - | parser.php line 434 | ||
| - | <code php> | ||
| - | // | ||
| - | class Doku_Parser_Mode_table extends Doku_Parser_Mode { | ||
| - | |||
| - | function Doku_Parser_Mode_table() { | ||
| - | global $PARSER_MODES; | ||
| - | |||
| - | $this-> | ||
| - | $PARSER_MODES[' | ||
| - | $PARSER_MODES[' | ||
| - | $PARSER_MODES[' | ||
| - | $PARSER_MODES[' | ||
| - | ); | ||
| - | } | ||
| - | |||
| - | function connectTo($mode) { | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | } | ||
| - | |||
| - | function postConnect() { | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $this-> | ||
| - | } | ||
| - | |||
| - | function getSort() { | ||
| - | return 60; | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | handler.php starting line 578 | ||
| - | <code php> | ||
| - | | ||
| - | switch ( $state ) { | ||
| - | |||
| - | case DOKU_LEXER_ENTER: | ||
| - | |||
| - | $ReWriter = & new Doku_Handler_Table($this-> | ||
| - | $this-> | ||
| - | |||
| - | $this-> | ||
| - | if ( (trim($match) == ' | ||
| - | $this-> | ||
| - | } else { | ||
| - | $this-> | ||
| - | } | ||
| - | break; | ||
| - | |||
| - | case DOKU_LEXER_EXIT: | ||
| - | $this-> | ||
| - | $this-> | ||
| - | $ReWriter = & $this-> | ||
| - | $this-> | ||
| - | break; | ||
| - | |||
| - | case DOKU_LEXER_UNMATCHED: | ||
| - | if ( trim($match) != '' | ||
| - | $this-> | ||
| - | } | ||
| - | break; | ||
| - | |||
| - | case DOKU_LEXER_MATCHED: | ||
| - | if ( $match == ' ' ){ | ||
| - | $this-> | ||
| - | } else if ( preg_match('/:::/', | ||
| - | $this-> | ||
| - | } else if ( preg_match('/ | ||
| - | $this-> | ||
| - | } else if ( preg_match('/ | ||
| - | $this-> | ||
| - | } else if ( $match == " | ||
| - | $this-> | ||
| - | $this-> | ||
| - | } else if ( $match == " | ||
| - | $this-> | ||
| - | $this-> | ||
| - | } else if ( $match == ' | ||
| - | $this-> | ||
| - | } else if ( $match == ' | ||
| - | $this-> | ||
| - | } else if ( $match == ' | ||
| - | $this-> | ||
| - | } | ||
| - | break; | ||
| - | } | ||
| - | return true; | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | Has problem with dokuwiki-2010-11-07.tgz “Anteater”. Is there anyone can fix it? | ||
| - | > Problem is fixed in current version. --- //Benjamin Molitor 2010-12-04 18:07// | ||
| - | |||
| - | ---- | ||
| - | |||
| - | I haven' | ||
| - | |||
| - | I found a little bug: There is something wrong when I type: %%=>%% | ||
| - | |||
| - | It should be rendered as an arrow mark (=>), but with this plugin i've got something like this (HTML preview): | ||
| - | < | ||
| - | You can see it e.g. at the [[wiki: | ||
| - | |||
| - | --- // | ||
| - | |||
| - | ---- | ||
| - | |||
| - | A big thank you to all of you who have created and maintained this plugin. It provides me interoperability with WordPress where I use the BlogText Creole markup plugin. I have enhanced the Creole DokuWiki code running on my computer and would like to share what I have done. Perhaps what I have done, or something like it, could become a part of the standard release. | ||
| - | |||
| - | I enhanced the plugin to support this sort of syntax that I often use (example): | ||
| - | < | ||
| - | Host file setup: | ||
| - | # **Desktop Link to Hosts File.** Log in as the Administrator OS user, bring up a Cygwin command window to create a link to the hosts file using the following commands: {{{ | ||
| - | cd / | ||
| - | |||
| - | ln -T / | ||
| - | }}} | ||
| - | # **Add Mac host to hosts file.** Still logged in as the Administrator OS user, add the following line to the hosts file using the hosts.txt desktop link: {{{ | ||
| - | 10.180.15.2 mymac | ||
| - | }}} | ||
| - | </ | ||
| - | |||
| - | I enhanced the plugin to switch to block mode for an inline nowiki section that ends with three braces immediately after a newline. Regular inline mode takes precedence - the switch to block mode only happens if there is no normal (i.e., not right after a newline) set of end braces. | ||
| - | |||
| - | Here are the changes: | ||
| - | |||
| - | (1) In preinline.php, | ||
| - | < | ||
| - | function connectTo($mode) { | ||
| - | // swg added check for not newline character (not block mode) | ||
| - | $this-> | ||
| - | ' | ||
| - | $mode, | ||
| - | ' | ||
| - | ); | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | (2) Added a second preinline class file, called preinline2.php, | ||
| - | < | ||
| - | <?php | ||
| - | /** | ||
| - | * Creole Plugin, inline preformatted component: Creole style preformatted text | ||
| - | | ||
| - | * @license | ||
| - | * @author | ||
| - | */ | ||
| - | |||
| - | // must be run within Dokuwiki | ||
| - | if(!defined(' | ||
| - | |||
| - | if(!defined(' | ||
| - | require_once(DOKU_PLUGIN.' | ||
| - | |||
| - | /** | ||
| - | * All DokuWiki plugins to extend the parser/ | ||
| - | * need to inherit from this class | ||
| - | */ | ||
| - | class syntax_plugin_creole_preinline2 extends DokuWiki_Syntax_Plugin { | ||
| - | |||
| - | function getInfo() { | ||
| - | return array( | ||
| - | ' | ||
| - | ' | ||
| - | ' | ||
| - | ' | ||
| - | ' | ||
| - | ' | ||
| - | ); | ||
| - | } | ||
| - | |||
| - | function getType() { return ' | ||
| - | function getSort() { return 103; } | ||
| - | |||
| - | function connectTo($mode) { | ||
| - | // swg added check for newline indicating block mode | ||
| - | $this-> | ||
| - | ' | ||
| - | $mode, | ||
| - | ' | ||
| - | ); | ||
| - | } | ||
| - | |||
| - | function postConnect() { | ||
| - | // swg added newline | ||
| - | $this-> | ||
| - | ' | ||
| - | ' | ||
| - | ); | ||
| - | } | ||
| - | |||
| - | function handle($match, | ||
| - | switch ($state) { | ||
| - | case DOKU_LEXER_ENTER: | ||
| - | $handler-> | ||
| - | break; | ||
| - | case DOKU_LEXER_UNMATCHED: | ||
| - | // swg changed unformatted to preformatted | ||
| - | $handler-> | ||
| - | break; | ||
| - | case DOKU_LEXER_EXIT: | ||
| - | $handler-> | ||
| - | break; | ||
| - | } | ||
| - | return true; | ||
| - | } | ||
| - | |||
| - | function render($mode, | ||
| - | return true; | ||
| - | } | ||
| - | } | ||
| - | // vim: | ||
| - | </ | ||
| - | |||
| - | --- // | ||
| - | |||
| - | |||
| - | ==== Creole conflicts with fckglite ==== | ||
| - | I just learned the hard way, that the creole plugin conflicts with the wysiwyg editor plugin fckglite. If creole is installed, fckglite refuses to save. Depending on circumstance, | ||
| - | > Solution: http:// | ||
| - | |||
| - | >The needed include file for above solution: | ||
| - | <file php isfckgLiteOn.inc> | ||
| - | <?php | ||
| - | function fckgLiteOn() { | ||
| - | |||
| - | if(isset($_COOKIE [' | ||
| - | | ||
| - | } | ||
| - | return true; | ||
| - | |||
| - | } | ||
| - | </ | ||
| - | --- [[user> | ||
| - | </ | ||