DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:macros

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:macros [2013-03-24 22:59] – [Macros Plugin] igbplugin:macros [2024-02-10 16:45] (current) – [Macros Plugin] Aleksandr
Line 4: Line 4:
 description: Use macro expressions and conditional expressions to generate page text description: Use macro expressions and conditional expressions to generate page text
 author     : Ian G. Burleigh author     : Ian G. Burleigh
-email      : ian dot burleigh at gmail dot com+email      : ian dot george dot burleigh at gmail dot com
 type       : action, syntax type       : action, syntax
 lastupdate : 2012-02-09 lastupdate : 2012-02-09
-compatible : 2012-01-25 "Angua"+compatible : Angua, Adora Belle, Weatherwax, Binky, Greebo
 depends    :  depends    : 
 conflicts  conflicts 
-similar    : easyvar, replace, kixovar, fields, textinsert +similar    : easyvar, replace, kixovar, fields, textinsert, wst, templater 
-tags       : extension, formatting, macro+tags       : extension, formatting, macro, !obsolete
  
-downloadurl: http://qvak.info/software/files/get.php?file=dwm +downloadurl: https://github.com/phi53/dokuwiki_plugin_macros/archive/master.zip 
-bugtracker : https://github.com/dunna/dokuwiki_plugin_macros/issues +bugtracker : https://github.com/phi53/dokuwiki_plugin_macros/issues 
-sourcerepo : https://github.com/dunna/dokuwiki_plugin_macros/ +sourcerepo : https://github.com/phi53/dokuwiki_plugin_macros/ 
-donationurl: http://qvak.info/contact+donationurl:
 ---- ----
 ===== Download and Installation ===== ===== Download and Installation =====
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the URL given above. Refer to [[:Plugins]] on how to install plugins manually.+**Since the repository has been removed, a workaround is to download comicslate.org-version of the plugin\\ 
 +https://comicslate.org/_/macros.rar\\ 
 +MD5-check 1d28e5fdb7feb05aae44820169bdbe36** 
 + 
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Description ===== ===== Description =====
Line 79: Line 83:
  
 ===== Discussion ===== ===== Discussion =====
 +
 +==== Vanishing PHP text ====
 +
 +Unfortunately, the Macros plugin simply removes undefined macros. This clobbers PHP code, because PHP variables look a lot like macros.
 +
 +There is an easy fix: in ''macros.php'', function ''expand_macro_callback()'', change the following code to return the original match instead of an empty string:
 +
 +<code php>
 +// a defined macro?
 +$res = @$this->macroDefs[$name];
 +if(!$res) {
 + $this->undefinedMacros[] = $name;
 + return $m[0];
 + // return '';
 +}
 +</code>
 +
 +Also, the macro identifying character ''$'' can be changed to another character or a sequence of characters. In ''macros.php'', search for and replace ''\$'' in regular expressions.
  
 ==== Bug Report ==== ==== Bug Report ====
plugin/macros.1364162358.txt.gz · Last modified: 2013-03-24 22:59 by igb

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