Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1106)

Unified Diff: resources/slides_utils.lua

Issue 697923002: add code-style for slides (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « resources/slides_content2.lua ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: resources/slides_utils.lua
diff --git a/resources/slides_utils.lua b/resources/slides_utils.lua
index a0b42b4425883da30f879024902a495e2e46f03a..24e58cee51bb17972c198ae13a32e3d1766440f2 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
« no previous file with comments | « resources/slides_content2.lua ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698