@@ -33,7 +33,7 @@ class Render < Redcarpet::Render::Base
3333 [
3434 # block-level calls
3535 :block_quote ,
36- :block_html , :list , : list_item,
36+ :block_html , :list_item ,
3737
3838 # span-level calls
3939 :autolink , :codespan , :double_emphasis ,
@@ -52,6 +52,14 @@ class Render < Redcarpet::Render::Base
5252 end
5353 end
5454
55+ def list ( content , type )
56+ if type == :unordered
57+ "<!~#{ content } ~!>"
58+ else
59+ "<@~#{ content } ~@>"
60+ end
61+ end
62+
5563 def header ( title , level )
5664 case level
5765 when 1
@@ -104,6 +112,30 @@ def self.generate(filename)
104112 slide_num = "%03d" % ( i +1 )
105113 slide = renderer . render ( slide )
106114
115+ regex = /\< \@ \~ (.*)\~ \@ \> /m
116+ match = slide . match ( regex )
117+ while match && match [ 1 ] && match . post_match do
118+ list = match [ 1 ] . split ( "\n " )
119+ j = 0
120+ list = list . map do |li |
121+ j += 1
122+ "#{ j } . #{ li } "
123+ end
124+ slide . sub! ( regex , list . join ( "\n " ) )
125+ match = match . post_match . match ( regex )
126+ end
127+
128+ regex = /\< \! \~ (.*)\~ \! \> /m
129+ match = slide . match ( regex )
130+ while match && match [ 1 ] && match . post_match do
131+ list = match [ 1 ] . split ( "\n " )
132+ list = list . map do |li |
133+ "\u2022 #{ li } "
134+ end
135+ slide . sub! ( regex , list . join ( "\n " ) )
136+ match = match . post_match . match ( regex )
137+ end
138+
107139 # buffer gets stashed into @buffers array for script template
108140 # needs to track things like the buffer number, code highlighting
109141 # and focus/unfocus stuff
0 commit comments