DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:const

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:const [2015-08-26 15:25] – [Syntax] 161.69.7.20plugin:const [2024-02-26 10:51] (current) – [Discussion] 2a01:cb08:8ae4:de00:a0ef:f1a9:f5ae:4f85
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: work on wiki pages with constants, self defined variables and make calculations +description: Work on wiki pages with constants, self defined variables and make calculations 
-author     : lisps  +author     : lisps, peterfromearth 
-email      :  +email      : 
 type       : action,syntax type       : action,syntax
-lastupdate : 2015-01-31 +lastupdate : 2023-04-04 
-compatible : hrun,binkyweatherwaxadora belle+compatible : IgorGreeboFrusterick MannersElenor Of Tsort, Detritus
 depends    :  depends    : 
 conflicts  conflicts 
 similar    : fields similar    : fields
-tags       : math,calculation,constants+tags       : math, calculation, constants
  
 downloadurl: https://github.com/lisps/const/archive/master.zip downloadurl: https://github.com/lisps/const/archive/master.zip
-bugtracker : http://github.com/lisps/const/issues +bugtracker : https://github.com/lisps/const/issues 
-sourcerepo : http://github.com/lisps/const/+sourcerepo : https://github.com/lisps/const/
 donationurl:  donationurl: 
  
Line 23: Line 23:
 ===== Installation ===== ===== Installation =====
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
Line 55: Line 55:
 ===== Syntax ===== ===== Syntax =====
  
-  - define anywhere in your page a ''<const></const>'' Block. +  - define anywhere in your page a ''%%<const></const>%%'' Block. 
   - with ''variable=string'' you can assign a string to the variable. You can also assign a constant to a variable.    - with ''variable=string'' you can assign a string to the variable. You can also assign a constant to a variable. 
   - with ''result:formular'' you can execute a formular and store the result in the result variable. Inside the formular constants and earlier defined variables are allowed.   - with ''result:formular'' you can execute a formular and store the result in the result variable. Inside the formular constants and earlier defined variables are allowed.
-  - to display a variable on the page, use ''<nowiki>%%variable%%</nowiki>'' +  - to display a variable on the page, use ''<nowiki>%%variable%%</nowiki>'' or ''%%§§variable§§%%''
  
 **Available constants are:** **Available constants are:**
-^constants description ^+^Constants       Description ^
 |''%ID%''        | pageid ''noNS(cleanID(getID()))''| |''%ID%''        | pageid ''noNS(cleanID(getID()))''|
 |''%NAMESPACE%'' | namespace ''getNS(cleanID(getID()))'' | |''%NAMESPACE%'' | namespace ''getNS(cleanID(getID()))'' |
 |''%RANDOM%''    | random number ''strval(rand())'' | |''%RANDOM%''    | random number ''strval(rand())'' |
 |''%USER%''      | username | |''%USER%''      | username |
-|''%YEAR%''      | year ''date("Y")''+|''%YEAR%''      | year ''%%date("Y")%%''
-|''%MONTH%''     | month ''date("m")''+|''%MONTH%''     | month ''%%date("m")%%''
-|''%MONTHNAME%'' | monthname ''date("F")''+|''%MONTHNAME%'' | monthname ''%%date("F")%%''
-|''%WEEK%''      | weeknumber ''date("W")''+|''%WEEK%''      | weeknumber ''%%date("W")%%''
-|''%DAY%''       | day ''date("d")''+|''%DAY%''       | day ''%%date("d")%%''
-|''%DAYNAME%''   | dayname ''date("l")'' |+|''%DAYNAME%''   | dayname ''%%date("l")%%'' |
 |''%AUTOINDEX%'' | autoinkrement variable  | |''%AUTOINDEX%'' | autoinkrement variable  |
  
Line 83: Line 82:
 === Change Log === === Change Log ===
  
-  * **2013-10-28** +[[https://travis-ci.org/lisps/const|{{ https://travis-ci.org/lisps/const.png?nocache|Build Status}}]] 
-    * Initial release+ 
 +{{rss>https://github.com/lisps/const/commits/master.atom date}}
  
 === Known Bugs and Issues === === Known Bugs and Issues ===
Line 100: Line 100:
  
 ===== Discussion ===== ===== Discussion =====
 +
 +Any idea to set ''const'' at wiki level ?
 +[[user>jerome|Jérôme Barotin]] --- //2023-02-26 10:50//
  
 This plugin doesn't work at all, is buggy and useless. This plugin doesn't work at all, is buggy and useless.
Line 120: Line 123:
 >>Good time of day! Can i use const plugin with [[plugin:include]] plugin? I want to use some variables in include page, but it's rendered as %variable% on final page... >>Good time of day! Can i use const plugin with [[plugin:include]] plugin? I want to use some variables in include page, but it's rendered as %variable% on final page...
 > The const variables are only relevant for the pages where they are defined. You can create a issue on github and i can have a look if I have time. > The const variables are only relevant for the pages where they are defined. You can create a issue on github and i can have a look if I have time.
 +
 +Is is fot math oparations only? Would it be possible to have some string manipulation (e.g. concatanation) as well?
plugin/const.1440595511.txt.gz · Last modified: 2015-08-26 15:25 by 161.69.7.20

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