bridge:troeftekens-in-dokuwiki
Verschillen
Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.
| Beide kanten vorige revisieVorige revisieVolgende revisie | Vorige revisie | ||
| bridge:troeftekens-in-dokuwiki [2020/12/19 17:14] – oude revisie hersteld (2007/08/10 01:06) 45.148.125.206 | bridge:troeftekens-in-dokuwiki [2021/03/13 00:03] (huidige) – Externe bewerking 127.0.0.1 | ||
|---|---|---|---|
| Regel 1: | Regel 1: | ||
| ====== Troef tekens in Dokuwiki ====== | ====== Troef tekens in Dokuwiki ====== | ||
| - | Troeftekens lopen niet lekker in Dokuwiki. Het kan via smileys, zoals op [[sampiemon> | ||
| - | Een alternatieve oplossing gaat via entities.conf, | + | ===== Troef tekens beschikbaar maken ===== |
| - | < | ||
| - | [s] < | ||
| - | [h] < | ||
| - | [r] < | ||
| - | [k] < | ||
| - | </ | ||
| - | Het probleem van deze methode is dat de parser van Dokuwiki | + | Troef tekens lopen niet lekker in Dokuwiki. |
| + | - Smileys | ||
| + | - Entities | ||
| + | - UTF karakters | ||
| + | Op alledrie de mogelijkheden wordt hieronder ingegaan. | ||
| - | ===== Knoppen en keyboard shortcuts in de Dokuwiki editor maken ===== | + | ==== Smileys |
| - | Beide voorgaande oplossingen hebben als nadeel dat zij niet goed combineren met de DokuTexit plugin voor export naar LaTeX/PDF (ze werken wel met het alternatief pdfex). Het laatste alternatief, | + | Dit is werkend |
| - | - De volgende pngtjes moeten worden gekopieerd naar / | + | |
| - | * {{http:// | + | |
| - | * {{http:// | + | |
| - | * {{http:// | + | |
| - | * {{http:// | + | |
| - | - / | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | </ | + | |
| - | <?php | + | |
| - | /** | + | |
| - | * Editing toolbar functions | + | |
| - | * | + | |
| - | * @license | + | |
| - | * @author | + | |
| - | */ | + | |
| - | if(!defined(' | + | ==== Entities ==== |
| - | require_once(DOKU_INC.' | + | Een alternatieve oplossing gaat via entities.conf, daar kun je vervangingen definiëren. Een voorbeeld: |
| - | + | <code> | |
| - | /** | + | [s] <font size=" |
| - | * Prepares and prints an JavaScript array with all toolbar buttons | + | [h] <font size="+1" |
| - | * | + | [r] <font size="+1" color=" |
| - | * @todo add toolbar plugins | + | [k] <font size="+1" color="black">♣</font> |
| - | * @param | + | |
| - | * @author Andreas Gohr <andi@splitbrain.org> | + | |
| - | */ | + | |
| - | function toolbar_JSdefines($varname){ | + | |
| - | global $ID; | + | |
| - | global $conf; | + | |
| - | global $lang; | + | |
| - | + | ||
| - | // build button array | + | |
| - | $menu = array( | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | array( | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | array( | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | array( | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ), | + | |
| - | ); | + | |
| - | + | ||
| - | // use JSON to build the JavaScript array | + | |
| - | $json = new JSON(); | + | |
| - | print "var $varname | + | |
| - | } | + | |
| - | + | ||
| - | /** | + | |
| - | * prepares the signature string as configured in the config | + | |
| - | * | + | |
| - | * @author Andreas Gohr < | + | |
| - | */ | + | |
| - | function toolbar_signature(){ | + | |
| - | global $conf; | + | |
| - | + | ||
| - | $sig = $conf[' | + | |
| - | $sig = strftime($sig); | + | |
| - | $sig = str_replace(' | + | |
| - | $sig = str_replace(' | + | |
| - | $sig = str_replace(' | + | |
| - | $sig = str_replace(' | + | |
| - | $sig = str_replace(' | + | |
| - | return $sig; | + | |
| - | } | + | |
| - | + | ||
| - | //Setup VIM: ex: et ts=4 enc=utf-8 : | + | |
| </ | </ | ||
| - | - Geef in een shell: %%touch / | ||
| - | En klaar is uw kunstgebit. Als HTML is toegestaan kun je ook %%<font color>%% tags toevoegen. | + | Het probleem van deze methode |
| + | ==== UTF karakters ==== | ||
| + | Beide voorgaande oplossingen hebben als nadeel dat zij niet goed combineren met de DokuTexit plugin voor export naar LaTeX/PDF (ze werken wel met het alternatief pdfex). Het laatste alternatief, | ||
| - | + | ===== Ruitenprobleem onder Internet Explorer | |
| - | ====Als plugin==== | + | |
| - | De indexmenu en de highlight plugins bevatten javascript om een toolbar/ | + | |
| - | + | ||
| - | De syntax.php zou er ze uit kunnen zien: | + | |
| - | + | ||
| - | <code php> | + | |
| - | <?php | + | |
| - | /** | + | |
| - | * Plugin base links: Creates links relative to site root for all links beginni | + | |
| - | * | + | |
| - | * @license | + | |
| - | * @author | + | |
| - | * @based_on | + | |
| - | */ | + | |
| - | + | ||
| - | if(!defined(' | + | |
| - | if(!defined(' | + | |
| - | require_once(DOKU_PLUGIN.' | + | |
| - | + | ||
| - | /** | + | |
| - | * All DokuWiki plugins to extend the parser/ | + | |
| - | * need to inherit from this class | + | |
| - | */ | + | |
| - | class syntax_plugin_trumpsigns extends DokuWiki_Syntax_Plugin { | + | |
| - | + | ||
| - | /** | + | |
| - | * return some info | + | |
| - | */ | + | |
| - | function getInfo(){ | + | |
| - | return array( | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ); | + | |
| - | } | + | |
| - | + | ||
| - | /** | + | |
| - | * What kind of syntax are we? | + | |
| - | */ | + | |
| - | function getType(){ | + | |
| - | return ' | + | |
| - | } | + | |
| - | + | ||
| - | //This must be implemented | + | |
| - | function getSort(){ return 123; } | + | |
| - | + | ||
| - | + | ||
| - | } | + | |
| - | ?> | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | Voorbeeld van script.js. Let hierop: http:// | + | |
| - | + | ||
| - | <code javascript> | + | |
| - | + | ||
| - | //create a single toolbutton with desired properties | + | |
| - | function plugin_trumpsigns_createToolbutton (id, tooltipText, | + | |
| - | var indx_ico = document.createElement(' | + | |
| - | indx_ico.src = DOKU_BASE + ' | + | |
| - | var indx_btn = document.createElement(' | + | |
| - | indx_btn.id = ' | + | |
| - | indx_btn.className = ' | + | |
| - | indx_btn.title = tooltipText; | + | |
| - | indx_btn.accessKey = accKey; | + | |
| - | indx_btn.appendChild(indx_ico); | + | |
| - | onclick = function(){insertAtCarret(" | + | |
| - | return indx_btn; | + | |
| - | } | + | |
| - | + | ||
| - | //if this is an " | + | |
| - | function plugin_trumpsigns_toolbar_additions() { | + | |
| - | var toolbar = $(' | + | |
| - | if(!toolbar) return; | + | |
| - | var edbtn = $(' | + | |
| - | if(!edbtn) return; | + | |
| - | var index_btn = plugin_trumpsigns_createToolbutton(' | + | |
| - | toolbar.appendChild(indx_btn); | + | |
| - | index_btn = plugin_trumpsigns_createToolbutton(' | + | |
| - | toolbar.appendChild(indx_btn); | + | |
| - | index_btn = plugin_trumpsigns_createToolbutton(' | + | |
| - | toolbar.appendChild(indx_btn); | + | |
| - | index_btn = plugin_trumpsigns_createToolbutton(' | + | |
| - | toolbar.appendChild(indx_btn); | + | |
| - | } | + | |
| - | + | ||
| - | addInitEvent(plugin_trumpsigns_toolbar_additions); | + | |
| - | + | ||
| - | //Setup VIM: ex: et ts=2 sw=2 enc=utf-8 : | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | ===== Vergroot in rood en zwart weergeven ===== | + | |
| - | + | ||
| - | <code php> | + | |
| - | <?php | + | |
| - | /** | + | |
| - | * Plugin Trumpsigns: Inserts <font size=" | + | |
| - | * | + | |
| - | * @license | + | |
| - | * @author | + | |
| - | */ | + | |
| - | + | ||
| - | if(!defined(' | + | |
| - | if(!defined(' | + | |
| - | require_once(DOKU_PLUGIN.' | + | |
| - | + | ||
| - | /** | + | |
| - | * All DokuWiki plugins to extend the parser/ | + | |
| - | * need to inherit from this class | + | |
| - | */ | + | |
| - | class syntax_plugin_tab extends DokuWiki_Syntax_Plugin { | + | |
| - | + | ||
| - | /** | + | |
| - | * return some info | + | |
| - | */ | + | |
| - | function getInfo(){ | + | |
| - | return array( | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ); | + | |
| - | } | + | |
| - | + | ||
| - | /** | + | |
| - | * What kind of syntax are we? | + | |
| - | */ | + | |
| - | function getType(){ | + | |
| - | return ' | + | |
| - | } | + | |
| - | + | ||
| - | + | ||
| - | /** | + | |
| - | * Where to sort in? | + | |
| - | */ | + | |
| - | function getSort(){ | + | |
| - | return 789; | + | |
| - | } | + | |
| - | + | ||
| - | + | ||
| - | /** | + | |
| - | * Connect pattern to lexer | + | |
| - | */ | + | |
| - | function connectTo($mode) { | + | |
| - | $this-> | + | |
| - | $this-> | + | |
| - | $this-> | + | |
| - | $this-> | + | |
| - | } | + | |
| - | + | ||
| - | /** | + | |
| - | * Handle the match | + | |
| - | */ | + | |
| - | function handle($match, | + | |
| - | switch ($state) { | + | |
| - | case DOKU_LEXER_ENTER : | + | |
| - | break; | + | |
| - | case DOKU_LEXER_MATCHED : | + | |
| - | break; | + | |
| - | case DOKU_LEXER_UNMATCHED : | + | |
| - | break; | + | |
| - | case DOKU_LEXER_EXIT : | + | |
| - | break; | + | |
| - | case DOKU_LEXER_SPECIAL : | + | |
| - | break; | + | |
| - | } | + | |
| - | return array(); | + | |
| - | } | + | |
| - | + | ||
| - | /** | + | |
| - | * Create output | + | |
| - | */ | + | |
| - | function render($mode, | + | |
| - | if($mode == ' | + | |
| - | $renderer-> | + | |
| - | $renderer-> | + | |
| - | $renderer-> | + | |
| - | return true; | + | |
| - | } | + | |
| - | return false; | + | |
| - | } | + | |
| - | } | + | |
| - | + | ||
| - | //Setup VIM: ex: et ts=4 enc=utf-8 : | + | |
| - | + | ||
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | ==== Ruitenprobleem onder Internet Explorer ==== | + | |
| Onder IE worden de ruitentekens niet goed weergegeven, | Onder IE worden de ruitentekens niet goed weergegeven, | ||
bridge/troeftekens-in-dokuwiki.1608394493.txt.gz · Laatst gewijzigd: (Externe bewerking)
