aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources/slides_utils.lua
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2014-11-02 19:19:34 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-02 19:19:34 -0800
commitde330ffc5632b91a1025235e4633a1ddbb846aa4 (patch)
tree5bbec02eeef39f527441496f55b7f76bec6f0bc7 /resources/slides_utils.lua
parent181093939cf6e6d07fda0d441bad7abbbd6e71cb (diff)
add code-style for slides
BUG=skia: TBR= Review URL: https://codereview.chromium.org/697923002
Diffstat (limited to 'resources/slides_utils.lua')
-rw-r--r--resources/slides_utils.lua21
1 files changed, 16 insertions, 5 deletions
diff --git a/resources/slides_utils.lua b/resources/slides_utils.lua
index a0b42b4425..24e58cee51 100644
--- a/resources/slides_utils.lua
+++ b/resources/slides_utils.lua
@@ -58,6 +58,10 @@ function parse_transition_type(s)
return s:match("^<%s*transition%s*=%s*(%a+)%s*>$")
end
+function parse_blockstyle_type(s)
+ return s:match("^<%s*blockstyle%s*=%s*(%a+)%s*>$")
+end
+
function parse_file(file)
local slides = {}
local block = {}
@@ -71,14 +75,21 @@ function parse_file(file)
end
else
local transition_type = parse_transition_type(s)
+ local blockstyle = parse_blockstyle_type(s)
if transition_type then
block["transition"] = transition_type
+ elseif blockstyle then
+ block["blockstyle"] = blockstyle
else
- local n = count_hypens(s)
- block[#block + 1] = {
- indent = n,
- text = trim_ws(s:sub(n + 1, -1))
- }
+ if block.blockstyle == "code" then
+ block[#block + 1] = { text = line }
+ else
+ local n = count_hypens(s)
+ block[#block + 1] = {
+ indent = n,
+ text = trim_ws(s:sub(n + 1, -1))
+ }
+ end
end
end
end