User:Wnt/Templates
Links:Lua/Scribunto resources useful for making templates
[edit]- Scribunto (MediaWiki)
- Lua reference manual (Mediawiki)
- Lua scripting (MediaWiki)
- Lua (Wikipedia)
- Citation templates test (practical example, but I'm not anywhere near the level of editing this as of yet)
- Module:Citation - uses parameters passed to the expanded Template:Cite web
- Template:Cite web - which is what #invokes Module:citation
- Wikipedia:Scribunto experimentation - list of a bunch of tests, looks very useful
List of bullshit expressions in the Lua reference manual
[edit]Any of this might be wrong; I'm just testing by trial and error since I don't understand the language. (I mean, the language the manual is written in)
- "Syntactic sugar" apparently means synonym. i.e. providing a.name as syntactic sugar for a["name"] this indeed delivers "testing 1 2 3".
- var ::= prefixexp `[´ exp `]´ and such pseudo language ... still trying to figure that out, though I assume it's just saying an array looks like a[b]?
- Any example involving "print()" will fail.
Hello World
[edit]Testing instructions at [1] "Getting started". Appears to work:
- User:Wnt/Templates/Hello - out of the box call to "Hello world" for Scribunto.
- Module:Wnt/Templates/Hello - out of the box "Hello world" module in Lua.
Sandbox
[edit]- User:Wnt/Templates/Sandbox - for various experiments
- Module:Wnt/Templates/Sandbox - " " "
Parameter passing
[edit]- User:Wnt/Templates/Parameters - to demonstrate "features" of passing parameters (beginning)
- Module:Wnt/Templates/Parameters - " " "
Mandelbrot
[edit]- User:Wnt/Templates/Mandelbrot - crudely blocks out a Mandelbrot set in black.
- Module:Wnt/Templates/Mandelbrot - not sure why it's such a crude Mandelbrot as they go...
For some reason this doesn't look like much of a Mandelbrot - more iterations don't help much (if at all); my guess for now is that the precision of the floating point numbers just isn't good enough. I was daydreaming of having it in a table form where you could click on one pane of the Mandelbrot to expand it - but if there's a way to make the output contain on-the-fly generated text that then gets sent back INTO #invoke as parameters, I haven't thought of it.
Plotter
[edit]- User:Wnt/Templates/Plotter - core notion of a simple coordinate plotter for making scatter graphs; very incomplete by now
- Module:Wnt/Templates/Plotter - " " "
Lesson learned - parameters start off as strings but can be "coerced" (translated) to numbers by adding them "+ 0".
Svgedit
[edit]- User:Wnt/Templates/Svgedit - rudimentary beginning which extracts the names of the outlined areas from a copy of an SVG file and marks which has which filling. But there's more than one way this info could be encoded, and any function to reverse this process from raw data is barely an idea.
- Module:Wnt/Templates/Svgedit - " " "
- User:Wnt/Templates/Svgedit/Sampleinput1 - copy of the text content of a sample SVG file (see below)
- User:Wnt/Templates/Svgedit/Sampleprofile1 - mulling over some standard data format for the colors to be used by people using this to make SVGs
- User:Wnt/Templates/Svgedit/Sampledata1 - example of somewhat messy data I'd like the module to accept and turn into colors for the SVG.
Note: A way to access the actual "file" of the SVG and pass it to a template would be very useful - there's no way that I know of to make the content of [2] a template parameter. Wnt (talk) 06:09, 4 September 2012 (UTC)