[READ-ONLY] Mirror of https://github.com/thoda-dev/svg-lua. svg lua library
0

Configure Feed

Select the types of activity you want to include in your feed.

update Documentation for testing with binaries

Thomas DAGES (Dec 7, 2018, 10:36 AM +0100) 4b29fff7 0080ea8e

+23 -4
+1
.gitignore
··· 1 + lua5.3.4-win64/result.html
+21 -3
README.md
··· 1 1 # svg-lua 2 + 2 3 svg lua library 3 4 4 - # usage 5 + ## usage 6 + 5 7 ```lua 6 8 mon_dessin = svg:create() 7 9 mon_dessin:add(mon_dessin:Rect()) ··· 9 11 ``` 10 12 11 13 result for `print(mon_dessin:draw())` : 14 + 12 15 ```html 13 16 <svg width="100" height="100" fill="transparent" stroke="#000000" version="1.1" xmlns="http://www.w3.org/2000/svg"> 14 17 <rect y="10" x="10" stroke-width="1" height="10" width="10" rx="0" ry="0" /> ··· 16 19 ``` 17 20 18 21 ### testing 22 + 19 23 can be tested [here](https://www.lua.org/cgi-bin/demo) *(use the minified version, the text field is limited in size)* 20 24 21 - *you can use the content of the file `test.lua` for testing, it includes the minified version and all elements with default values, the result can be found in `index.html`* 25 + to test using the binaries included in the project: 26 + 27 + - open a command prompt un the subdirectory `lua5.3.4-win64` *(Shift+Right Click on Windows)* 28 + - type `lua53.exe ..\test.lua` 29 + 30 + If you want to save the output in a file to see the result you can add ` > result.html` or ` >> result.html` following the previous command to save the result in an html file: 31 + 32 + - `lua53.exe ..\test.lua > result.html`: this will create a file `result.html` in the directory with the resul, replacing the file if already exists this can be done using `test.bat`. 33 + - `lua53.exe ..\test.lua >> result.html`: this will create a file `result.html` in the directory with the resul, appending result to the existing file if already exists. 34 + 35 + If you are using a custom test file, replace `test.lua` by your file name. 22 36 23 37 ### minified version 38 + 24 39 `svg.min.lua` generated with [Lua Minifier from Mothereff.in](https://mothereff.in/lua-minifier) 25 40 26 - # Documentation 41 + ## Documentation 42 + 27 43 ### Main methods 44 + 28 45 **svg:create(width, height, stroke, fill)** *create the svg object* 29 46 30 47 - width: number => width of the drawing, default to 100 ··· 39 56 **svg:draw()** *return the svg formated string* 40 57 41 58 ### Elements for svg:add(element) 59 + 42 60 **svg:Text(text, x, y, style, transform)** *add text* 43 61 44 62 - text: string => the text to write
-1
index.html
··· 1 - <svg width="100" height="100" fill="transparent" stroke="#000000" version="1.1" xmlns="http://www.w3.org/2000/svg"><rect x="10" y="10" width="10" stroke="#000000" stroke-width="1" ry="0" rx="0" fill="transparent" height="10" /><circle cx="30" cy="30" r="25" stroke="#000000" fill="transparent" stroke-width="1" /><ellipse ry="15" rx="25" fill="transparent" cx="30" stroke="#000000" cy="30" stroke-width="1" /><text x="10" y="50" style="font-family: Verdana; font-size: 10; stroke: #000000; fill: transparent;" transform="" >this is a test</text></svg>
+1
lua5.3.4-win64/test.bat
··· 1 + lua53.exe ..\test.lua > result.html