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
Last revisionBoth sides next revision
plugin:const [2015-03-20 11:40] – [Discussion] 134.95.200.161plugin:const [2024-01-21 21:34] – [Syntax] Aleksandr
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 ''% %variable% %'' (without blank) +  - 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 113: Line 113:
 >Thanks a lot! It works :-) --- [[user>MKo|Michael Kohn]] //2015-02-04 15:30// >Thanks a lot! It works :-) --- [[user>MKo|Michael Kohn]] //2015-02-04 15:30//
  
-Would it be possible to use differently named constants? (Like crosssection_mm or Volume_L instead of value1 and value2) ? This would make the formulars much more easy to read... Anyway, thanks for your great work so far  Ocko / 20.03 (?? How can I automaticly sign in DK, like ~~~~ in MW?) Just noticed int works, bu only if you write everythin in small letters, w/o special chars...!+>>Would it be possible to use differently named constants? (Like crosssection_mm or Volume_L instead of value1 and value2) ? This would make the formulas much more easy to read... Anyway, thanks for your great work so far  Ocko / 20.03 (?? How can I automatically sign in DK, like ~~~~ in MW?)  
 +>Just noticed it works, but only if you write everything in small letters, w/o special chars...!
  
 Can we control the decimals somehow? Can we control the decimals somehow?
 +
 +>>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.
 +
 +Is is fot math oparations only? Would it be possible to have some string manipulation (e.g. concatanation) as well?
plugin/const.txt · Last modified: 2024-02-26 10:51 by 2a01:cb08:8ae4:de00:a0ef:f1a9:f5ae:4f85

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