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 [2019-08-31 12:00] Aleksandrplugin:const [2024-02-26 10:51] (current) – [Discussion] 2a01:cb08:8ae4:de00:a0ef:f1a9:f5ae:4f85
Line 3: Line 3:
 ---- 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, peterfromearth+author     : lisps, peterfromearth
 email      :  email      : 
 type       : action,syntax type       : action,syntax
-lastupdate : 2015-01-31 +lastupdate : 2023-04-04 
-compatible : Greebo, "Frusterick Manners""Elenor Of Tsort", Detritus+compatible : Igor, Greebo, Frusterick Manners, Elenor 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
Line 58: Line 58:
   - 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 82: Line 81:
  
 === Change Log === === Change Log ===
-[[https://travis-ci.org/lisps/const|{{  https://travis-ci.org/lisps/const.png?nocache|Build Status}}]]+ 
 +[[https://travis-ci.org/lisps/const|{{ https://travis-ci.org/lisps/const.png?nocache|Build Status}}]]
  
 {{rss>https://github.com/lisps/const/commits/master.atom date}} {{rss>https://github.com/lisps/const/commits/master.atom date}}
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.1567245657.txt.gz · Last modified: 2019-08-31 12:00 by Aleksandr

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