hyla 1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile.lock +35 -7
  3. data/README.adoc +10 -2
  4. data/bin/hyla +16 -13
  5. data/hyla.gemspec +6 -3
  6. data/lib/hyla.rb +5 -1
  7. data/lib/hyla/command.rb +12 -10
  8. data/lib/hyla/commands/create.rb +21 -12
  9. data/lib/hyla/commands/generate.rb +168 -59
  10. data/lib/hyla/commands/new.rb +36 -15
  11. data/lib/hyla/commands/watch.rb +6 -2
  12. data/lib/hyla/configuration.rb +169 -27
  13. data/lib/hyla/core_ext.rb +24 -0
  14. data/lib/hyla/project.rb +1 -1
  15. data/lib/resources/backends/haml/deckjs/block_admonition.html.haml +14 -0
  16. data/lib/resources/backends/haml/deckjs/block_audio.html.haml +7 -0
  17. data/lib/resources/backends/haml/deckjs/block_colist.html.haml +21 -0
  18. data/lib/resources/backends/haml/deckjs/block_dlist.html.haml +54 -0
  19. data/lib/resources/backends/haml/deckjs/block_example.haml.haml +5 -0
  20. data/lib/resources/backends/haml/deckjs/block_floating_title.html.haml +1 -0
  21. data/lib/resources/backends/haml/deckjs/block_image.html.haml +11 -0
  22. data/lib/resources/backends/haml/deckjs/block_listing.html.haml +32 -0
  23. data/lib/resources/backends/haml/deckjs/block_literal.html.haml +5 -0
  24. data/lib/resources/backends/haml/deckjs/block_olist.html.haml +11 -0
  25. data/lib/resources/backends/haml/deckjs/block_open.html.haml +5 -0
  26. data/lib/resources/backends/haml/deckjs/block_page_break.html.haml +1 -0
  27. data/lib/resources/backends/haml/deckjs/block_paragraph.html.haml +4 -0
  28. data/lib/resources/backends/haml/deckjs/block_pass.html.haml +1 -0
  29. data/lib/resources/backends/haml/deckjs/block_preamble.html.haml +3 -0
  30. data/lib/resources/backends/haml/deckjs/block_quote.html.haml +12 -0
  31. data/lib/resources/backends/haml/deckjs/block_ruler.html.haml +1 -0
  32. data/lib/resources/backends/haml/deckjs/block_sidebar.html.haml +5 -0
  33. data/lib/resources/backends/haml/deckjs/block_table.html.haml +48 -0
  34. data/lib/resources/backends/haml/deckjs/block_ulist.html.haml +25 -0
  35. data/lib/resources/backends/haml/deckjs/block_verse.html.haml +13 -0
  36. data/lib/resources/backends/haml/deckjs/block_video.html.haml +24 -0
  37. data/lib/resources/backends/haml/deckjs/document.html.haml +182 -0
  38. data/lib/resources/backends/haml/deckjs/embedded.html.haml +10 -0
  39. data/lib/resources/backends/haml/deckjs/inline_anchor.html.haml +12 -0
  40. data/lib/resources/backends/haml/deckjs/inline_break.html.haml +2 -0
  41. data/lib/resources/backends/haml/deckjs/inline_callout.html.haml +7 -0
  42. data/lib/resources/backends/haml/deckjs/inline_footnote.html.haml +8 -0
  43. data/lib/resources/backends/haml/deckjs/inline_image.html.haml +24 -0
  44. data/lib/resources/backends/haml/deckjs/inline_indexterm.html.haml +2 -0
  45. data/lib/resources/backends/haml/deckjs/inline_quoted.html.haml +19 -0
  46. data/lib/resources/backends/haml/deckjs/section.html.haml +7 -0
  47. data/lib/resources/backends/haml/docbook45/block_admonition.xml.haml +7 -0
  48. data/lib/resources/backends/haml/docbook45/block_colist.xml.haml +8 -0
  49. data/lib/resources/backends/haml/docbook45/block_dlist.xml.haml +61 -0
  50. data/lib/resources/backends/haml/docbook45/block_example.xml.haml +14 -0
  51. data/lib/resources/backends/haml/docbook45/block_floating_title.xml.haml +1 -0
  52. data/lib/resources/backends/haml/docbook45/block_image.xml.haml +8 -0
  53. data/lib/resources/backends/haml/docbook45/block_listing.xml.haml +14 -0
  54. data/lib/resources/backends/haml/docbook45/block_literal.xml.haml +7 -0
  55. data/lib/resources/backends/haml/docbook45/block_olist.xml.haml +8 -0
  56. data/lib/resources/backends/haml/docbook45/block_open.xml.haml +25 -0
  57. data/lib/resources/backends/haml/docbook45/block_page_break.xml.haml +1 -0
  58. data/lib/resources/backends/haml/docbook45/block_paragraph.xml.haml +6 -0
  59. data/lib/resources/backends/haml/docbook45/block_pass.xml.haml +1 -0
  60. data/lib/resources/backends/haml/docbook45/block_preamble.xml.haml +7 -0
  61. data/lib/resources/backends/haml/docbook45/block_quote.xml.haml +13 -0
  62. data/lib/resources/backends/haml/docbook45/block_ruler.xml.haml +2 -0
  63. data/lib/resources/backends/haml/docbook45/block_sidebar.xml.haml +7 -0
  64. data/lib/resources/backends/haml/docbook45/block_table.xml.haml +37 -0
  65. data/lib/resources/backends/haml/docbook45/block_ulist.xml.haml +18 -0
  66. data/lib/resources/backends/haml/docbook45/block_verse.xml.haml +10 -0
  67. data/lib/resources/backends/haml/docbook45/document.xml.haml +63 -0
  68. data/lib/resources/backends/haml/docbook45/embedded.xml.haml +1 -0
  69. data/lib/resources/backends/haml/docbook45/helpers.rb +7 -0
  70. data/lib/resources/backends/haml/docbook45/inline_anchor.xml.haml +13 -0
  71. data/lib/resources/backends/haml/docbook45/inline_break.xml.haml +2 -0
  72. data/lib/resources/backends/haml/docbook45/inline_callout.xml.haml +1 -0
  73. data/lib/resources/backends/haml/docbook45/inline_footnote.xml.haml +5 -0
  74. data/lib/resources/backends/haml/docbook45/inline_image.xml.haml +5 -0
  75. data/lib/resources/backends/haml/docbook45/inline_indexterm.xml.haml +18 -0
  76. data/lib/resources/backends/haml/docbook45/inline_quoted.xml.haml +21 -0
  77. data/lib/resources/backends/haml/docbook45/section.xml.haml +5 -0
  78. data/lib/resources/backends/haml/html5/block_admonition.html.haml +14 -0
  79. data/lib/resources/backends/haml/html5/block_audio.html.haml +7 -0
  80. data/lib/resources/backends/haml/html5/block_colist.html.haml +21 -0
  81. data/lib/resources/backends/haml/html5/block_dlist.html.haml +54 -0
  82. data/lib/resources/backends/haml/html5/block_example.haml.haml +5 -0
  83. data/lib/resources/backends/haml/html5/block_floating_title.html.haml +1 -0
  84. data/lib/resources/backends/haml/html5/block_image.html.haml +11 -0
  85. data/lib/resources/backends/haml/html5/block_listing.html.haml +31 -0
  86. data/lib/resources/backends/haml/html5/block_literal.html.haml +5 -0
  87. data/lib/resources/backends/haml/html5/block_math.html.haml +10 -0
  88. data/lib/resources/backends/haml/html5/block_olist.html.haml +9 -0
  89. data/lib/resources/backends/haml/html5/block_open.html.haml +15 -0
  90. data/lib/resources/backends/haml/html5/block_page_break.html.haml +1 -0
  91. data/lib/resources/backends/haml/html5/block_paragraph.html.haml +4 -0
  92. data/lib/resources/backends/haml/html5/block_pass.html.haml +1 -0
  93. data/lib/resources/backends/haml/html5/block_preamble.html.haml +6 -0
  94. data/lib/resources/backends/haml/html5/block_quote.html.haml +12 -0
  95. data/lib/resources/backends/haml/html5/block_ruler.html.haml +1 -0
  96. data/lib/resources/backends/haml/html5/block_sidebar.html.haml +5 -0
  97. data/lib/resources/backends/haml/html5/block_table.html.haml +47 -0
  98. data/lib/resources/backends/haml/html5/block_toc.html.haml +11 -0
  99. data/lib/resources/backends/haml/html5/block_ulist.html.haml +25 -0
  100. data/lib/resources/backends/haml/html5/block_verse.html.haml +13 -0
  101. data/lib/resources/backends/haml/html5/block_video.html.haml +27 -0
  102. data/lib/resources/backends/haml/html5/document.html.haml +114 -0
  103. data/lib/resources/backends/haml/html5/embedded.html.haml +10 -0
  104. data/lib/resources/backends/haml/html5/helpers.rb +7 -0
  105. data/lib/resources/backends/haml/html5/inline_anchor.html.haml +11 -0
  106. data/lib/resources/backends/haml/html5/inline_break.html.haml +2 -0
  107. data/lib/resources/backends/haml/html5/inline_button.html.haml +1 -0
  108. data/lib/resources/backends/haml/html5/inline_callout.html.haml +7 -0
  109. data/lib/resources/backends/haml/html5/inline_footnote.html.haml +8 -0
  110. data/lib/resources/backends/haml/html5/inline_image.html.haml +24 -0
  111. data/lib/resources/backends/haml/html5/inline_indexterm.html.haml +2 -0
  112. data/lib/resources/backends/haml/html5/inline_kbd.html.haml +8 -0
  113. data/lib/resources/backends/haml/html5/inline_menu.html.haml +15 -0
  114. data/lib/resources/backends/haml/html5/inline_quoted.html.haml +22 -0
  115. data/lib/resources/backends/haml/html5/section.html.haml +21 -0
  116. data/lib/resources/backends/haml/revealjs/block_image.html.haml +11 -0
  117. data/lib/resources/backends/haml/revealjs/block_olist.html.haml +8 -0
  118. data/lib/resources/backends/haml/revealjs/block_ulist.html.haml +8 -0
  119. data/lib/resources/backends/haml/revealjs/document.html.haml +61 -0
  120. data/lib/resources/backends/haml/revealjs/section.html.haml +10 -0
  121. data/lib/resources/backends/slim/docbook45/block_admonition.xml.slim +7 -0
  122. data/lib/resources/backends/slim/docbook45/block_colist.xml.slim +8 -0
  123. data/lib/resources/backends/slim/docbook45/block_dlist.xml.slim +61 -0
  124. data/lib/resources/backends/slim/docbook45/block_example.xml.slim +13 -0
  125. data/lib/resources/backends/slim/docbook45/block_floating_title.xml.slim +1 -0
  126. data/lib/resources/backends/slim/docbook45/block_image.xml.slim +7 -0
  127. data/lib/resources/backends/slim/docbook45/block_listing.xml.slim +14 -0
  128. data/lib/resources/backends/slim/docbook45/block_literal.xml.slim +7 -0
  129. data/lib/resources/backends/slim/docbook45/block_olist.xml.slim +8 -0
  130. data/lib/resources/backends/slim/docbook45/block_open.xml.slim +25 -0
  131. data/lib/resources/backends/slim/docbook45/block_page_break.xml.slim +1 -0
  132. data/lib/resources/backends/slim/docbook45/block_paragraph.xml.slim +6 -0
  133. data/lib/resources/backends/slim/docbook45/block_pass.xml.slim +1 -0
  134. data/lib/resources/backends/slim/docbook45/block_preamble.xml.slim +7 -0
  135. data/lib/resources/backends/slim/docbook45/block_quote.xml.slim +13 -0
  136. data/lib/resources/backends/slim/docbook45/block_ruler.xml.slim +2 -0
  137. data/lib/resources/backends/slim/docbook45/block_sidebar.xml.slim +7 -0
  138. data/lib/resources/backends/slim/docbook45/block_table.xml.slim +36 -0
  139. data/lib/resources/backends/slim/docbook45/block_ulist.xml.slim +18 -0
  140. data/lib/resources/backends/slim/docbook45/block_verse.xml.slim +10 -0
  141. data/lib/resources/backends/slim/docbook45/document.xml.slim +63 -0
  142. data/lib/resources/backends/slim/docbook45/embedded.xml.slim +1 -0
  143. data/lib/resources/backends/slim/docbook45/helpers.rb +9 -0
  144. data/lib/resources/backends/slim/docbook45/inline_anchor.xml.slim +13 -0
  145. data/lib/resources/backends/slim/docbook45/inline_break.xml.slim +2 -0
  146. data/lib/resources/backends/slim/docbook45/inline_callout.xml.slim +1 -0
  147. data/lib/resources/backends/slim/docbook45/inline_footnote.xml.slim +4 -0
  148. data/lib/resources/backends/slim/docbook45/inline_image.xml.slim +4 -0
  149. data/lib/resources/backends/slim/docbook45/inline_indexterm.xml.slim +16 -0
  150. data/lib/resources/backends/slim/docbook45/inline_quoted.xml.slim +21 -0
  151. data/lib/resources/backends/slim/docbook45/section.xml.slim +5 -0
  152. data/lib/resources/backends/slim/document.html.bk.slim +335 -0
  153. data/lib/resources/backends/slim/dzslides/block_admonition.html.slim +19 -0
  154. data/lib/resources/backends/slim/dzslides/block_colist.html.slim +20 -0
  155. data/lib/resources/backends/slim/dzslides/block_dlist.html.slim +10 -0
  156. data/lib/resources/backends/slim/dzslides/block_example.html.slim +4 -0
  157. data/lib/resources/backends/slim/dzslides/block_floating_title.html.slim +1 -0
  158. data/lib/resources/backends/slim/dzslides/block_image.html.slim +14 -0
  159. data/lib/resources/backends/slim/dzslides/block_listing.html.slim +8 -0
  160. data/lib/resources/backends/slim/dzslides/block_literal.html.slim +11 -0
  161. data/lib/resources/backends/slim/dzslides/block_olist.html.slim +6 -0
  162. data/lib/resources/backends/slim/dzslides/block_open.html.slim +4 -0
  163. data/lib/resources/backends/slim/dzslides/block_paragraph.html.slim +1 -0
  164. data/lib/resources/backends/slim/dzslides/block_pass.html.slim +1 -0
  165. data/lib/resources/backends/slim/dzslides/block_quote.html.slim +11 -0
  166. data/lib/resources/backends/slim/dzslides/block_ruler.html.slim +1 -0
  167. data/lib/resources/backends/slim/dzslides/block_table.html.slim +45 -0
  168. data/lib/resources/backends/slim/dzslides/block_ulist.html.slim +6 -0
  169. data/lib/resources/backends/slim/dzslides/block_verse.html.slim +12 -0
  170. data/lib/resources/backends/slim/dzslides/block_video.html.slim +6 -0
  171. data/lib/resources/backends/slim/dzslides/document.html.slim +67 -0
  172. data/lib/resources/backends/slim/dzslides/embedded.html.slim +1 -0
  173. data/lib/resources/backends/slim/dzslides/helpers.rb +9 -0
  174. data/lib/resources/backends/slim/dzslides/inline_anchor.html.slim +11 -0
  175. data/lib/resources/backends/slim/dzslides/inline_break.html.slim +2 -0
  176. data/lib/resources/backends/slim/dzslides/inline_callout.html.slim +7 -0
  177. data/lib/resources/backends/slim/dzslides/inline_footnote.html.slim +6 -0
  178. data/lib/resources/backends/slim/dzslides/inline_image.html.slim +24 -0
  179. data/lib/resources/backends/slim/dzslides/inline_indexterm.html.slim +2 -0
  180. data/lib/resources/backends/slim/dzslides/inline_kbd.html.slim +8 -0
  181. data/lib/resources/backends/slim/dzslides/inline_quoted.html.slim +23 -0
  182. data/lib/resources/backends/slim/dzslides/section.html.slim +4 -0
  183. data/lib/resources/backends/slim/html5/block_admonition.html.slim +13 -0
  184. data/lib/resources/backends/slim/html5/block_audio.html.slim +6 -0
  185. data/lib/resources/backends/slim/html5/block_colist.html.slim +20 -0
  186. data/lib/resources/backends/slim/html5/block_dlist.html.slim +53 -0
  187. data/lib/resources/backends/slim/html5/block_example.html.slim +4 -0
  188. data/lib/resources/backends/slim/html5/block_floating_title.html.slim +1 -0
  189. data/lib/resources/backends/slim/html5/block_image.html.slim +10 -0
  190. data/lib/resources/backends/slim/html5/block_listing.html.slim +31 -0
  191. data/lib/resources/backends/slim/html5/block_literal.html.slim +4 -0
  192. data/lib/resources/backends/slim/html5/block_math.html.slim +10 -0
  193. data/lib/resources/backends/slim/html5/block_olist.html.slim +9 -0
  194. data/lib/resources/backends/slim/html5/block_open.html.slim +15 -0
  195. data/lib/resources/backends/slim/html5/block_page_break.html.slim +1 -0
  196. data/lib/resources/backends/slim/html5/block_paragraph.html.slim +4 -0
  197. data/lib/resources/backends/slim/html5/block_pass.html.slim +1 -0
  198. data/lib/resources/backends/slim/html5/block_preamble.html.slim +6 -0
  199. data/lib/resources/backends/slim/html5/block_quote.html.slim +14 -0
  200. data/lib/resources/backends/slim/html5/block_ruler.html.slim +1 -0
  201. data/lib/resources/backends/slim/html5/block_sidebar.html.slim +5 -0
  202. data/lib/resources/backends/slim/html5/block_table.html.slim +45 -0
  203. data/lib/resources/backends/slim/html5/block_toc.html.slim +12 -0
  204. data/lib/resources/backends/slim/html5/block_ulist.html.slim +25 -0
  205. data/lib/resources/backends/slim/html5/block_verse.html.slim +14 -0
  206. data/lib/resources/backends/slim/html5/block_video.html.slim +27 -0
  207. data/lib/resources/backends/slim/html5/document.html.slim +112 -0
  208. data/lib/resources/backends/slim/html5/embedded.html.slim +9 -0
  209. data/lib/resources/backends/slim/html5/helpers.rb +8 -0
  210. data/lib/resources/backends/slim/html5/inline_anchor.html.slim +11 -0
  211. data/lib/resources/backends/slim/html5/inline_break.html.slim +2 -0
  212. data/lib/resources/backends/slim/html5/inline_button.html.slim +1 -0
  213. data/lib/resources/backends/slim/html5/inline_callout.html.slim +7 -0
  214. data/lib/resources/backends/slim/html5/inline_footnote.html.slim +6 -0
  215. data/lib/resources/backends/slim/html5/inline_image.html.slim +24 -0
  216. data/lib/resources/backends/slim/html5/inline_indexterm.html.slim +2 -0
  217. data/lib/resources/backends/slim/html5/inline_kbd.html.slim +8 -0
  218. data/lib/resources/backends/slim/html5/inline_menu.html.slim +15 -0
  219. data/lib/resources/backends/slim/html5/inline_quoted.html.slim +22 -0
  220. data/lib/resources/backends/slim/html5/section.html.slim +20 -0
  221. data/lib/resources/backends/slim/revealjs/block_admonition.html.slim +13 -0
  222. data/lib/resources/backends/slim/revealjs/block_audio.html.slim +6 -0
  223. data/lib/resources/backends/slim/revealjs/block_colist.html.slim +20 -0
  224. data/lib/resources/backends/slim/revealjs/block_dlist.html.slim +53 -0
  225. data/lib/resources/backends/slim/revealjs/block_example.html.slim +4 -0
  226. data/lib/resources/backends/slim/revealjs/block_floating_title.html.slim +1 -0
  227. data/lib/resources/backends/slim/revealjs/block_image.html.slim +10 -0
  228. data/lib/resources/backends/slim/revealjs/block_listing.html.slim +31 -0
  229. data/lib/resources/backends/slim/revealjs/block_literal.html.slim +4 -0
  230. data/lib/resources/backends/slim/revealjs/block_math.html.slim +10 -0
  231. data/lib/resources/backends/slim/revealjs/block_olist.html.slim +9 -0
  232. data/lib/resources/backends/slim/revealjs/block_open.html.slim +15 -0
  233. data/lib/resources/backends/slim/revealjs/block_page_break.html.slim +1 -0
  234. data/lib/resources/backends/slim/revealjs/block_paragraph.html.slim +4 -0
  235. data/lib/resources/backends/slim/revealjs/block_pass.html.slim +1 -0
  236. data/lib/resources/backends/slim/revealjs/block_preamble.html.slim +6 -0
  237. data/lib/resources/backends/slim/revealjs/block_quote.html.slim +14 -0
  238. data/lib/resources/backends/slim/revealjs/block_ruler.html.slim +1 -0
  239. data/lib/resources/backends/slim/revealjs/block_sidebar.html.slim +5 -0
  240. data/lib/resources/backends/slim/revealjs/block_table.html.slim +45 -0
  241. data/lib/resources/backends/slim/revealjs/block_toc.html.slim +12 -0
  242. data/lib/resources/backends/slim/revealjs/block_ulist.html.slim +25 -0
  243. data/lib/resources/backends/slim/revealjs/block_verse.html.slim +14 -0
  244. data/lib/resources/backends/slim/revealjs/block_video.html.slim +27 -0
  245. data/lib/resources/backends/slim/revealjs/document.html.slim +87 -0
  246. data/lib/resources/backends/slim/revealjs/embedded.html.slim +9 -0
  247. data/lib/resources/backends/slim/revealjs/helpers.rb +8 -0
  248. data/lib/resources/backends/slim/revealjs/inline_anchor.html.slim +11 -0
  249. data/lib/resources/backends/slim/revealjs/inline_break.html.slim +2 -0
  250. data/lib/resources/backends/slim/revealjs/inline_button.html.slim +1 -0
  251. data/lib/resources/backends/slim/revealjs/inline_callout.html.slim +7 -0
  252. data/lib/resources/backends/slim/revealjs/inline_footnote.html.slim +6 -0
  253. data/lib/resources/backends/slim/revealjs/inline_image.html.slim +24 -0
  254. data/lib/resources/backends/slim/revealjs/inline_indexterm.html.slim +2 -0
  255. data/lib/resources/backends/slim/revealjs/inline_kbd.html.slim +8 -0
  256. data/lib/resources/backends/slim/revealjs/inline_menu.html.slim +15 -0
  257. data/lib/resources/backends/slim/revealjs/inline_quoted.html.slim +22 -0
  258. data/lib/resources/backends/slim/revealjs/section.html.slim +3 -0
  259. data/lib/resources/deck.js/core/deck.core.css +407 -0
  260. data/lib/resources/deck.js/core/deck.core.js +498 -0
  261. data/lib/resources/deck.js/extensions/deck.js-blank/README.md +10 -0
  262. data/lib/resources/deck.js/extensions/deck.js-blank/deck.blank.js +33 -0
  263. data/lib/resources/deck.js/extensions/goto/deck.goto.css +41 -0
  264. data/lib/resources/deck.js/extensions/goto/deck.goto.html +7 -0
  265. data/lib/resources/deck.js/extensions/goto/deck.goto.js +170 -0
  266. data/lib/resources/deck.js/extensions/hash/deck.hash.css +13 -0
  267. data/lib/resources/deck.js/extensions/hash/deck.hash.html +2 -0
  268. data/lib/resources/deck.js/extensions/hash/deck.hash.js +142 -0
  269. data/lib/resources/deck.js/extensions/menu/deck.menu.css +47 -0
  270. data/lib/resources/deck.js/extensions/menu/deck.menu.js +187 -0
  271. data/lib/resources/deck.js/extensions/navigation/deck.navigation.css +43 -0
  272. data/lib/resources/deck.js/extensions/navigation/deck.navigation.html +3 -0
  273. data/lib/resources/deck.js/extensions/navigation/deck.navigation.js +92 -0
  274. data/lib/resources/deck.js/extensions/scale/deck.scale.css +28 -0
  275. data/lib/resources/deck.js/extensions/scale/deck.scale.js +170 -0
  276. data/lib/resources/deck.js/extensions/split/README.md +30 -0
  277. data/lib/resources/deck.js/extensions/split/deck.split.js +59 -0
  278. data/lib/resources/deck.js/extensions/status/deck.status.css +18 -0
  279. data/lib/resources/deck.js/extensions/status/deck.status.html +6 -0
  280. data/lib/resources/deck.js/extensions/status/deck.status.js +95 -0
  281. data/lib/resources/deck.js/extensions/toc/deck.toc.css +40 -0
  282. data/lib/resources/deck.js/extensions/toc/deck.toc.html +12 -0
  283. data/lib/resources/deck.js/extensions/toc/deck.toc.js +271 -0
  284. data/lib/resources/deck.js/jquery-1.7.2.min.js +4 -0
  285. data/lib/resources/deck.js/jquery.min.js +4 -0
  286. data/lib/resources/deck.js/modernizr.custom.js +4 -0
  287. data/lib/resources/deck.js/themes/style/beamer.css +286 -0
  288. data/lib/resources/deck.js/themes/style/neon.css +123 -0
  289. data/lib/resources/deck.js/themes/style/swiss.css +84 -0
  290. data/lib/resources/deck.js/themes/style/web-2.0.css +214 -0
  291. data/lib/resources/deck.js/themes/transition/beamer.css +66 -0
  292. data/lib/resources/deck.js/themes/transition/fade.css +43 -0
  293. data/lib/resources/deck.js/themes/transition/horizontal-slide.css +76 -0
  294. data/lib/resources/deck.js/themes/transition/vertical-slide.css +94 -0
  295. data/lib/resources/revealjs/LICENSE +19 -0
  296. data/lib/resources/revealjs/css/print/paper.css +176 -0
  297. data/lib/resources/revealjs/css/print/pdf.css +190 -0
  298. data/lib/resources/revealjs/css/reveal.css +1880 -0
  299. data/lib/resources/revealjs/css/reveal.min.css +7 -0
  300. data/lib/resources/revealjs/css/theme/README.md +25 -0
  301. data/lib/resources/revealjs/css/theme/beige.css +148 -0
  302. data/lib/resources/revealjs/css/theme/blood.css +175 -0
  303. data/lib/resources/revealjs/css/theme/default.css +148 -0
  304. data/lib/resources/revealjs/css/theme/moon.css +148 -0
  305. data/lib/resources/revealjs/css/theme/night.css +136 -0
  306. data/lib/resources/revealjs/css/theme/serif.css +138 -0
  307. data/lib/resources/revealjs/css/theme/simple.css +138 -0
  308. data/lib/resources/revealjs/css/theme/sky.css +145 -0
  309. data/lib/resources/revealjs/css/theme/solarized.css +148 -0
  310. data/lib/resources/revealjs/css/theme/source/beige.scss +50 -0
  311. data/lib/resources/revealjs/css/theme/source/blood.scss +91 -0
  312. data/lib/resources/revealjs/css/theme/source/default.scss +42 -0
  313. data/lib/resources/revealjs/css/theme/source/moon.scss +68 -0
  314. data/lib/resources/revealjs/css/theme/source/night.scss +35 -0
  315. data/lib/resources/revealjs/css/theme/source/serif.scss +35 -0
  316. data/lib/resources/revealjs/css/theme/source/simple.scss +38 -0
  317. data/lib/resources/revealjs/css/theme/source/sky.scss +46 -0
  318. data/lib/resources/revealjs/css/theme/source/solarized.scss +74 -0
  319. data/lib/resources/revealjs/css/theme/template/mixins.scss +29 -0
  320. data/lib/resources/revealjs/css/theme/template/settings.scss +34 -0
  321. data/lib/resources/revealjs/css/theme/template/theme.scss +170 -0
  322. data/lib/resources/revealjs/js/reveal.js +3382 -0
  323. data/lib/resources/revealjs/js/reveal.min.js +9 -0
  324. data/lib/resources/revealjs/lib/css/zenburn.css +114 -0
  325. data/lib/resources/revealjs/lib/font/league_gothic-webfont.eot +0 -0
  326. data/lib/resources/revealjs/lib/font/league_gothic-webfont.svg +230 -0
  327. data/lib/resources/revealjs/lib/font/league_gothic-webfont.ttf +0 -0
  328. data/lib/resources/revealjs/lib/font/league_gothic-webfont.woff +0 -0
  329. data/lib/resources/revealjs/lib/font/league_gothic_license +2 -0
  330. data/lib/resources/revealjs/lib/js/classList.js +2 -0
  331. data/lib/resources/revealjs/lib/js/head.min.js +8 -0
  332. data/lib/resources/revealjs/lib/js/html5shiv.js +7 -0
  333. data/lib/resources/revealjs/plugin/highlight/highlight.js +32 -0
  334. data/lib/resources/revealjs/plugin/leap/leap.js +157 -0
  335. data/lib/resources/revealjs/plugin/markdown/example.html +129 -0
  336. data/lib/resources/revealjs/plugin/markdown/example.md +31 -0
  337. data/lib/resources/revealjs/plugin/markdown/markdown.js +392 -0
  338. data/lib/resources/revealjs/plugin/markdown/marked.js +37 -0
  339. data/lib/resources/revealjs/plugin/math/math.js +64 -0
  340. data/lib/resources/revealjs/plugin/multiplex/client.js +13 -0
  341. data/lib/resources/revealjs/plugin/multiplex/index.js +56 -0
  342. data/lib/resources/revealjs/plugin/multiplex/master.js +51 -0
  343. data/lib/resources/revealjs/plugin/notes-server/client.js +57 -0
  344. data/lib/resources/revealjs/plugin/notes-server/index.js +59 -0
  345. data/lib/resources/revealjs/plugin/notes-server/notes.html +142 -0
  346. data/lib/resources/revealjs/plugin/notes/notes.html +267 -0
  347. data/lib/resources/revealjs/plugin/notes/notes.js +78 -0
  348. data/lib/resources/revealjs/plugin/postmessage/example.html +39 -0
  349. data/lib/resources/revealjs/plugin/postmessage/postmessage.js +42 -0
  350. data/lib/resources/revealjs/plugin/print-pdf/print-pdf.js +44 -0
  351. data/lib/resources/revealjs/plugin/remotes/remotes.js +39 -0
  352. data/lib/resources/revealjs/plugin/search/search.js +196 -0
  353. data/lib/resources/revealjs/plugin/zoom-js/zoom.js +258 -0
  354. data/lib/resources/styles/asciidoctor.css +652 -0
  355. data/lib/resources/styles/colony.css +660 -0
  356. data/lib/resources/styles/foundation-lime.css +657 -0
  357. data/lib/resources/styles/foundation-potion.css +657 -0
  358. data/lib/resources/styles/foundation.css +648 -0
  359. data/lib/resources/styles/github.css +669 -0
  360. data/lib/resources/styles/golo.css +669 -0
  361. data/lib/resources/styles/iconic.css +692 -0
  362. data/lib/resources/styles/maker.css +668 -0
  363. data/lib/resources/styles/readthedocs.css +669 -0
  364. data/lib/resources/styles/redhat.css +654 -0
  365. data/lib/resources/styles/riak.css +689 -0
  366. data/lib/resources/styles/rocket-panda.css +662 -0
  367. data/lib/resources/styles/rubygems.css +650 -0
  368. data/lib/templates/_config.yml +27 -0
  369. data/lib/templates/{training → book}/GemFile +2 -1
  370. data/lib/templates/{training → book}/development/audio/ocean_waves.mp3 +0 -0
  371. data/lib/templates/book/development/book.adoc +121 -0
  372. data/lib/templates/{training → book}/development/image/hyla_frog.jpg +0 -0
  373. data/lib/templates/{training → book}/development/video/small.ogv +0 -0
  374. data/lib/templates/{training → book}/introduction/audio/ocean_waves.mp3 +0 -0
  375. data/lib/templates/book/introduction/book.adoc +121 -0
  376. data/lib/templates/{training → book}/introduction/image/hyla_frog.jpg +0 -0
  377. data/lib/templates/{training → book}/introduction/video/small.ogv +0 -0
  378. data/lib/templates/book/readme.adoc +10 -0
  379. data/lib/templates/sample/asciidoc_article.adoc +101 -10
  380. data/lib/templates/sample/asciidoc_audio.adoc +1 -1
  381. data/lib/templates/sample/asciidoc_book.adoc +125 -0
  382. data/lib/templates/sample/asciidoc_image.adoc +26 -0
  383. data/lib/templates/sample/asciidoc_report.adoc +66 -0
  384. data/lib/templates/sample/asciidoc_source.adoc +53 -0
  385. data/lib/templates/sample/asciidoc_table.adoc +36 -0
  386. data/lib/templates/sample/asciidoc_video.adoc +9 -1
  387. data/lib/templates/sample/slideshow_revealjs.adoc +26 -0
  388. data/lib/templates/training-exercises/_config.yml +3 -0
  389. data/lib/templates/training/{introduction → module-1}/article.adoc +7 -2
  390. data/lib/templates/training/module-1/audio/ocean_waves.mp3 +0 -0
  391. data/lib/templates/training/module-1/image/hyla_arborea.jpg +0 -0
  392. data/lib/templates/training/module-1/video/small.ogv +0 -0
  393. data/lib/templates/training/{development → module-2}/article.adoc +7 -2
  394. data/lib/templates/training/module-2/audio/ocean_waves.mp3 +0 -0
  395. data/lib/templates/training/module-2/image/hyla_arborea.jpg +0 -0
  396. data/lib/templates/training/module-2/video/small.ogv +0 -0
  397. data/lib/templates/training/readme.adoc +10 -1
  398. data/scenario.adoc +113 -20
  399. data/test/reports/test-1.0.x-11-12-2013.txt +123 -0
  400. data/todo.adoc +39 -0
  401. metadata +473 -51
  402. data/lib/hyla/training.rb +0 -25
  403. data/lib/templates/sample/asciidoc_source_highlight.adoc +0 -37
  404. data/lib/templates/training-exercises/Gemfile +0 -4
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTIyMmVhNzkzNTNlZjM0NGI1YjJjMjg3Nzc1ZGM3MjVmZWI5OWIyOQ==
5
+ data.tar.gz: !binary |-
6
+ OGU5ZDgzNzVjMTUzNGFiNmE5MmY5M2I3NDAyYjA2ZTY1NWU1ZDdhZg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzEzNjZlZjZiODAyNzZmYTE3YjYyNmQ4ZTYxM2U0NjVjZjcwNjc3MzEyODI4
10
+ ZDgxYWFlZDExNDVkMzc0MGQ1YTNkMjdkMTcyYzA0NGU1ODBjZWVmOTI5OWY5
11
+ ZGVlMDY3YmJjMGFhZTgxODg3Y2JlNjM3MGFjYWVkMzZhODVhZTA=
12
+ data.tar.gz: !binary |-
13
+ MTVhN2FhMTYyNThmMWEyNjhhMzdhMDY4YTg3ZDcwMmQwNzUwZGFjZjkxN2Rm
14
+ MDkzNWMyYzI2NGFhN2NlMjA0Y2ViOWQ1MWE5MDU0NDZhY2FhYjI5NDc5ZWFm
15
+ MDMzNGY1OWE1MGMzY2UzNzNkY2NkMTBlMmFkNjNhMjRmOWM4YjM=
@@ -1,19 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hyla (1.0)
4
+ hyla (1.0.x)
5
5
  asciidoctor (~> 0.1.4)
6
6
  colorator (~> 0.1)
7
7
  commander (~> 4.1.3)
8
8
  em-websocket (~> 0.5)
9
+ guard (~> 1.8.3)
10
+ haml
11
+ listen (~> 1.3.1)
9
12
  multi_json (~> 1.8)
13
+ safe_yaml (~> 1.0.0)
14
+ slim
15
+ tilt
10
16
 
11
17
  GEM
12
18
  remote: https://rubygems.org/
13
19
  specs:
14
20
  asciidoctor (0.1.4)
15
- celluloid (0.15.2)
16
- timers (~> 1.1.0)
21
+ coderay (1.1.0)
17
22
  colorator (0.1)
18
23
  commander (4.1.5)
19
24
  highline (~> 1.6.11)
@@ -22,21 +27,45 @@ GEM
22
27
  http_parser.rb (~> 0.5.3)
23
28
  eventmachine (1.0.3)
24
29
  ffi (1.9.3)
30
+ formatador (0.2.4)
31
+ guard (1.8.3)
32
+ formatador (>= 0.2.4)
33
+ listen (~> 1.3)
34
+ lumberjack (>= 1.0.2)
35
+ pry (>= 0.9.10)
36
+ thor (>= 0.14.6)
37
+ haml (4.0.4)
38
+ tilt
25
39
  highline (1.6.20)
26
40
  http_parser.rb (0.5.3)
27
41
  json (1.8.1)
28
- listen (2.4.0)
29
- celluloid (>= 0.15.2)
42
+ listen (1.3.1)
30
43
  rb-fsevent (>= 0.9.3)
31
44
  rb-inotify (>= 0.9)
45
+ rb-kqueue (>= 0.2)
46
+ lumberjack (1.0.4)
47
+ method_source (0.8.2)
32
48
  multi_json (1.8.2)
49
+ pry (0.9.12.4)
50
+ coderay (~> 1.0)
51
+ method_source (~> 0.8)
52
+ slop (~> 3.4)
33
53
  rake (10.1.0)
34
54
  rb-fsevent (0.9.3)
35
55
  rb-inotify (0.9.2)
36
56
  ffi (>= 0.5.0)
57
+ rb-kqueue (0.2.0)
58
+ ffi (>= 0.5.0)
37
59
  rdoc (3.12.2)
38
60
  json (~> 1.4)
39
- timers (1.1.0)
61
+ safe_yaml (1.0.0)
62
+ slim (2.0.2)
63
+ temple (~> 0.6.6)
64
+ tilt (>= 1.3.3, < 2.1)
65
+ slop (3.4.7)
66
+ temple (0.6.7)
67
+ thor (0.18.1)
68
+ tilt (1.4.1)
40
69
 
41
70
  PLATFORMS
42
71
  ruby
@@ -44,6 +73,5 @@ PLATFORMS
44
73
  DEPENDENCIES
45
74
  bundler (~> 1.3)
46
75
  hyla!
47
- listen (~> 2.0)
48
76
  rake (~> 10.1)
49
77
  rdoc (~> 3.11)
@@ -19,12 +19,20 @@ And then execute:
19
19
 
20
20
  **Or** install it yourself as:
21
21
 
22
- $ gem install hyla
22
+ $ gem install hyla -v 1.0.1
23
23
 
24
24
  == For Developer's only
25
25
 
26
+ Clone Git project locally, move to Hyla directory and execute the following commands
26
27
  gem build hyla.gemspec
27
- sudo gem install hyla-1.0.gem
28
+ sudo gem install hyla-1.0.x.gem
29
+
30
+ == To publish Hyla to Gem Repo
31
+
32
+ gem build hyla.gemspec
33
+ gem install hyla-1.0.x.gem
34
+ gem yank hyla -v 1.0.x
35
+ gem push hyla-1.0.x.gem
28
36
 
29
37
  == Usage
30
38
 
data/bin/hyla CHANGED
@@ -26,8 +26,8 @@ def add_build_options(c)
26
26
  end
27
27
 
28
28
  def add_common_options(c)
29
- c.option '-s', '--source [DIR]', 'Source directory (defaults to ./)'
30
- c.option '-d', '--destination [DIR]', 'Destination directory (defaults to ./generated_content)'
29
+ c.option '--s', '--source [DIR]', 'Source directory (defaults to ./)'
30
+ c.option '--d', '--destination [DIR]', 'Destination directory (defaults to ./generated_content)'
31
31
  end
32
32
 
33
33
  #
@@ -38,7 +38,7 @@ command :new do |c|
38
38
  c.description = 'Creates a new Hyla project using a template or blank to the PATH specified'
39
39
  c.option '--f','--force', 'Force creation even if PATH already exists'
40
40
  c.option '--b','--blank', 'Creates project but with empty files'
41
- c.option '--t','--template_type TEMPLATE_TYPE', String, 'Template Type to be used (documentation, training, training-exercises, blog, web, ...)'
41
+ c.option '--t','--template_type TEMPLATE_TYPE', String, 'Template Type to be used (documentation, book, training, training-exercises, blog, web, ...)'
42
42
 
43
43
  c.action do |args, options|
44
44
  Hyla::Commands::New.process(args, options.__hash__)
@@ -50,13 +50,15 @@ end
50
50
  #
51
51
  command :create do |c|
52
52
  c.syntax = 'hyla create ARTEFACT TYPE'
53
- c.description = 'Creates a new file from asciidoc artefacts for an existing project'
53
+ c.description = 'Creates a new file from asciidoc artefact for an existing project'
54
54
  c.option '--a', '--artefact_type [ARTEFACT_TYPE]', String, 'Artefact Type : article, audio, video, blog entry ...'
55
- c.option '--d', '--destination [DIR]', String, 'Destination directory'
56
55
  c.option '--t', '--type [TYPE]', String, 'Type : asciidoc, slideshow'
57
56
 
57
+ add_common_options(c)
58
+
58
59
  c.action do |args, options|
59
- Hyla::Commands::Create.process(args, options.__hash__)
60
+ config = Hyla::Configuration.parse(options.__hash__)
61
+ Hyla::Commands::Create.process(args, config)
60
62
  end
61
63
  end
62
64
 
@@ -66,15 +68,18 @@ end
66
68
  command :generate do |c|
67
69
  c.syntax = 'hyla generate [OPTIONS]'
68
70
  c.description = 'Generate content from asciidoc files (Table Of Content, modules, ...) to HTML, Slideshow'
69
- c.option '--s', '--source [DIR]', String, 'Directory to be watched'
70
- c.option '--d', '--destination [DIR]', String, 'Destination directory'
71
+ c.option '--b', '--backend [BACKEND]', String, 'Backend to be used : HTML5, deckjs, revealjs, ...'
71
72
  c.option '--p', '--project_name [PROJECT_NAME]', String, 'Project Name'
72
73
  c.option '--r', '--rendering [RENDERING]', String, 'Code of the rendering : toc2html, adoc2html'
73
74
  c.option '--t', '--toc [PATH]', String, 'File Path of the asciidoc file containing the Table of Content'
75
+ c.option '--st', '--style [STYLE]', String, 'Stylesheet theme to be applied : asciidoctor, redhat, github, colony, foundation, ...'
76
+ c.option '--a', '--attributes [KEY=VALUE,KEY=VALUE]', String, 'Asciidoctor attributes'
74
77
 
75
- c.action do |args, options|
78
+ add_common_options(c)
76
79
 
77
- Hyla::Commands::Generate.process(args, options.__hash__)
80
+ c.action do |args, options|
81
+ config = Hyla::Configuration.parse(options.__hash__)
82
+ Hyla::Commands::Generate.process(args, config)
78
83
  end
79
84
  end
80
85
 
@@ -82,15 +87,13 @@ end
82
87
  command :watch do |c|
83
88
  c.syntax = 'hyla watch [options]'
84
89
  c.description = 'Watch directories for any change, add or file deleted and render document (HTML5)'
85
- c.option '--d', '--destination DIR', String, 'Output directory where content must be generated'
86
- c.option '--s', '--source DIR', String, 'Directory to be watched'
87
90
  add_common_options(c)
88
91
 
89
92
  c.action do |args, options|
90
93
 
91
94
  options.default :serving => true
92
95
 
93
- # TODO Find if it is possible to watch files, generate HTML content - asciidoctor, expose content using HTTPServe and expose WebSocket - LiveReload
96
+ # TODO Find if it is possible to watch files, generate HTML content - asciidoctor, expose content using HTTPServer and expose WebSocket - LiveReload
94
97
  # as they are started in 2 different threads, this is not possible with existing code
95
98
  # Hyla::Commands::Serve.process(args,options.__hash__)
96
99
  Hyla::Commands::Watch.process(args, options.__hash__)
@@ -21,15 +21,18 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'bundler', '~> 1.3'
22
22
  s.add_development_dependency 'rake', '~> 10.1'
23
23
  s.add_development_dependency 'rdoc', '~> 3.11'
24
- # TODO - Review if guard / listen are mandatory deps
25
- # s.add_development_dependency 'guard', '~> 1.8.3'
26
- s.add_development_dependency 'listen', '~> 2.0'
27
24
 
28
25
  # Ruby command-line executables
29
26
  s.add_runtime_dependency 'commander', '~> 4.1.3'
30
27
  s.add_runtime_dependency 'asciidoctor', '~> 0.1.4'
31
28
  s.add_runtime_dependency 'em-websocket', '~> 0.5'
32
29
  s.add_runtime_dependency 'multi_json', '~> 1.8'
30
+ s.add_runtime_dependency 'tilt'
31
+ s.add_runtime_dependency 'haml'
32
+ s.add_runtime_dependency 'slim'
33
+ s.add_runtime_dependency 'guard', '~> 1.8.3'
34
+ s.add_runtime_dependency 'listen', '~> 1.3.1'
35
+ s.add_runtime_dependency 'safe_yaml', '~> 1.0.0'
33
36
 
34
37
  # Colorize Text Terminal
35
38
  s.add_runtime_dependency 'colorator', '~> 0.1'
@@ -19,7 +19,11 @@ require 'rubygems'
19
19
  require 'colorator'
20
20
  require 'listen'
21
21
  require 'guard'
22
+ require 'safe_yaml'
22
23
  require 'asciidoctor'
24
+ require 'asciidoctor/backends/html5'
25
+
26
+ # require 'asciidoctor/backends/_stylesheets'
23
27
  require 'eventmachine'
24
28
  require 'em-websocket'
25
29
  require 'http/parser'
@@ -29,7 +33,7 @@ require 'find'
29
33
 
30
34
  # internal requires
31
35
  require 'hyla/logger'
32
- require 'hyla/training'
36
+ require 'hyla/core_ext'
33
37
  require 'hyla/command'
34
38
  require 'hyla/configuration'
35
39
  require 'Hyla/WebSocket'
@@ -1,15 +1,5 @@
1
1
  module Hyla
2
2
  class Command
3
-
4
- def self.globs(source, destination)
5
- Dir.chdir(source) do
6
- dirs = Dir['*'].select { |x| File.directory?(x) }
7
- dirs -= [destination, File.expand_path(destination), File.basename(destination)]
8
- dirs = dirs.map { |x| "#{x}/**/*" }
9
- dirs += ['*']
10
- end
11
- end
12
-
13
3
  program :int_block do
14
4
  # kill threads etc
15
5
  # make sure to exit or abort, otherwise your program keeps running
@@ -17,5 +7,17 @@ module Hyla
17
7
  exit 1
18
8
  end
19
9
 
10
+ #
11
+ # Check mandatory options
12
+ #
13
+ def self.check_mandatory_option?(key, value)
14
+ if value.nil? or value.empty?
15
+ Hyla.logger.warn "Mandatory option missing: #{key}"
16
+ exit(1)
17
+ else
18
+ true
19
+ end
20
+ end
21
+
20
22
  end
21
23
  end
@@ -2,24 +2,33 @@ module Hyla
2
2
  module Commands
3
3
  class Create < Command
4
4
 
5
- def self.process(args, options = {})
5
+ def self.process(args, options)
6
+ destination = options[:destination] if check_mandatory_option?('--d / --destination', options[:destination])
7
+ artefact_type = options[:artefact_type] if check_mandatory_option?('--a / --artefact_type', options[:artefact_type])
8
+ type = options[:type] if check_mandatory_option?('--t / --type', options[:type])
6
9
 
7
- @config = Hyla::Configuration.new
8
-
9
- destination = options[:destination]
10
- artefact_type = options[:artefact_type]
11
- type = options[:type]
12
-
13
- copy_artefact(type, artefact_type, destination)
10
+ copy_artefact(type, artefact_type, destination)
14
11
  end
15
12
 
13
+ #
14
+ # Copy Artefact to Destination directory
15
+ #
16
16
  def self.copy_artefact(type, artefact_type, destination)
17
- artefact_name = type + '_' + artefact_type + @config.ADOC_EXT
18
- source = [@config.templates, 'sample', artefact_name] * '/'
19
- destination = [destination] * '/'
17
+ artefact_file_name = type + '_' + artefact_type + Configuration::ADOC_EXT
18
+ source = [Configuration::samples, artefact_file_name] * '/'
19
+ destination = File.expand_path(destination)
20
+
20
21
  FileUtils.cp(source, destination)
22
+
23
+ Hyla::logger.info ">> Artefact #{artefact_file_name} added to project #{destination}"
24
+
25
+ case artefact_type
26
+ when 'image','audio','video'
27
+ source_dir = [Configuration::samples, artefact_type] * '/'
28
+ FileUtils.cp_r(source_dir,destination)
29
+ end
21
30
  end
22
31
 
23
- end # class
32
+ end # class Create
24
33
  end # module Commands
25
34
  end # module Hyla
@@ -2,38 +2,43 @@ module Hyla
2
2
  module Commands
3
3
  class Generate < Command
4
4
 
5
- attr_reader :artefact
6
-
7
5
  DEFAULT_OPTIONS = {
8
- :watch_dir => '.',
9
- :watch_ext => %w(ad adoc asc asciidoc txt index),
10
- :run_on_start => false,
11
- :backend => 'html5',
12
- :eruby => 'erb',
13
- :doctype => 'article',
14
- :compact => false,
15
- :attributes => {},
16
- :always_build_all => false,
17
- :safe => :unsafe,
18
- :header_footer => true
6
+
7
+ :source => Dir.pwd,
8
+ :destination => File.join(Dir.pwd, 'generated_content'),
9
+
10
+ :watch_dir => '.',
11
+ :watch_ext => %w(ad adoc asciidoc txt index),
12
+ :run_on_start => false,
13
+ :backend => 'html5',
14
+ :eruby => 'erb',
15
+ :doctype => 'article',
16
+ :compact => false,
17
+ :attributes => {
18
+ 'source-highlighter' => 'coderay',
19
+ 'linkcss!' => 'true',
20
+ 'data-uri' => 'true',
21
+ 'stylesheet' => 'asciidoctor.css',
22
+ 'stylesdir' => Configuration::styles
23
+ },
24
+ :always_build_all => false,
25
+ :safe => 'unsafe',
26
+ :header_footer => true
19
27
  }
20
28
 
21
29
  def self.process(args, options = {})
22
30
 
23
- @config = Hyla::Configuration.new
24
-
25
31
  rendering = options[:rendering] if self.check_mandatory_option?('--r / --rendering', options[:rendering])
26
32
 
27
33
  case rendering
28
- when 'toc2html'
34
+ when 'toc2adoc'
29
35
 
30
- Hyla.logger.info "Rendering : Table of Content to HTML"
36
+ Hyla.logger.info "Rendering : Table of Content to Asciidoc"
31
37
  self.check_mandatory_option?('--t / --toc', options[:toc])
32
38
  @toc_file = options[:toc]
33
39
  @out_dir = options[:destination]
34
40
  @project_name = options[:project_name]
35
41
 
36
-
37
42
  self.table_of_content_to_asciidoc(@toc_file, @out_dir, @project_name)
38
43
 
39
44
  when 'adoc2html'
@@ -44,10 +49,51 @@ module Hyla
44
49
  @destination = options[:destination]
45
50
  @source = options[:source]
46
51
 
47
- self.asciidoc_to_html(@source, @destination)
52
+ extensions = 'adoc|ad|txt'
53
+
54
+ self.asciidoc_to_html(@source, @destination, extensions, options)
55
+
56
+ when 'adoc2slide'
57
+ Hyla.logger.info "Rendering : Asciidoc to SlideShow"
58
+ self.check_mandatory_option?('--s / --source', options[:source])
59
+ self.check_mandatory_option?('--d / --destination', options[:destination])
60
+
61
+ # Assign by default backend as HTML5 if not provided by command line
62
+ backend = options[:backend]? options[:backend] : 'html5'
63
+
64
+ #
65
+ # Retrieve asciidoctor attributes
66
+ # Could be an Arrays of Strings key=value,key=value
67
+ # or
68
+ # Could be a Hash (DEFAULTS, CONFIG_File)
69
+ attributes = options[:attributes]
70
+ override_attrs = case attributes
71
+ when Hash then attributes
72
+ when String then
73
+ result = attributes.split(',')
74
+ attributes = Hash.new
75
+ result.each do |entry|
76
+ words = entry.split('=')
77
+ attributes[words[0]] = words[1]
78
+ end
79
+ attributes
80
+ else {}
81
+ end
48
82
 
49
- when 'adoc2slides'
50
- Hyla.logger.info "Rendering : Asciidoc to SlideShow - NOT YET AVAILABLE"
83
+ @destination = options[:destination]
84
+ @source = options[:source]
85
+ options = {
86
+ :backend => backend,
87
+ :template_dirs => [
88
+ self.backend_dir(options[:backend])
89
+ ],
90
+ :watch_ext => %w(index),
91
+ :attributes => override_attrs
92
+ }
93
+
94
+ extensions = 'index|adoc|ad|asciidoc'
95
+
96
+ self.asciidoc_to_html(@source, @destination, extensions, options)
51
97
  else
52
98
  Hyla.logger.error ">> Unknow rendering"
53
99
  exit(1)
@@ -57,16 +103,43 @@ module Hyla
57
103
  # self.table_of_content_to_asciidoc(@toc_file, @out_dir, @project_name)
58
104
  end
59
105
 
60
- def self.asciidoc_to_html(source, destination)
106
+ # Return backend directory
107
+ # containing templates (haml, slim)
108
+ def self.backend_dir(backend)
109
+ case backend
110
+ when 'deckjs'
111
+ return [Configuration::backends, 'haml', 'deckjs'] * '/'
112
+ when 'revealjs'
113
+ return [Configuration::backends, 'slim', 'revealjs'] * '/'
114
+ end
115
+ end
116
+
117
+ def self.asciidoc_to_html(source, destination, extensions, options)
118
+
119
+ # CSS Style to be applied
120
+ css_style = self.check_style(options[:style])
121
+
122
+ override = {
123
+ :attributes => {
124
+ 'stylesheet' => css_style
125
+ }
126
+ }
61
127
 
62
- options = DEFAULT_OPTIONS.clone
128
+ @options = Configuration[options].deep_merge(override)
63
129
 
64
130
  # Move to Source directory & Retrieve Asciidoctor files to be processed
65
131
  source = File.expand_path source
66
132
  @destination = File.expand_path destination
133
+
67
134
  Hyla.logger.info ">> Source dir: #{source}"
68
135
  Hyla.logger.info ">> Destination dir: #{@destination}"
69
136
 
137
+ # Exit if source directory does not exist
138
+ if !Dir.exist? source
139
+ Hyla.logger.error ">> Source directory does not exist"
140
+ exit(1)
141
+ end
142
+
70
143
  Dir.chdir(source)
71
144
  current_dir = Dir.pwd
72
145
  Hyla.logger.info ">> Current dir: #{current_dir}"
@@ -74,27 +147,36 @@ module Hyla
74
147
  # Delete destination directory
75
148
  FileUtils.rm_rf(Dir.glob(@destination))
76
149
 
77
- # Search for Asciidoc files and do the rendering
150
+ # Search for files using extensions parameter and do the rendering
78
151
  adoc_file_paths = []
79
152
  Find.find(current_dir) do |path|
80
- if path =~ /.*\.(?:adoc|txt|index)$/
81
- path1 = Pathname.new(source)
82
- path2 = Pathname.new(path)
83
- relative_path = path2.relative_path_from(path1).to_s
84
- Hyla.logger.debug ">> Relative path: #{relative_path}"
85
- adoc_file_paths << relative_path
86
-
87
- # Create directory in the destination directory
88
- html_dir = @destination + '/' + File.dirname(relative_path)
89
- Hyla.logger.info ">> Dir of html: #{html_dir}"
90
- FileUtils.mkdir_p html_dir
91
-
92
- # Render asciidoc to HTML
93
- Hyla.logger.info ">> File to be rendered : #{path}"
94
- options[:to_dir] = html_dir
95
- Asciidoctor.render_file(path, options)
96
-
97
- end
153
+ if path =~ /.*\.(?:#{extensions})$/
154
+ path1 = Pathname.new(source)
155
+ path2 = Pathname.new(path)
156
+ relative_path = path2.relative_path_from(path1).to_s
157
+ Hyla.logger.debug ">> Relative path: #{relative_path}"
158
+ adoc_file_paths << relative_path
159
+
160
+ # Create dir
161
+ html_dir = @destination + '/' + File.dirname(relative_path)
162
+ Hyla.logger.info ">> Dir of html: #{html_dir}"
163
+ FileUtils.mkdir_p html_dir
164
+
165
+ # Copy Resources for Slideshow
166
+ case options[:backend]
167
+ when 'deckjs'
168
+ # Copy css, js files to destination directory
169
+ self.cp_resources_to_dir(File.dirname(html_dir), 'deck.js')
170
+ when 'revealjs'
171
+ self.cp_resources_to_dir(File.dirname(html_dir), 'revealjs')
172
+ end
173
+
174
+ # Render asciidoc to HTML
175
+ Hyla.logger.info ">> File to be rendered : #{path}"
176
+ @options[:to_dir] = html_dir
177
+ Asciidoctor.render_file(path, @options)
178
+
179
+ end
98
180
  end
99
181
 
100
182
  # No asciidoc files retrieved
@@ -105,6 +187,26 @@ module Hyla
105
187
 
106
188
  end
107
189
 
190
+ #
191
+ # CSS Style to be used
192
+ # Default is : asciidoctor.css
193
+ #
194
+ def self.check_style(style)
195
+ if !style.nil?
196
+ css_file = [style, '.css'].join()
197
+ else
198
+ css_file = 'asciidoctor.css'
199
+ end
200
+ end
201
+
202
+ #
203
+ # Copy resources to target dir
204
+ def self.cp_resources_to_dir(path, resource)
205
+ source = [Configuration::resources, resource] * '/'
206
+ destination = [path, resource] * '/'
207
+ FileUtils.cp_r source, destination
208
+ end
209
+
108
210
  #
109
211
  # Method parsing TOC File to generate directories and files
110
212
  # Each Level 1 entry will become a directory
@@ -121,23 +223,32 @@ module Hyla
121
223
  # Open file & parse it
122
224
  f = File.open(toc_file, 'r')
123
225
 
226
+ # Expand File Path
227
+ @out_dir = File.expand_path out_dir
228
+
124
229
  # Re Create Directory of generated content
125
- if Dir.exist? out_dir
126
- FileUtils.rm_rf out_dir
127
- FileUtils.mkdir_p out_dir
230
+ if Dir.exist? @out_dir
231
+ FileUtils.rm_rf @out_dir
232
+ FileUtils.mkdir_p @out_dir
128
233
  else
129
- FileUtils.mkdir_p out_dir
234
+ FileUtils.mkdir_p @out_dir
130
235
  end
131
236
 
237
+ # Copy YAML Config file
238
+ FileUtils.cp_r [Configuration::templates, Configuration::YAML_CONFIG_FILE_NAME] * '/', @out_dir
239
+
240
+ # Copy styles
241
+ FileUtils.cp_r Configuration::styles, @out_dir
242
+
132
243
  #
133
244
  # Move to 'generated' directory as we will
134
245
  # create content relative to this directory
135
246
  #
136
- Dir.chdir out_dir
137
- out_dir = Pathname.pwd
247
+ Dir.chdir @out_dir
248
+ @out_dir = Pathname.pwd
138
249
 
139
250
  # Create index file of all index files
140
- @project_index_file = self.create_index_file(project_name, @config.LEVEL_1)
251
+ @project_index_file = self.create_index_file(project_name, Configuration::LEVEL_1)
141
252
 
142
253
 
143
254
  # File iteration
@@ -153,7 +264,7 @@ module Hyla
153
264
 
154
265
  # Create File
155
266
  dir_name = remove_special_chars(2, line)
156
- new_dir = [out_dir, dir_name].join('/')
267
+ new_dir = [@out_dir, dir_name].join('/')
157
268
  Hyla.logger.info '>> Directory created : ' + new_dir + ' <<'
158
269
  FileUtils.mkdir_p new_dir
159
270
  Dir.chdir(new_dir)
@@ -166,10 +277,10 @@ module Hyla
166
277
  # It is used to include files belonging to a module and will be used for SlideShows
167
278
  # The file created contains a title (= Dir Name) and header with attributes
168
279
  #
169
- @index_file = create_index_file(dir_name, @config.LEVEL_2)
280
+ @index_file = create_index_file(dir_name, Configuration::LEVEL_1)
170
281
 
171
282
  # Include index file created to parent index file
172
- @project_index_file.puts @config.INCLUDE_PREFIX + dir_name + '/' + dir_name + @config.INDEX_SUFFIX + @config.INCLUDE_SUFFIX
283
+ @project_index_file.puts Configuration::INCLUDE_PREFIX + dir_name + '/' + dir_name + Configuration::INDEX_SUFFIX + Configuration::INCLUDE_SUFFIX
173
284
 
174
285
  # Move to next line record
175
286
  next
@@ -192,18 +303,18 @@ module Hyla
192
303
  Hyla.logger.info ' # File created : ' + f_name.to_s
193
304
  f_name += '.adoc'
194
305
  @new_f = File.new(f_name, 'w')
195
- @new_f.puts @config.HEADER
306
+ @new_f.puts Configuration::HEADER
196
307
 
197
308
  @previous_f = @new_f
198
309
 
199
310
  # Include file to index
200
- @index_file.puts @config.INCLUDE_PREFIX + f_name + @config.INCLUDE_SUFFIX
311
+ @index_file.puts Configuration::INCLUDE_PREFIX + f_name + Configuration::INCLUDE_SUFFIX
201
312
  end
202
313
 
203
314
  #
204
315
  # Add Content to file if it exists and line does not start with characters to be skipped
205
316
  #
206
- if !@new_f.nil? and !line.start_with?(@config.SKIP_CHARACTERS)
317
+ if !@new_f.nil? and !line.start_with?(Configuration::SKIP_CHARACTERS)
207
318
  @new_f.puts line
208
319
  end
209
320
 
@@ -211,8 +322,6 @@ module Hyla
211
322
 
212
323
  end
213
324
 
214
- # method parse_file(f)
215
-
216
325
  #
217
326
  # Remove space, dot from a String
218
327
  #
@@ -239,10 +348,10 @@ module Hyla
239
348
  # containing references to asciidoc files part of a module
240
349
  #
241
350
  def self.create_index_file(file_name, level)
242
- n_file_name = file_name + @config.INDEX_SUFFIX
351
+ n_file_name = file_name + Configuration::INDEX_SUFFIX
243
352
  index_file = File.new(n_file_name, 'w')
244
353
  index_file.puts level + file_name
245
- index_file.puts @config.HEADER_INDEX
354
+ index_file.puts Configuration::HEADER_INDEX
246
355
 
247
356
  index_file
248
357
  end