(no comment)
[my-sputnik-wiki.git] / Tips_And_Snippets.lua
blob5ab376e80499ac972c9590919148c00853549a0b
2 fields = ""
3 title = "Tips & Snippets"
4 category = ""
5 actions = ""
6 config = ""
7 markup_module = ""
8 templates = ""
9 translations = ""
10 permissions = ""
11 html_main = ""
12 html_head = ""
13 html_menu = ""
14 html_logo = ""
15 html_search = ""
16 html_page = ""
17 html_content = ""
18 html_body = ""
19 html_header = ""
20 html_footer = ""
21 html_sidebar = ""
22 html_meta_keywords= ""
23 html_meta_description= ""
24 redirect_destination= ""
25 xssfilter_allowed_tags= ""
26 http_cache_control= ""
27 http_expires = ""
28 content = [[Remember we said the representation format for a wiki page is itself valid lua code. This lets you manipulate programmatically the nodes in the Wiki to achieve different effects. Here's an example.
30 Exporting an Image
31 ------------------
33 This snippet shows how to export the contents of an image node containing a .jpg file to disk. This might be an ugly hack, but it works...
35 require"node.lua"
36 require"base64"
37 out = assert(io.open("node.jpg", "wb"))
38 out:write(base64.decode(content))
39 out:close()
42 edit_ui = ""
43 admin_edit_ui = ""
44 breadcrumb = "Tips"
45 save_hook = ""