Mercurial Hosting > luan
comparison core/src/luan/modules/Html.luan @ 325:78a6a71afbfd
use SimplyHTML
git-svn-id: https://luan-java.googlecode.com/svn/trunk@326 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Tue, 03 Mar 2015 06:00:59 +0000 |
parents | b24a35612947 |
children | fb18724521d2 |
comparison
equal
deleted
inserted
replaced
324:b24a35612947 | 325:78a6a71afbfd |
---|---|
10 -- extras | 10 -- extras |
11 | 11 |
12 local Luan = require "luan:Luan" | 12 local Luan = require "luan:Luan" |
13 local ipairs = Luan.ipairs | 13 local ipairs = Luan.ipairs |
14 local type = Luan.type | 14 local type = Luan.type |
15 local Io = require "luan:Io" | |
15 | 16 |
16 function process_url_tags(html) | 17 function process_url_tags(html) |
17 for i, v in ipairs(html) do | 18 for i, v in ipairs(html) do |
18 if type(v) == "table" and v.type == "tag" then | 19 if type(v) == "table" and v.type == "tag" then |
19 if v.name == "url" then | 20 if v.name == "url" then |
33 if type(v) == "table" and v.type == "tag" and v.name == "a" then | 34 if type(v) == "table" and v.type == "tag" and v.name == "a" then |
34 v.attributes.rel = "nofollow" | 35 v.attributes.rel = "nofollow" |
35 end | 36 end |
36 end | 37 end |
37 end | 38 end |
39 | |
40 | |
41 function simple_html_page(parts) | |
42 local head = parts.head | |
43 %> | |
44 <!DOCTYPE html> | |
45 <html lang="en"> | |
46 <head> | |
47 <meta charset="utf-8"> | |
48 <meta name="viewport" content="width=device-width, initial-scale=1"> | |
49 | |
50 <% head and head() %> | |
51 | |
52 <link href="http://www.simplyhtml.org/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet"> | |
53 <link rel="stylesheet" href="http://www.simplyhtml.org/assets/font-awesome/css/font-awesome.min.css"> | |
54 <script src="http://www.simplyhtml.org/assets/jquery/jquery.min.js"></script> | |
55 | |
56 <link href="http://www.simplyhtml.org/assets/simplyhtml/simplyhtml.css" rel="stylesheet"/> | |
57 <script src="http://www.simplyhtml.org/assets/simplyhtml/simplyhtml.js"></script> | |
58 </head> | |
59 <body> | |
60 <% parts.body() %> | |
61 | |
62 <script src="http://www.simplyhtml.org/assets/bootstrap/js/bootstrap.min.js"></script> | |
63 </body> | |
64 </html> | |
65 <% | |
66 end |