kitabu 0.4.7 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (544) hide show
  1. data/.gitignore +3 -0
  2. data/.gitmodules +3 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +2 -0
  5. data/Gemfile.lock +62 -0
  6. data/README.rdoc +187 -0
  7. data/Rakefile +4 -36
  8. data/bin/kitabu +2 -5
  9. data/examples/RailsGuides/config/helper.rb +29 -0
  10. data/examples/RailsGuides/config/kitabu.yml +48 -0
  11. data/examples/RailsGuides/images/challenge.png +0 -0
  12. data/examples/RailsGuides/images/posts_index.png +0 -0
  13. data/examples/RailsGuides/images/rails_welcome.png +0 -0
  14. data/examples/RailsGuides/output/RailsGuides.epub +0 -0
  15. data/examples/RailsGuides/output/RailsGuides.html +1556 -0
  16. data/examples/RailsGuides/output/RailsGuides.pdf +4930 -7
  17. data/examples/RailsGuides/templates/cover.erb +16 -0
  18. data/examples/RailsGuides/templates/layout.css +352 -0
  19. data/examples/RailsGuides/templates/layout.erb +43 -0
  20. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css/idle.css → examples/RailsGuides/templates/syntax.css} +0 -0
  21. data/examples/RailsGuides/templates/user.css +19 -0
  22. data/examples/RailsGuides/text/01_Guide_Assumptions.mkdn +13 -0
  23. data/examples/RailsGuides/text/02_What_is_Rails.mkdn +106 -0
  24. data/examples/RailsGuides/text/03_Creating_a_new_Rails_project.mkdn +200 -0
  25. data/examples/RailsGuides/text/04_Hello_Rails.mkdn +62 -0
  26. data/examples/RailsGuides/text/05_Getting_Up_and_Running_Quickly_with_Scaffolding.mkdn +4 -0
  27. data/examples/RailsGuides/text/06_Creating_a_resource.mkdn +503 -0
  28. data/examples/RailsGuides/text/07_Adding_a_second_model.mkdn +232 -0
  29. data/examples/RailsGuides/text/08_Refactoring.mkdn +123 -0
  30. data/examples/RailsGuides/text/09_Deleting_comments.mkdn +57 -0
  31. data/examples/RailsGuides/text/09_Security.mkdn +56 -0
  32. data/examples/RailsGuides/text/10_Building_a_multi_model_form.mkdn +130 -0
  33. data/examples/RailsGuides/text/11_View_helpers.mkdn +50 -0
  34. data/examples/RailsGuides/text/12_Whats_next.mkdn +14 -0
  35. data/examples/RailsGuides/text/13_Configuration_gotchas.mkdn +10 -0
  36. data/kitabu.gemspec +28 -491
  37. data/lib/kitabu.rb +54 -46
  38. data/lib/kitabu/cli.rb +88 -0
  39. data/lib/kitabu/errors.rb +3 -0
  40. data/lib/kitabu/exporter.rb +81 -0
  41. data/lib/kitabu/extensions/redcloth.rb +65 -0
  42. data/lib/kitabu/extensions/string.rb +11 -0
  43. data/lib/kitabu/generator.rb +74 -0
  44. data/lib/kitabu/parser.rb +34 -0
  45. data/lib/kitabu/parser/epub.rb +131 -0
  46. data/lib/kitabu/parser/html.rb +174 -0
  47. data/lib/kitabu/parser/mobi.rb +17 -0
  48. data/lib/kitabu/parser/pdf.rb +41 -0
  49. data/lib/kitabu/parser/txt.rb +22 -0
  50. data/lib/kitabu/stream.rb +27 -0
  51. data/lib/kitabu/syntax.rb +109 -107
  52. data/lib/kitabu/toc.rb +62 -33
  53. data/lib/kitabu/version.rb +8 -0
  54. data/spec/kitabu/cli/export_spec.rb +17 -0
  55. data/spec/kitabu/cli/new_spec.rb +21 -0
  56. data/spec/kitabu/cli/permalinks_spec.rb +12 -0
  57. data/spec/kitabu/cli/version_spec.rb +12 -0
  58. data/spec/kitabu/extensions/redcloth_spec.rb +52 -0
  59. data/spec/kitabu/extensions/string_spec.rb +21 -0
  60. data/spec/kitabu/generator_spec.rb +10 -0
  61. data/spec/kitabu/parser/epub_spec.rb +10 -0
  62. data/spec/kitabu/parser/html_spec.rb +75 -0
  63. data/spec/kitabu/parser/pdf_spec.rb +14 -0
  64. data/spec/kitabu/syntax_spec.rb +80 -76
  65. data/spec/kitabu/toc_spec.rb +42 -68
  66. data/spec/kitabu_spec.rb +4 -0
  67. data/spec/spec_helper.rb +20 -24
  68. data/spec/support/exit_with_code.rb +26 -0
  69. data/spec/support/have_tag.rb +115 -0
  70. data/spec/support/helper.rb +18 -0
  71. data/spec/support/mybook/.gitignore +1 -0
  72. data/spec/support/mybook/code/.gitkeep +0 -0
  73. data/spec/support/mybook/code/code.rb +13 -0
  74. data/spec/support/mybook/config/helper.rb +29 -0
  75. data/spec/support/mybook/config/kitabu.yml +59 -0
  76. data/spec/support/mybook/images/.gitkeep +0 -0
  77. data/spec/support/mybook/images/logo.gif +0 -0
  78. data/spec/support/mybook/output/.gitkeep +0 -0
  79. data/spec/support/mybook/templates/cover.erb +16 -0
  80. data/spec/support/mybook/templates/epub.css +1 -0
  81. data/spec/support/mybook/templates/epub.erb +15 -0
  82. data/spec/support/mybook/templates/layout.css +137 -0
  83. data/{templates/layouts/boom/layout.html → spec/support/mybook/templates/layout.erb} +26 -17
  84. data/{templates/themes/mac_classic.css → spec/support/mybook/templates/syntax.css} +63 -0
  85. data/spec/support/mybook/templates/user.css +1 -0
  86. data/spec/support/mybook/text/.gitkeep +0 -0
  87. data/spec/support/mybook/text/01_Markdown_Chapter.markdown +8 -0
  88. data/spec/support/mybook/text/02_Textile_Chapter.textile +3 -0
  89. data/spec/support/mybook/text/03_HTML_Chapter.html +3 -0
  90. data/spec/support/mybook/text/04_With_Directory/Some_Chapter.mkdn +3 -0
  91. data/spec/support/mybook/text/CHANGELOG.textile +6 -0
  92. data/spec/support/mybook/text/TOC.textile +0 -0
  93. data/spec/support/mybook/text/_00_Introduction.markdown +3 -0
  94. data/spec/support/shared.rb +16 -0
  95. data/templates/config.erb +48 -0
  96. data/templates/cover.erb +16 -0
  97. data/templates/ebook.png +0 -0
  98. data/templates/epub.css +0 -0
  99. data/templates/epub.erb +15 -0
  100. data/templates/helper.rb +29 -0
  101. data/templates/layout.css +353 -0
  102. data/templates/layout.erb +44 -0
  103. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/active4d.css +0 -0
  104. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/all_hallows_eve.css +0 -0
  105. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/amy.css +0 -0
  106. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/blackboard.css +0 -0
  107. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/brilliance_black.css +0 -0
  108. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/brilliance_dull.css +0 -0
  109. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/cobalt.css +0 -0
  110. data/{lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css → templates/styles}/dawn.css +0 -0
  111. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/eiffel.css +0 -0
  112. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/espresso_libre.css +0 -0
  113. data/{lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css → templates/styles}/idle.css +0 -0
  114. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/iplastic.css +0 -0
  115. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/lazy.css +0 -0
  116. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/mac_classic.css +0 -0
  117. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/magicwb_amiga.css +0 -0
  118. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/pastels_on_dark.css +0 -0
  119. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/slush_poppies.css +0 -0
  120. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/spacecadet.css +0 -0
  121. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/sunburst.css +0 -0
  122. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/twilight.css +0 -0
  123. data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/zenburnesque.css +0 -0
  124. data/templates/user.css +1 -1
  125. metadata +395 -501
  126. data/README.markdown +0 -60
  127. data/VERSION +0 -1
  128. data/lib/kitabu/base.rb +0 -271
  129. data/lib/kitabu/blackcloth.rb +0 -184
  130. data/lib/kitabu/command.rb +0 -94
  131. data/lib/kitabu/redcloth.rb +0 -964
  132. data/lib/kitabu/tasks.rb +0 -113
  133. data/lib/kitabu/templates.rb +0 -54
  134. data/lib/kitabu/vendor/colorize/colorize.rb +0 -81
  135. data/lib/kitabu/vendor/ruby1.8/plist/plist.rb +0 -22
  136. data/lib/kitabu/vendor/ruby1.8/plist/plist/generator.rb +0 -224
  137. data/lib/kitabu/vendor/ruby1.8/plist/plist/parser.rb +0 -224
  138. data/lib/kitabu/vendor/ruby1.8/textpow/textpow.rb +0 -10
  139. data/lib/kitabu/vendor/ruby1.8/textpow/textpow/debug_processor.rb +0 -36
  140. data/lib/kitabu/vendor/ruby1.8/textpow/textpow/score_manager.rb +0 -65
  141. data/lib/kitabu/vendor/ruby1.8/textpow/textpow/syntax.rb +0 -284
  142. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/active4d.render +0 -140
  143. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/all_hallows_eve.render +0 -104
  144. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/amy.render +0 -179
  145. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/blackboard.render +0 -119
  146. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/brilliance_black.render +0 -560
  147. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/brilliance_dull.render +0 -569
  148. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/cobalt.render +0 -170
  149. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/dawn.render +0 -134
  150. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/eiffel.render +0 -140
  151. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/espresso_libre.render +0 -131
  152. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css/dawn.css +0 -121
  153. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/idle.render +0 -101
  154. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/iplastic.render +0 -107
  155. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/lazy.render +0 -104
  156. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/mac_classic.render +0 -143
  157. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/magicwb_amiga.render +0 -125
  158. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/pastels_on_dark.render +0 -212
  159. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/slush_poppies.render +0 -131
  160. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/spacecadet.render +0 -89
  161. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/sunburst.render +0 -194
  162. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/twilight.render +0 -161
  163. data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/zenburnesque.render +0 -134
  164. data/lib/kitabu/vendor/ruby1.8/uv/syntax/actionscript.syntax +0 -97
  165. data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d.syntax +0 -276
  166. data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d_html.syntax +0 -311
  167. data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d_ini.syntax +0 -50
  168. data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d_library.syntax +0 -21
  169. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ada.syntax +0 -33
  170. data/lib/kitabu/vendor/ruby1.8/uv/syntax/antlr.syntax +0 -151
  171. data/lib/kitabu/vendor/ruby1.8/uv/syntax/apache.syntax +0 -191
  172. data/lib/kitabu/vendor/ruby1.8/uv/syntax/applescript.syntax +0 -384
  173. data/lib/kitabu/vendor/ruby1.8/uv/syntax/asp.syntax +0 -70
  174. data/lib/kitabu/vendor/ruby1.8/uv/syntax/asp_vb.net.syntax +0 -129
  175. data/lib/kitabu/vendor/ruby1.8/uv/syntax/bibtex.syntax +0 -151
  176. data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_html.syntax +0 -41
  177. data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_markdown.syntax +0 -42
  178. data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_text.syntax +0 -27
  179. data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_textile.syntax +0 -27
  180. data/lib/kitabu/vendor/ruby1.8/uv/syntax/buggy/nemerle.syntax +0 -74
  181. data/lib/kitabu/vendor/ruby1.8/uv/syntax/build.syntax +0 -53
  182. data/lib/kitabu/vendor/ruby1.8/uv/syntax/bulletin_board.syntax +0 -287
  183. data/lib/kitabu/vendor/ruby1.8/uv/syntax/c++.syntax +0 -109
  184. data/lib/kitabu/vendor/ruby1.8/uv/syntax/c.syntax +0 -326
  185. data/lib/kitabu/vendor/ruby1.8/uv/syntax/cake.syntax +0 -55
  186. data/lib/kitabu/vendor/ruby1.8/uv/syntax/camlp4.syntax +0 -36
  187. data/lib/kitabu/vendor/ruby1.8/uv/syntax/cm.syntax +0 -32
  188. data/lib/kitabu/vendor/ruby1.8/uv/syntax/coldfusion.syntax +0 -119
  189. data/lib/kitabu/vendor/ruby1.8/uv/syntax/context_free.syntax +0 -176
  190. data/lib/kitabu/vendor/ruby1.8/uv/syntax/cs.syntax +0 -59
  191. data/lib/kitabu/vendor/ruby1.8/uv/syntax/css.syntax +0 -195
  192. data/lib/kitabu/vendor/ruby1.8/uv/syntax/css_experimental.syntax +0 -1925
  193. data/lib/kitabu/vendor/ruby1.8/uv/syntax/csv.syntax +0 -68
  194. data/lib/kitabu/vendor/ruby1.8/uv/syntax/d.syntax +0 -142
  195. data/lib/kitabu/vendor/ruby1.8/uv/syntax/diff.syntax +0 -81
  196. data/lib/kitabu/vendor/ruby1.8/uv/syntax/dokuwiki.syntax +0 -204
  197. data/lib/kitabu/vendor/ruby1.8/uv/syntax/dot.syntax +0 -47
  198. data/lib/kitabu/vendor/ruby1.8/uv/syntax/doxygen.syntax +0 -43
  199. data/lib/kitabu/vendor/ruby1.8/uv/syntax/dylan.syntax +0 -62
  200. data/lib/kitabu/vendor/ruby1.8/uv/syntax/eiffel.syntax +0 -78
  201. data/lib/kitabu/vendor/ruby1.8/uv/syntax/erlang.syntax +0 -922
  202. data/lib/kitabu/vendor/ruby1.8/uv/syntax/f-script.syntax +0 -80
  203. data/lib/kitabu/vendor/ruby1.8/uv/syntax/fortran.syntax +0 -141
  204. data/lib/kitabu/vendor/ruby1.8/uv/syntax/fxscript.syntax +0 -142
  205. data/lib/kitabu/vendor/ruby1.8/uv/syntax/greasemonkey.syntax +0 -34
  206. data/lib/kitabu/vendor/ruby1.8/uv/syntax/gri.syntax +0 -83
  207. data/lib/kitabu/vendor/ruby1.8/uv/syntax/groovy.syntax +0 -191
  208. data/lib/kitabu/vendor/ruby1.8/uv/syntax/gtd.syntax +0 -22
  209. data/lib/kitabu/vendor/ruby1.8/uv/syntax/gtdalt.syntax +0 -143
  210. data/lib/kitabu/vendor/ruby1.8/uv/syntax/haml.syntax +0 -88
  211. data/lib/kitabu/vendor/ruby1.8/uv/syntax/haskell.syntax +0 -88
  212. data/lib/kitabu/vendor/ruby1.8/uv/syntax/html-asp.syntax +0 -27
  213. data/lib/kitabu/vendor/ruby1.8/uv/syntax/html.syntax +0 -362
  214. data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_django.syntax +0 -36
  215. data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_for_asp.net.syntax +0 -424
  216. data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_mason.syntax +0 -119
  217. data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_rails.syntax +0 -40
  218. data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_tcl.syntax +0 -26
  219. data/lib/kitabu/vendor/ruby1.8/uv/syntax/icalendar.syntax +0 -32
  220. data/lib/kitabu/vendor/ruby1.8/uv/syntax/inform.syntax +0 -48
  221. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ini.syntax +0 -55
  222. data/lib/kitabu/vendor/ruby1.8/uv/syntax/installer_distribution_script.syntax +0 -77
  223. data/lib/kitabu/vendor/ruby1.8/uv/syntax/io.syntax +0 -81
  224. data/lib/kitabu/vendor/ruby1.8/uv/syntax/java.syntax +0 -211
  225. data/lib/kitabu/vendor/ruby1.8/uv/syntax/javaproperties.syntax +0 -20
  226. data/lib/kitabu/vendor/ruby1.8/uv/syntax/javascript.syntax +0 -256
  227. data/lib/kitabu/vendor/ruby1.8/uv/syntax/javascript_+_prototype.syntax +0 -72
  228. data/lib/kitabu/vendor/ruby1.8/uv/syntax/javascript_+_prototype_bracketed.syntax +0 -140
  229. data/lib/kitabu/vendor/ruby1.8/uv/syntax/jquery_javascript.syntax +0 -114
  230. data/lib/kitabu/vendor/ruby1.8/uv/syntax/json.syntax +0 -136
  231. data/lib/kitabu/vendor/ruby1.8/uv/syntax/languagedefinition.syntax +0 -708
  232. data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex.syntax +0 -566
  233. data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex_beamer.syntax +0 -41
  234. data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex_log.syntax +0 -50
  235. data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex_memoir.syntax +0 -64
  236. data/lib/kitabu/vendor/ruby1.8/uv/syntax/lexflex.syntax +0 -219
  237. data/lib/kitabu/vendor/ruby1.8/uv/syntax/lighttpd.syntax +0 -54
  238. data/lib/kitabu/vendor/ruby1.8/uv/syntax/lilypond.syntax +0 -492
  239. data/lib/kitabu/vendor/ruby1.8/uv/syntax/lisp.syntax +0 -61
  240. data/lib/kitabu/vendor/ruby1.8/uv/syntax/literate_haskell.syntax +0 -24
  241. data/lib/kitabu/vendor/ruby1.8/uv/syntax/logo.syntax +0 -29
  242. data/lib/kitabu/vendor/ruby1.8/uv/syntax/logtalk.syntax +0 -152
  243. data/lib/kitabu/vendor/ruby1.8/uv/syntax/lua.syntax +0 -86
  244. data/lib/kitabu/vendor/ruby1.8/uv/syntax/m.syntax +0 -142
  245. data/lib/kitabu/vendor/ruby1.8/uv/syntax/macports_portfile.syntax +0 -163
  246. data/lib/kitabu/vendor/ruby1.8/uv/syntax/mail.syntax +0 -118
  247. data/lib/kitabu/vendor/ruby1.8/uv/syntax/makefile.syntax +0 -36
  248. data/lib/kitabu/vendor/ruby1.8/uv/syntax/man.syntax +0 -17
  249. data/lib/kitabu/vendor/ruby1.8/uv/syntax/markdown.syntax +0 -543
  250. data/lib/kitabu/vendor/ruby1.8/uv/syntax/mediawiki.syntax +0 -567
  251. data/lib/kitabu/vendor/ruby1.8/uv/syntax/mel.syntax +0 -92
  252. data/lib/kitabu/vendor/ruby1.8/uv/syntax/mips.syntax +0 -66
  253. data/lib/kitabu/vendor/ruby1.8/uv/syntax/mod_perl.syntax +0 -50
  254. data/lib/kitabu/vendor/ruby1.8/uv/syntax/modula-3.syntax +0 -47
  255. data/lib/kitabu/vendor/ruby1.8/uv/syntax/moinmoin.syntax +0 -189
  256. data/lib/kitabu/vendor/ruby1.8/uv/syntax/mootools.syntax +0 -572
  257. data/lib/kitabu/vendor/ruby1.8/uv/syntax/movable_type.syntax +0 -162
  258. data/lib/kitabu/vendor/ruby1.8/uv/syntax/multimarkdown.syntax +0 -39
  259. data/lib/kitabu/vendor/ruby1.8/uv/syntax/objective-c++.syntax +0 -18
  260. data/lib/kitabu/vendor/ruby1.8/uv/syntax/objective-c.syntax +0 -233
  261. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ocaml.syntax +0 -764
  262. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ocamllex.syntax +0 -167
  263. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ocamlyacc.syntax +0 -184
  264. data/lib/kitabu/vendor/ruby1.8/uv/syntax/old/YAML.yaml +0 -160
  265. data/lib/kitabu/vendor/ruby1.8/uv/syntax/old/txt2tags.yaml +0 -139
  266. data/lib/kitabu/vendor/ruby1.8/uv/syntax/opengl.syntax +0 -14
  267. data/lib/kitabu/vendor/ruby1.8/uv/syntax/pascal.syntax +0 -77
  268. data/lib/kitabu/vendor/ruby1.8/uv/syntax/perl.syntax +0 -1115
  269. data/lib/kitabu/vendor/ruby1.8/uv/syntax/php.syntax +0 -1253
  270. data/lib/kitabu/vendor/ruby1.8/uv/syntax/plain_text.syntax +0 -32
  271. data/lib/kitabu/vendor/ruby1.8/uv/syntax/pmwiki.syntax +0 -113
  272. data/lib/kitabu/vendor/ruby1.8/uv/syntax/postscript.syntax +0 -114
  273. data/lib/kitabu/vendor/ruby1.8/uv/syntax/processing.syntax +0 -106
  274. data/lib/kitabu/vendor/ruby1.8/uv/syntax/prolog.syntax +0 -40
  275. data/lib/kitabu/vendor/ruby1.8/uv/syntax/property_list.syntax +0 -635
  276. data/lib/kitabu/vendor/ruby1.8/uv/syntax/python.syntax +0 -868
  277. data/lib/kitabu/vendor/ruby1.8/uv/syntax/python_django.syntax +0 -21
  278. data/lib/kitabu/vendor/ruby1.8/uv/syntax/qmake_project.syntax +0 -114
  279. data/lib/kitabu/vendor/ruby1.8/uv/syntax/qt_c++.syntax +0 -26
  280. data/lib/kitabu/vendor/ruby1.8/uv/syntax/quake3_config.syntax +0 -32
  281. data/lib/kitabu/vendor/ruby1.8/uv/syntax/r.syntax +0 -81
  282. data/lib/kitabu/vendor/ruby1.8/uv/syntax/r_console.syntax +0 -16
  283. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ragel.syntax +0 -201
  284. data/lib/kitabu/vendor/ruby1.8/uv/syntax/rd_r_documentation.syntax +0 -91
  285. data/lib/kitabu/vendor/ruby1.8/uv/syntax/regexp.syntax +0 -50
  286. data/lib/kitabu/vendor/ruby1.8/uv/syntax/regular_expressions_oniguruma.syntax +0 -107
  287. data/lib/kitabu/vendor/ruby1.8/uv/syntax/regular_expressions_python.syntax +0 -109
  288. data/lib/kitabu/vendor/ruby1.8/uv/syntax/release_notes.syntax +0 -46
  289. data/lib/kitabu/vendor/ruby1.8/uv/syntax/remind.syntax +0 -253
  290. data/lib/kitabu/vendor/ruby1.8/uv/syntax/restructuredtext.syntax +0 -250
  291. data/lib/kitabu/vendor/ruby1.8/uv/syntax/rez.syntax +0 -80
  292. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ruby.syntax +0 -1035
  293. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ruby_experimental.syntax +0 -145
  294. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ruby_on_rails.syntax +0 -88
  295. data/lib/kitabu/vendor/ruby1.8/uv/syntax/s5.syntax +0 -69
  296. data/lib/kitabu/vendor/ruby1.8/uv/syntax/scheme.syntax +0 -347
  297. data/lib/kitabu/vendor/ruby1.8/uv/syntax/scilab.syntax +0 -41
  298. data/lib/kitabu/vendor/ruby1.8/uv/syntax/setext.syntax +0 -147
  299. data/lib/kitabu/vendor/ruby1.8/uv/syntax/shell-unix-generic.syntax +0 -384
  300. data/lib/kitabu/vendor/ruby1.8/uv/syntax/slate.syntax +0 -149
  301. data/lib/kitabu/vendor/ruby1.8/uv/syntax/smarty.syntax +0 -63
  302. data/lib/kitabu/vendor/ruby1.8/uv/syntax/sql.syntax +0 -237
  303. data/lib/kitabu/vendor/ruby1.8/uv/syntax/sql_rails.syntax +0 -18
  304. data/lib/kitabu/vendor/ruby1.8/uv/syntax/ssh-config.syntax +0 -33
  305. data/lib/kitabu/vendor/ruby1.8/uv/syntax/standard_ml.syntax +0 -121
  306. data/lib/kitabu/vendor/ruby1.8/uv/syntax/strings_file.syntax +0 -39
  307. data/lib/kitabu/vendor/ruby1.8/uv/syntax/subversion_commit_message.syntax +0 -36
  308. data/lib/kitabu/vendor/ruby1.8/uv/syntax/sweave.syntax +0 -84
  309. data/lib/kitabu/vendor/ruby1.8/uv/syntax/swig.syntax +0 -57
  310. data/lib/kitabu/vendor/ruby1.8/uv/syntax/tcl.syntax +0 -152
  311. data/lib/kitabu/vendor/ruby1.8/uv/syntax/template_toolkit.syntax +0 -121
  312. data/lib/kitabu/vendor/ruby1.8/uv/syntax/tex.syntax +0 -86
  313. data/lib/kitabu/vendor/ruby1.8/uv/syntax/tex_math.syntax +0 -49
  314. data/lib/kitabu/vendor/ruby1.8/uv/syntax/textile.syntax +0 -215
  315. data/lib/kitabu/vendor/ruby1.8/uv/syntax/tsv.syntax +0 -50
  316. data/lib/kitabu/vendor/ruby1.8/uv/syntax/twiki.syntax +0 -241
  317. data/lib/kitabu/vendor/ruby1.8/uv/syntax/txt2tags.syntax +0 -79
  318. data/lib/kitabu/vendor/ruby1.8/uv/syntax/vectorscript.syntax +0 -57
  319. data/lib/kitabu/vendor/ruby1.8/uv/syntax/xhtml_1.0.syntax +0 -4027
  320. data/lib/kitabu/vendor/ruby1.8/uv/syntax/xml.syntax +0 -180
  321. data/lib/kitabu/vendor/ruby1.8/uv/syntax/xml_strict.syntax +0 -92
  322. data/lib/kitabu/vendor/ruby1.8/uv/syntax/xsl.syntax +0 -60
  323. data/lib/kitabu/vendor/ruby1.8/uv/syntax/yaml.syntax +0 -160
  324. data/lib/kitabu/vendor/ruby1.8/uv/syntax/yui_javascript.syntax +0 -176
  325. data/lib/kitabu/vendor/ruby1.8/uv/uv.rb +0 -88
  326. data/lib/kitabu/vendor/ruby1.8/uv/uv/render_processor.rb +0 -131
  327. data/lib/kitabu/vendor/ruby1.8/uv/uv/utility.rb +0 -67
  328. data/lib/kitabu/vendor/ruby1.9/plist/plist.rb +0 -23
  329. data/lib/kitabu/vendor/ruby1.9/plist/plist/generator.rb +0 -228
  330. data/lib/kitabu/vendor/ruby1.9/plist/plist/parser.rb +0 -225
  331. data/lib/kitabu/vendor/ruby1.9/textpow/textpow.rb +0 -10
  332. data/lib/kitabu/vendor/ruby1.9/textpow/textpow/debug_processor.rb +0 -37
  333. data/lib/kitabu/vendor/ruby1.9/textpow/textpow/score_manager.rb +0 -66
  334. data/lib/kitabu/vendor/ruby1.9/textpow/textpow/syntax.rb +0 -286
  335. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/active4d.render +0 -140
  336. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/all_hallows_eve.render +0 -104
  337. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/amy.render +0 -179
  338. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/blackboard.render +0 -119
  339. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/brilliance_black.render +0 -560
  340. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/brilliance_dull.render +0 -569
  341. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/cobalt.render +0 -170
  342. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/dawn.render +0 -134
  343. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/eiffel.render +0 -140
  344. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/espresso_libre.render +0 -131
  345. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/active4d.css +0 -114
  346. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/all_hallows_eve.css +0 -72
  347. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/amy.css +0 -147
  348. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/blackboard.css +0 -88
  349. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/brilliance_black.css +0 -605
  350. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/brilliance_dull.css +0 -599
  351. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/cobalt.css +0 -149
  352. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/eiffel.css +0 -121
  353. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/espresso_libre.css +0 -109
  354. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/iplastic.css +0 -80
  355. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/lazy.css +0 -73
  356. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/mac_classic.css +0 -123
  357. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/magicwb_amiga.css +0 -104
  358. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/pastels_on_dark.css +0 -188
  359. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/slush_poppies.css +0 -85
  360. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/spacecadet.css +0 -51
  361. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/sunburst.css +0 -180
  362. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/twilight.css +0 -137
  363. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/zenburnesque.css +0 -91
  364. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/idle.render +0 -101
  365. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/iplastic.render +0 -107
  366. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/lazy.render +0 -104
  367. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/mac_classic.render +0 -143
  368. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/magicwb_amiga.render +0 -125
  369. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/pastels_on_dark.render +0 -212
  370. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/slush_poppies.render +0 -131
  371. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/spacecadet.render +0 -89
  372. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/sunburst.render +0 -194
  373. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/twilight.render +0 -161
  374. data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/zenburnesque.render +0 -134
  375. data/lib/kitabu/vendor/ruby1.9/uv/syntax/actionscript.syntax +0 -97
  376. data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d.syntax +0 -276
  377. data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d_html.syntax +0 -311
  378. data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d_ini.syntax +0 -50
  379. data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d_library.syntax +0 -21
  380. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ada.syntax +0 -33
  381. data/lib/kitabu/vendor/ruby1.9/uv/syntax/antlr.syntax +0 -151
  382. data/lib/kitabu/vendor/ruby1.9/uv/syntax/apache.syntax +0 -191
  383. data/lib/kitabu/vendor/ruby1.9/uv/syntax/applescript.syntax +0 -384
  384. data/lib/kitabu/vendor/ruby1.9/uv/syntax/asp.syntax +0 -70
  385. data/lib/kitabu/vendor/ruby1.9/uv/syntax/asp_vb.net.syntax +0 -129
  386. data/lib/kitabu/vendor/ruby1.9/uv/syntax/bibtex.syntax +0 -151
  387. data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_html.syntax +0 -41
  388. data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_markdown.syntax +0 -42
  389. data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_text.syntax +0 -27
  390. data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_textile.syntax +0 -27
  391. data/lib/kitabu/vendor/ruby1.9/uv/syntax/build.syntax +0 -53
  392. data/lib/kitabu/vendor/ruby1.9/uv/syntax/bulletin_board.syntax +0 -287
  393. data/lib/kitabu/vendor/ruby1.9/uv/syntax/cake.syntax +0 -55
  394. data/lib/kitabu/vendor/ruby1.9/uv/syntax/camlp4.syntax +0 -36
  395. data/lib/kitabu/vendor/ruby1.9/uv/syntax/cm.syntax +0 -32
  396. data/lib/kitabu/vendor/ruby1.9/uv/syntax/coldfusion.syntax +0 -119
  397. data/lib/kitabu/vendor/ruby1.9/uv/syntax/context_free.syntax +0 -176
  398. data/lib/kitabu/vendor/ruby1.9/uv/syntax/cs.syntax +0 -59
  399. data/lib/kitabu/vendor/ruby1.9/uv/syntax/css.syntax +0 -195
  400. data/lib/kitabu/vendor/ruby1.9/uv/syntax/css_experimental.syntax +0 -1925
  401. data/lib/kitabu/vendor/ruby1.9/uv/syntax/csv.syntax +0 -68
  402. data/lib/kitabu/vendor/ruby1.9/uv/syntax/d.syntax +0 -142
  403. data/lib/kitabu/vendor/ruby1.9/uv/syntax/diff.syntax +0 -81
  404. data/lib/kitabu/vendor/ruby1.9/uv/syntax/dokuwiki.syntax +0 -204
  405. data/lib/kitabu/vendor/ruby1.9/uv/syntax/dot.syntax +0 -47
  406. data/lib/kitabu/vendor/ruby1.9/uv/syntax/doxygen.syntax +0 -43
  407. data/lib/kitabu/vendor/ruby1.9/uv/syntax/dylan.syntax +0 -62
  408. data/lib/kitabu/vendor/ruby1.9/uv/syntax/eiffel.syntax +0 -78
  409. data/lib/kitabu/vendor/ruby1.9/uv/syntax/erlang.syntax +0 -922
  410. data/lib/kitabu/vendor/ruby1.9/uv/syntax/f-script.syntax +0 -80
  411. data/lib/kitabu/vendor/ruby1.9/uv/syntax/fortran.syntax +0 -141
  412. data/lib/kitabu/vendor/ruby1.9/uv/syntax/fxscript.syntax +0 -142
  413. data/lib/kitabu/vendor/ruby1.9/uv/syntax/greasemonkey.syntax +0 -34
  414. data/lib/kitabu/vendor/ruby1.9/uv/syntax/gri.syntax +0 -83
  415. data/lib/kitabu/vendor/ruby1.9/uv/syntax/groovy.syntax +0 -191
  416. data/lib/kitabu/vendor/ruby1.9/uv/syntax/gtd.syntax +0 -22
  417. data/lib/kitabu/vendor/ruby1.9/uv/syntax/gtdalt.syntax +0 -143
  418. data/lib/kitabu/vendor/ruby1.9/uv/syntax/haml.syntax +0 -88
  419. data/lib/kitabu/vendor/ruby1.9/uv/syntax/haskell.syntax +0 -88
  420. data/lib/kitabu/vendor/ruby1.9/uv/syntax/html-asp.syntax +0 -27
  421. data/lib/kitabu/vendor/ruby1.9/uv/syntax/html.syntax +0 -362
  422. data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_django.syntax +0 -36
  423. data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_for_asp.net.syntax +0 -424
  424. data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_mason.syntax +0 -119
  425. data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_rails.syntax +0 -40
  426. data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_tcl.syntax +0 -26
  427. data/lib/kitabu/vendor/ruby1.9/uv/syntax/icalendar.syntax +0 -32
  428. data/lib/kitabu/vendor/ruby1.9/uv/syntax/inform.syntax +0 -48
  429. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ini.syntax +0 -55
  430. data/lib/kitabu/vendor/ruby1.9/uv/syntax/installer_distribution_script.syntax +0 -77
  431. data/lib/kitabu/vendor/ruby1.9/uv/syntax/io.syntax +0 -81
  432. data/lib/kitabu/vendor/ruby1.9/uv/syntax/java.syntax +0 -211
  433. data/lib/kitabu/vendor/ruby1.9/uv/syntax/javaproperties.syntax +0 -20
  434. data/lib/kitabu/vendor/ruby1.9/uv/syntax/javascript.syntax +0 -256
  435. data/lib/kitabu/vendor/ruby1.9/uv/syntax/javascript_+_prototype.syntax +0 -72
  436. data/lib/kitabu/vendor/ruby1.9/uv/syntax/javascript_+_prototype_bracketed.syntax +0 -140
  437. data/lib/kitabu/vendor/ruby1.9/uv/syntax/jquery_javascript.syntax +0 -114
  438. data/lib/kitabu/vendor/ruby1.9/uv/syntax/json.syntax +0 -136
  439. data/lib/kitabu/vendor/ruby1.9/uv/syntax/languagedefinition.syntax +0 -708
  440. data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex.syntax +0 -566
  441. data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex_beamer.syntax +0 -41
  442. data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex_log.syntax +0 -50
  443. data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex_memoir.syntax +0 -64
  444. data/lib/kitabu/vendor/ruby1.9/uv/syntax/lexflex.syntax +0 -219
  445. data/lib/kitabu/vendor/ruby1.9/uv/syntax/lighttpd.syntax +0 -54
  446. data/lib/kitabu/vendor/ruby1.9/uv/syntax/lilypond.syntax +0 -492
  447. data/lib/kitabu/vendor/ruby1.9/uv/syntax/lisp.syntax +0 -61
  448. data/lib/kitabu/vendor/ruby1.9/uv/syntax/literate_haskell.syntax +0 -24
  449. data/lib/kitabu/vendor/ruby1.9/uv/syntax/logo.syntax +0 -29
  450. data/lib/kitabu/vendor/ruby1.9/uv/syntax/logtalk.syntax +0 -152
  451. data/lib/kitabu/vendor/ruby1.9/uv/syntax/lua.syntax +0 -86
  452. data/lib/kitabu/vendor/ruby1.9/uv/syntax/m.syntax +0 -142
  453. data/lib/kitabu/vendor/ruby1.9/uv/syntax/macports_portfile.syntax +0 -163
  454. data/lib/kitabu/vendor/ruby1.9/uv/syntax/makefile.syntax +0 -36
  455. data/lib/kitabu/vendor/ruby1.9/uv/syntax/man.syntax +0 -17
  456. data/lib/kitabu/vendor/ruby1.9/uv/syntax/mediawiki.syntax +0 -567
  457. data/lib/kitabu/vendor/ruby1.9/uv/syntax/mips.syntax +0 -66
  458. data/lib/kitabu/vendor/ruby1.9/uv/syntax/mod_perl.syntax +0 -50
  459. data/lib/kitabu/vendor/ruby1.9/uv/syntax/modula-3.syntax +0 -47
  460. data/lib/kitabu/vendor/ruby1.9/uv/syntax/moinmoin.syntax +0 -189
  461. data/lib/kitabu/vendor/ruby1.9/uv/syntax/mootools.syntax +0 -572
  462. data/lib/kitabu/vendor/ruby1.9/uv/syntax/movable_type.syntax +0 -162
  463. data/lib/kitabu/vendor/ruby1.9/uv/syntax/multimarkdown.syntax +0 -39
  464. data/lib/kitabu/vendor/ruby1.9/uv/syntax/objective-c++.syntax +0 -18
  465. data/lib/kitabu/vendor/ruby1.9/uv/syntax/objective-c.syntax +0 -233
  466. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ocaml.syntax +0 -764
  467. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ocamllex.syntax +0 -167
  468. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ocamlyacc.syntax +0 -184
  469. data/lib/kitabu/vendor/ruby1.9/uv/syntax/opengl.syntax +0 -14
  470. data/lib/kitabu/vendor/ruby1.9/uv/syntax/pascal.syntax +0 -77
  471. data/lib/kitabu/vendor/ruby1.9/uv/syntax/perl.syntax +0 -1115
  472. data/lib/kitabu/vendor/ruby1.9/uv/syntax/plain_text.syntax +0 -32
  473. data/lib/kitabu/vendor/ruby1.9/uv/syntax/postscript.syntax +0 -114
  474. data/lib/kitabu/vendor/ruby1.9/uv/syntax/processing.syntax +0 -106
  475. data/lib/kitabu/vendor/ruby1.9/uv/syntax/prolog.syntax +0 -40
  476. data/lib/kitabu/vendor/ruby1.9/uv/syntax/property_list.syntax +0 -635
  477. data/lib/kitabu/vendor/ruby1.9/uv/syntax/python.syntax +0 -868
  478. data/lib/kitabu/vendor/ruby1.9/uv/syntax/python_django.syntax +0 -21
  479. data/lib/kitabu/vendor/ruby1.9/uv/syntax/qmake_project.syntax +0 -114
  480. data/lib/kitabu/vendor/ruby1.9/uv/syntax/qt_c++.syntax +0 -26
  481. data/lib/kitabu/vendor/ruby1.9/uv/syntax/quake3_config.syntax +0 -32
  482. data/lib/kitabu/vendor/ruby1.9/uv/syntax/r.syntax +0 -81
  483. data/lib/kitabu/vendor/ruby1.9/uv/syntax/r_console.syntax +0 -16
  484. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ragel.syntax +0 -201
  485. data/lib/kitabu/vendor/ruby1.9/uv/syntax/rd_r_documentation.syntax +0 -91
  486. data/lib/kitabu/vendor/ruby1.9/uv/syntax/regexp.syntax +0 -50
  487. data/lib/kitabu/vendor/ruby1.9/uv/syntax/release_notes.syntax +0 -46
  488. data/lib/kitabu/vendor/ruby1.9/uv/syntax/remind.syntax +0 -253
  489. data/lib/kitabu/vendor/ruby1.9/uv/syntax/restructuredtext.syntax +0 -250
  490. data/lib/kitabu/vendor/ruby1.9/uv/syntax/rez.syntax +0 -80
  491. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ruby.syntax +0 -1035
  492. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ruby_experimental.syntax +0 -145
  493. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ruby_on_rails.syntax +0 -88
  494. data/lib/kitabu/vendor/ruby1.9/uv/syntax/s5.syntax +0 -69
  495. data/lib/kitabu/vendor/ruby1.9/uv/syntax/scheme.syntax +0 -347
  496. data/lib/kitabu/vendor/ruby1.9/uv/syntax/scilab.syntax +0 -41
  497. data/lib/kitabu/vendor/ruby1.9/uv/syntax/setext.syntax +0 -147
  498. data/lib/kitabu/vendor/ruby1.9/uv/syntax/shell-unix-generic.syntax +0 -384
  499. data/lib/kitabu/vendor/ruby1.9/uv/syntax/slate.syntax +0 -149
  500. data/lib/kitabu/vendor/ruby1.9/uv/syntax/sql.syntax +0 -237
  501. data/lib/kitabu/vendor/ruby1.9/uv/syntax/sql_rails.syntax +0 -18
  502. data/lib/kitabu/vendor/ruby1.9/uv/syntax/ssh-config.syntax +0 -33
  503. data/lib/kitabu/vendor/ruby1.9/uv/syntax/standard_ml.syntax +0 -121
  504. data/lib/kitabu/vendor/ruby1.9/uv/syntax/strings_file.syntax +0 -39
  505. data/lib/kitabu/vendor/ruby1.9/uv/syntax/subversion_commit_message.syntax +0 -36
  506. data/lib/kitabu/vendor/ruby1.9/uv/syntax/sweave.syntax +0 -84
  507. data/lib/kitabu/vendor/ruby1.9/uv/syntax/swig.syntax +0 -57
  508. data/lib/kitabu/vendor/ruby1.9/uv/syntax/tcl.syntax +0 -152
  509. data/lib/kitabu/vendor/ruby1.9/uv/syntax/template_toolkit.syntax +0 -121
  510. data/lib/kitabu/vendor/ruby1.9/uv/syntax/tex.syntax +0 -86
  511. data/lib/kitabu/vendor/ruby1.9/uv/syntax/tex_math.syntax +0 -49
  512. data/lib/kitabu/vendor/ruby1.9/uv/syntax/textile.syntax +0 -215
  513. data/lib/kitabu/vendor/ruby1.9/uv/syntax/tsv.syntax +0 -50
  514. data/lib/kitabu/vendor/ruby1.9/uv/syntax/twiki.syntax +0 -241
  515. data/lib/kitabu/vendor/ruby1.9/uv/syntax/txt2tags.syntax +0 -79
  516. data/lib/kitabu/vendor/ruby1.9/uv/syntax/vectorscript.syntax +0 -57
  517. data/lib/kitabu/vendor/ruby1.9/uv/syntax/xhtml_1.0.syntax +0 -4027
  518. data/lib/kitabu/vendor/ruby1.9/uv/syntax/xml.syntax +0 -180
  519. data/lib/kitabu/vendor/ruby1.9/uv/syntax/xml_strict.syntax +0 -92
  520. data/lib/kitabu/vendor/ruby1.9/uv/syntax/xsl.syntax +0 -60
  521. data/lib/kitabu/vendor/ruby1.9/uv/syntax/yaml.syntax +0 -160
  522. data/lib/kitabu/vendor/ruby1.9/uv/syntax/yui_javascript.syntax +0 -176
  523. data/lib/kitabu/vendor/ruby1.9/uv/uv.rb +0 -89
  524. data/lib/kitabu/vendor/ruby1.9/uv/uv/render_processor.rb +0 -132
  525. data/lib/kitabu/vendor/ruby1.9/uv/uv/utility.rb +0 -68
  526. data/spec/exit_matcher.rb +0 -45
  527. data/spec/fixtures/rails-guides/code/sample.rb +0 -7
  528. data/spec/kitabu/base_spec.rb +0 -159
  529. data/spec/kitabu/blackcloth_spec.rb +0 -41
  530. data/spec/kitabu/bug_fix_spec.rb +0 -25
  531. data/spec/kitabu/command_spec.rb +0 -82
  532. data/templates/Rakefile +0 -3
  533. data/templates/config.yml +0 -9
  534. data/templates/layouts/boom/layout.css +0 -469
  535. data/templates/syntax.css +0 -1065
  536. data/templates/themes/active4d.css +0 -114
  537. data/templates/themes/blackboard.css +0 -88
  538. data/templates/themes/dawn.css +0 -121
  539. data/templates/themes/eiffel.css +0 -121
  540. data/templates/themes/idle.css +0 -62
  541. data/templates/themes/iplastic.css +0 -80
  542. data/templates/themes/lazy.css +0 -73
  543. data/templates/themes/slush_poppies.css +0 -85
  544. data/templates/themes/sunburst.css +0 -180
@@ -1,94 +0,0 @@
1
- # encoding: utf-8
2
- KITABU_HELP = <<-TXT
3
- The 'kitabu' command creates a new book with a default
4
- directory structure at the path you specify.
5
-
6
- == Usage
7
- kitabu [options] path
8
-
9
- For help use: kitabu -h
10
-
11
- == Options
12
- -h, --help Displays help message
13
- -v, --version Display the version, then exit
14
- -l, --layout Specify which layout to use
15
-
16
- == Examples
17
- Using defaults.
18
- kitabu mybook
19
-
20
- Specify layout.
21
- kitabu -l boom mybook
22
- kitabu --layout boom mybook
23
-
24
- == Author
25
- Nando Vieira
26
- http://simplesideias.com.br
27
-
28
- == Copyright
29
- Copyright (c) 2008-2009 Nando Vieira.
30
- Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
31
- TXT
32
-
33
- module Kitabu
34
- module Command
35
- extend self
36
-
37
- def run!
38
- options = {}
39
-
40
- opts = OptionParser.new do |opts|
41
- opts.banner = "The 'kitabu' command creates a new book with a default\ndirectory structure at the path you specify."
42
-
43
- opts.separator ""
44
- opts.separator "Options:"
45
-
46
- opts.on("-l", "--layout LAYOUT", "Specify which layout to use.", "Available: #{Kitabu::Base.layouts.join(', ')}") do |layout|
47
- if layout && !Kitabu::Base.layout?(layout)
48
- output "Invalid layout"
49
- exit 1
50
- end
51
-
52
- options[:layout] = layout
53
- end
54
-
55
- opts.on("-h", "--help", "Show help") do
56
- output KITABU_HELP
57
- exit 0
58
- end
59
-
60
- opts.on_tail("-v", "--version", "Show version") do
61
- output Kitabu::VERSION
62
- exit 0
63
- end
64
- end
65
-
66
- args = ARGV.dup
67
- other_args = opts.permute!
68
-
69
- unless other_args.any?
70
- output KITABU_HELP
71
- exit 0
72
- end
73
-
74
- path = File.expand_path(other_args.first)
75
-
76
- if File.exists?(path)
77
- output "Output path already exists"
78
- exit 1
79
- end
80
-
81
- opts.parse!(args)
82
-
83
- Kitabu::Templates.process!({
84
- :layout => options[:layout],
85
- :theme => options[:theme],
86
- :path => path
87
- })
88
- end
89
-
90
- def output(*args)
91
- puts *args
92
- end
93
- end
94
- end
@@ -1,964 +0,0 @@
1
- # encoding: utf-8
2
- class RedCloth < String
3
-
4
- VERSION = '3.0.4'
5
- DEFAULT_RULES = [:textile, :markdown]
6
-
7
- #
8
- # Two accessor for setting security restrictions.
9
- #
10
- # This is a nice thing if you're using RedCloth for
11
- # formatting in public places (e.g. Wikis) where you
12
- # don't want users to abuse HTML for bad things.
13
- #
14
- # If +:filter_html+ is set, HTML which wasn't
15
- # created by the Textile processor will be escaped.
16
- #
17
- # If +:filter_styles+ is set, it will also disable
18
- # the style markup specifier. ('{color: red}')
19
- #
20
- attr_accessor :filter_html, :filter_styles
21
-
22
- #
23
- # Accessor for toggling hard breaks.
24
- #
25
- # If +:hard_breaks+ is set, single newlines will
26
- # be converted to HTML break tags. This is the
27
- # default behavior for traditional RedCloth.
28
- #
29
- attr_accessor :hard_breaks
30
-
31
- # Accessor for toggling lite mode.
32
- #
33
- # In lite mode, block-level rules are ignored. This means
34
- # that tables, paragraphs, lists, and such aren't available.
35
- # Only the inline markup for bold, italics, entities and so on.
36
- #
37
- # r = RedCloth.new( "And then? She *fell*!", [:lite_mode] )
38
- # r.to_html
39
- # #=> "And then? She <strong>fell</strong>!"
40
- #
41
- attr_accessor :lite_mode
42
-
43
- #
44
- # Accessor for toggling span caps.
45
- #
46
- # Textile places `span' tags around capitalized
47
- # words by default, but this wreaks havoc on Wikis.
48
- # If +:no_span_caps+ is set, this will be
49
- # suppressed.
50
- #
51
- attr_accessor :no_span_caps
52
-
53
- #
54
- # Establishes the markup predence. Available rules include:
55
- #
56
- # == Textile Rules
57
- #
58
- # The following textile rules can be set individually. Or add the complete
59
- # set of rules with the single :textile rule, which supplies the rule set in
60
- # the following precedence:
61
- #
62
- # refs_textile:: Textile references (i.e. [hobix]http://hobix.com/)
63
- # block_textile_table:: Textile table block structures
64
- # block_textile_lists:: Textile list structures
65
- # block_textile_prefix:: Textile blocks with prefixes (i.e. bq., h2., etc.)
66
- # inline_textile_image:: Textile inline images
67
- # inline_textile_link:: Textile inline links
68
- # inline_textile_span:: Textile inline spans
69
- # glyphs_textile:: Textile entities (such as em-dashes and smart quotes)
70
- #
71
- # == Markdown
72
- #
73
- # refs_markdown:: Markdown references (for example: [hobix]: http://hobix.com/)
74
- # block_markdown_setext:: Markdown setext headers
75
- # block_markdown_atx:: Markdown atx headers
76
- # block_markdown_rule:: Markdown horizontal rules
77
- # block_markdown_bq:: Markdown blockquotes
78
- # block_markdown_lists:: Markdown lists
79
- # inline_markdown_link:: Markdown links
80
- attr_accessor :rules
81
-
82
- # Returns a new RedCloth object, based on _string_ and
83
- # enforcing all the included _restrictions_.
84
- #
85
- # r = RedCloth.new( "h1. A <b>bold</b> man", [:filter_html] )
86
- # r.to_html
87
- # #=>"<h1>A &lt;b&gt;bold&lt;/b&gt; man</h1>"
88
- #
89
- def initialize( string, restrictions = [] )
90
- restrictions.each { |r| method( "#{ r }=" ).call( true ) }
91
- super( string )
92
- end
93
-
94
- #
95
- # Generates HTML from the Textile contents.
96
- #
97
- # r = RedCloth.new( "And then? She *fell*!" )
98
- # r.to_html( true )
99
- # #=>"And then? She <strong>fell</strong>!"
100
- #
101
- def to_html( *rules )
102
- rules = DEFAULT_RULES if rules.empty?
103
- # make our working copy
104
- text = self.dup
105
-
106
- @urlrefs = {}
107
- @shelf = []
108
- textile_rules = [:refs_textile, :block_textile_table, :block_textile_lists,
109
- :block_textile_prefix, :inline_textile_image, :inline_textile_link,
110
- :inline_textile_code, :inline_textile_span, :glyphs_textile]
111
- markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule,
112
- :block_markdown_bq, :block_markdown_lists,
113
- :inline_markdown_reflink, :inline_markdown_link]
114
- @rules = rules.collect do |rule|
115
- case rule
116
- when :markdown
117
- markdown_rules
118
- when :textile
119
- textile_rules
120
- else
121
- rule
122
- end
123
- end.flatten
124
-
125
- # standard clean up
126
- incoming_entities text
127
- clean_white_space text
128
-
129
- # start processor
130
- @pre_list = []
131
- rip_offtags text
132
- no_textile text
133
- hard_break text
134
- unless @lite_mode
135
- refs text
136
- blocks text
137
- end
138
- inline text
139
- smooth_offtags text
140
-
141
- retrieve text
142
-
143
- text.gsub!( /<\/?notextile>/, '' )
144
- text.gsub!( /x%x%/, '&#38;' )
145
- clean_html text if filter_html
146
- text.strip!
147
- text
148
-
149
- end
150
-
151
- #######
152
- private
153
- #######
154
- #
155
- # Mapping of 8-bit ASCII codes to HTML numerical entity equivalents.
156
- # (from PyTextile)
157
- #
158
- TEXTILE_TAGS =
159
-
160
- [[128, 8364], [129, 0], [130, 8218], [131, 402], [132, 8222], [133, 8230],
161
- [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249],
162
- [140, 338], [141, 0], [142, 0], [143, 0], [144, 0], [145, 8216], [146, 8217],
163
- [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732],
164
- [153, 8482], [154, 353], [155, 8250], [156, 339], [157, 0], [158, 0], [159, 376]].
165
-
166
- collect! do |a, b|
167
- [a.chr, ( b.zero? and "" or "&#{ b };" )]
168
- end
169
-
170
- #
171
- # Regular expressions to convert to HTML.
172
- #
173
- A_HLGN = /(?:(?:<>|<|>|\=|[()]+)+)/
174
- A_VLGN = /[\-^~]/
175
- C_CLAS = '(?:\([^)]+\))'
176
- C_LNGE = '(?:\[[^\]]+\])'
177
- C_STYL = '(?:\{[^}]+\})'
178
- S_CSPN = '(?:\\\\\d+)'
179
- S_RSPN = '(?:/\d+)'
180
- A = "(?:#{A_HLGN}?#{A_VLGN}?|#{A_VLGN}?#{A_HLGN}?)"
181
- S = "(?:#{S_CSPN}?#{S_RSPN}|#{S_RSPN}?#{S_CSPN}?)"
182
- C = "(?:#{C_CLAS}?#{C_STYL}?#{C_LNGE}?|#{C_STYL}?#{C_LNGE}?#{C_CLAS}?|#{C_LNGE}?#{C_STYL}?#{C_CLAS}?)"
183
- # PUNCT = Regexp::quote( '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' )
184
- PUNCT = Regexp::quote( '!"#$%&\'*+,-./:;=?@\\^_`|~' )
185
- PUNCT_NOQ = Regexp::quote( '!"#$&\',./:;=?@\\`|' )
186
- PUNCT_Q = Regexp::quote( '*-_+^~%' )
187
- HYPERLINK = '(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)'
188
-
189
- # Text markup tags, don't conflict with block tags
190
- SIMPLE_HTML_TAGS = [
191
- 'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code',
192
- 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'a', 'img', 'br',
193
- 'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo'
194
- ]
195
-
196
- QTAGS = [
197
- ['**', 'b'],
198
- ['*', 'strong'],
199
- ['??', 'cite', :limit],
200
- ['-', 'del', :limit],
201
- ['__', 'i'],
202
- ['_', 'em', :limit],
203
- ['%', 'span', :limit],
204
- ['+', 'ins', :limit],
205
- ['^', 'sup'],
206
- ['~', 'sub']
207
- ]
208
- QTAGS.collect! do |rc, ht, rtype|
209
- rcq = Regexp::quote rc
210
- re =
211
- case rtype
212
- when :limit
213
- /(\W)
214
- (#{rcq})
215
- (#{C})
216
- (?::(\S+?))?
217
- (\S.*?\S|\S)
218
- #{rcq}
219
- (?=\W)/x
220
- else
221
- /(#{rcq})
222
- (#{C})
223
- (?::(\S+))?
224
- (\S.*?\S|\S)
225
- #{rcq}/xm
226
- end
227
- [rc, ht, re, rtype]
228
- end
229
-
230
- # Elements to handle
231
- GLYPHS = [
232
- # [ /([^\s\[{(>])?\'([dmst]\b|ll\b|ve\b|\s|:|$)/, '\1&#8217;\2' ], # single closing
233
- [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1&#8217;' ], # single closing
234
- [ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '&#8217;' ], # single closing
235
- [ /\'/, '&#8216;' ], # single opening
236
- [ /</, '&lt;' ], # less-than
237
- [ />/, '&gt;' ], # greater-than
238
- # [ /([^\s\[{(])?"(\s|:|$)/, '\1&#8221;\2' ], # double closing
239
- [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1&#8221;' ], # double closing
240
- [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '&#8221;' ], # double closing
241
- [ /"/, '&#8220;' ], # double opening
242
- [ /\b( )?\.{3}/, '\1&#8230;' ], # ellipsis
243
- [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '<acronym title="\2">\1</acronym>' ], # 3+ uppercase acronym
244
- [ /(^|[^"][>\s])([A-Z][A-Z0-9 ]+[A-Z0-9])([^<A-Za-z0-9]|$)/, '\1<span class="caps">\2</span>\3', :no_span_caps ], # 3+ uppercase caps
245
- [ /(\.\s)?\s?--\s?/, '\1&#8212;' ], # em dash
246
- [ /\s->\s/, ' &rarr; ' ], # right arrow
247
- [ /\s-\s/, ' &#8211; ' ], # en dash
248
- [ /(\d+) ?x ?(\d+)/, '\1&#215;\2' ], # dimension sign
249
- [ /\b ?[(\[]TM[\])]/i, '&#8482;' ], # trademark
250
- [ /\b ?[(\[]R[\])]/i, '&#174;' ], # registered
251
- [ /\b ?[(\[]C[\])]/i, '&#169;' ] # copyright
252
- ]
253
-
254
- H_ALGN_VALS = {
255
- '<' => 'left',
256
- '=' => 'center',
257
- '>' => 'right',
258
- '<>' => 'justify'
259
- }
260
-
261
- V_ALGN_VALS = {
262
- '^' => 'top',
263
- '-' => 'middle',
264
- '~' => 'bottom'
265
- }
266
-
267
- #
268
- # Flexible HTML escaping
269
- #
270
- def htmlesc( str, mode )
271
- str.gsub!( '&', '&amp;' )
272
- str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
273
- str.gsub!( "'", '&#039;' ) if mode == :Quotes
274
- str.gsub!( '<', '&lt;')
275
- str.gsub!( '>', '&gt;')
276
- end
277
-
278
- # Search and replace for Textile glyphs (quotes, dashes, other symbols)
279
- def pgl( text )
280
- GLYPHS.each do |re, resub, tog|
281
- next if tog and method( tog ).call
282
- text.gsub! re, resub
283
- end
284
- end
285
-
286
- # Parses Textile attribute lists and builds an HTML attribute string
287
- def pba( text_in, element = "" )
288
-
289
- return '' unless text_in
290
-
291
- style = []
292
- text = text_in.dup
293
- if element == 'td'
294
- colspan = $1 if text =~ /\\(\d+)/
295
- rowspan = $1 if text =~ /\/(\d+)/
296
- style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN
297
- end
298
-
299
- style << "#{ $1 };" if not filter_styles and
300
- text.sub!( /\{([^}]*)\}/, '' )
301
-
302
- lang = $1 if
303
- text.sub!( /\[([^)]+?)\]/, '' )
304
-
305
- cls = $1 if
306
- text.sub!( /\(([^()]+?)\)/, '' )
307
-
308
- style << "padding-left:#{ $1.length }em;" if
309
- text.sub!( /([(]+)/, '' )
310
-
311
- style << "padding-right:#{ $1.length }em;" if text.sub!( /([)]+)/, '' )
312
-
313
- style << "text-align:#{ h_align( $& ) };" if text =~ A_HLGN
314
-
315
- cls, id = $1, $2 if cls =~ /^(.*?)#(.*)$/
316
-
317
- atts = ''
318
- atts << " style=\"#{ style.join }\"" unless style.empty?
319
- atts << " class=\"#{ cls }\"" unless cls.to_s.empty?
320
- atts << " lang=\"#{ lang }\"" if lang
321
- atts << " id=\"#{ id }\"" if id
322
- atts << " colspan=\"#{ colspan }\"" if colspan
323
- atts << " rowspan=\"#{ rowspan }\"" if rowspan
324
-
325
- atts
326
- end
327
-
328
- TABLE_RE = /^(?:table(_?#{S}#{A}#{C})\. ?\n)?^(#{A}#{C}\.? ?\|.*?\|)(\n\n|\Z)/m
329
-
330
- # Parses a Textile table block, building HTML from the result.
331
- def block_textile_table( text )
332
- text.gsub!( TABLE_RE ) do |matches|
333
-
334
- tatts, fullrow = $~[1..2]
335
- tatts = pba( tatts, 'table' )
336
- tatts = shelve( tatts ) if tatts
337
- rows = []
338
-
339
- fullrow.
340
- split( /\|$/m ).
341
- delete_if { |x| x.empty? }.
342
- each do |row|
343
-
344
- ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
345
-
346
- cells = []
347
- row.split( '|' ).each do |cell|
348
- ctyp = 'd'
349
- ctyp = 'h' if cell =~ /^_/
350
-
351
- catts = ''
352
- catts, cell = pba( $1, 'td' ), $2 if cell =~ /^(_?#{S}#{A}#{C}\. ?)(.*)/
353
-
354
- unless cell.strip.empty?
355
- catts = shelve( catts ) if catts
356
- cells << "\t\t\t<t#{ ctyp }#{ catts }>#{ cell }</t#{ ctyp }>"
357
- end
358
- end
359
- ratts = shelve( ratts ) if ratts
360
- rows << "\t\t<tr#{ ratts }>\n#{ cells.join( "\n" ) }\n\t\t</tr>"
361
- end
362
- "\t<table#{ tatts }>\n#{ rows.join( "\n" ) }\n\t</table>\n\n"
363
- end
364
- end
365
-
366
- LISTS_RE = /^([#*]+?#{C} .*?)$(?![^#*])/m
367
- LISTS_CONTENT_RE = /^([#*]+)(#{A}#{C}) (.*)$/m
368
-
369
- # Parses Textile lists and generates HTML
370
- def block_textile_lists( text )
371
- text.gsub!( LISTS_RE ) do |match|
372
- lines = match.split( /\n/ )
373
- last_line = -1
374
- depth = []
375
- lines.each_with_index do |line, line_id|
376
- if line =~ LISTS_CONTENT_RE
377
- tl,atts,content = $~[1..3]
378
- if depth.last
379
- if depth.last.length > tl.length
380
- (depth.length - 1).downto(0) do |i|
381
- break if depth[i].length == tl.length
382
- lines[line_id - 1] << "</li>\n\t</#{ lT( depth[i] ) }l>\n\t"
383
- depth.pop
384
- end
385
- end
386
- if depth.last and depth.last.length == tl.length
387
- lines[line_id - 1] << '</li>'
388
- end
389
- end
390
- unless depth.last == tl
391
- depth << tl
392
- atts = pba( atts )
393
- atts = shelve( atts ) if atts
394
- lines[line_id] = "\t<#{ lT(tl) }l#{ atts }>\n\t<li>#{ content }"
395
- else
396
- lines[line_id] = "\t\t<li>#{ content }"
397
- end
398
- last_line = line_id
399
-
400
- else
401
- last_line = line_id
402
- end
403
- if line_id - last_line > 1 or line_id == lines.length - 1
404
- depth.delete_if do |v|
405
- lines[last_line] << "</li>\n\t</#{ lT( v ) }l>"
406
- end
407
- end
408
- end
409
- lines.join( "\n" )
410
- end
411
- end
412
-
413
- CODE_RE = /(\W)
414
- @
415
- (?:\|(\w+?)\|)?
416
- (.+?)
417
- @
418
- (?=\W)/x
419
-
420
- def inline_textile_code( text )
421
- text.gsub!( CODE_RE ) do |m|
422
- before,lang,code,after = $~[1..4]
423
- lang = " lang=\"#{ lang }\"" if lang
424
- rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }" )
425
- end
426
- end
427
-
428
- def lT( text )
429
- text =~ /\#$/ ? 'o' : 'u'
430
- end
431
-
432
- def hard_break( text )
433
- text.gsub!( /(.)\n(?!\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks
434
- end
435
-
436
- BLOCKS_GROUP_RE = /\n{2,}(?! )/m
437
-
438
- def blocks( text, deep_code = false )
439
- text.replace( text.split( BLOCKS_GROUP_RE ).collect do |blk|
440
- plain = blk !~ /\A[#*> ]/
441
-
442
- # skip blocks that are complex HTML
443
- if blk =~ /^<\/?(\w+).*>/ and not SIMPLE_HTML_TAGS.include? $1
444
- blk
445
- else
446
- # search for indentation levels
447
- blk.strip!
448
- if blk.empty?
449
- blk
450
- else
451
- code_blk = nil
452
- blk.gsub!( /((?:\n(?:\n^ +[^\n]*)+)+)/m ) do |iblk|
453
- flush_left iblk
454
- blocks iblk, plain
455
- iblk.gsub( /^(\S)/, "\t\\1" )
456
- if plain
457
- code_blk = iblk; ""
458
- else
459
- iblk
460
- end
461
- end
462
-
463
- block_applied = 0
464
- @rules.each do |rule_name|
465
- block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) )
466
- end
467
- if block_applied.zero?
468
- if deep_code
469
- blk = "\t<pre><code>#{ blk }</code></pre>"
470
- else
471
- blk = "\t<p>#{ blk }</p>"
472
- end
473
- end
474
- # hard_break blk
475
- blk + "\n#{ code_blk }"
476
- end
477
- end
478
-
479
- end.join( "\n\n" ) )
480
- end
481
-
482
- def textile_bq( tag, atts, cite, content )
483
- cite, cite_title = check_refs( cite )
484
- cite = " cite=\"#{ cite }\"" if cite
485
- atts = shelve( atts ) if atts
486
- "\t<blockquote#{ cite }>\n\t\t<p#{ atts }>#{ content }</p>\n\t</blockquote>"
487
- end
488
-
489
- def textile_p( tag, atts, cite, content )
490
- atts = shelve( atts ) if atts
491
- "\t<#{ tag }#{ atts }>#{ content }</#{ tag }>"
492
- end
493
-
494
- alias textile_h1 textile_p
495
- alias textile_h2 textile_p
496
- alias textile_h3 textile_p
497
- alias textile_h4 textile_p
498
- alias textile_h5 textile_p
499
- alias textile_h6 textile_p
500
-
501
- def textile_fn_( tag, num, atts, cite, content )
502
- atts << " id=\"fn#{ num }\""
503
- content = "<sup>#{ num }</sup> #{ content }"
504
- atts = shelve( atts ) if atts
505
- "\t<p#{ atts }>#{ content }</p>"
506
- end
507
-
508
- BLOCK_RE = /^(([a-z]+)(\d*))(#{A}#{C})\.(?::(\S+))? (.*)$/m
509
-
510
- def block_textile_prefix( text )
511
- if text =~ BLOCK_RE
512
- tag,tagpre,num,atts,cite,content = $~[1..6]
513
- atts = pba( atts )
514
-
515
- # pass to prefix handler
516
- if respond_to? "textile_#{ tag }", true
517
- text.gsub!( $&, method( "textile_#{ tag }" ).call( tag, atts, cite, content ) )
518
- elsif respond_to? "textile_#{ tagpre }_", true
519
- text.gsub!( $&, method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) )
520
- end
521
- end
522
- end
523
-
524
- SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m
525
- def block_markdown_setext( text )
526
- if text =~ SETEXT_RE
527
- tag = if $2 == "="; "h1"; else; "h2"; end
528
- blk, cont = "<#{ tag }>#{ $1 }</#{ tag }>", $'
529
- blocks cont
530
- text.replace( blk + cont )
531
- end
532
- end
533
-
534
- ATX_RE = /\A(\#{1,6}) # $1 = string of #'s
535
- [ ]*
536
- (.+?) # $2 = Header text
537
- [ ]*
538
- \#* # optional closing #'s (not counted)
539
- $/x
540
- def block_markdown_atx( text )
541
- if text =~ ATX_RE
542
- tag = "h#{ $1.length }"
543
- blk, cont = "<#{ tag }>#{ $2 }</#{ tag }>\n\n", $'
544
- blocks cont
545
- text.replace( blk + cont )
546
- end
547
- end
548
-
549
- MARKDOWN_BQ_RE = /\A(^ *> ?.+$(.+\n)*\n*)+/m
550
-
551
- def block_markdown_bq( text )
552
- text.gsub!( MARKDOWN_BQ_RE ) do |blk|
553
- blk.gsub!( /^ *> ?/, '' )
554
- flush_left blk
555
- blocks blk
556
- blk.gsub!( /^(\S)/, "\t\\1" )
557
- "<blockquote>\n#{ blk }\n</blockquote>\n\n"
558
- end
559
- end
560
-
561
- MARKDOWN_RULE_RE = /^(#{
562
- ['*', '-', '_'].collect { |ch| '( ?' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' )
563
- })$/
564
-
565
- def block_markdown_rule( text )
566
- text.gsub!( MARKDOWN_RULE_RE ) do |blk|
567
- "<hr />"
568
- end
569
- end
570
-
571
- # XXX TODO XXX
572
- def block_markdown_lists( text )
573
- end
574
-
575
- def inline_textile_span( text )
576
- QTAGS.each do |qtag_rc, ht, qtag_re, rtype|
577
- text.gsub!( qtag_re ) do |m|
578
-
579
- case rtype
580
- when :limit
581
- sta,qtag,atts,cite,content = $~[1..5]
582
- else
583
- qtag,atts,cite,content = $~[1..4]
584
- sta = ''
585
- end
586
- atts = pba( atts )
587
- atts << " cite=\"#{ cite }\"" if cite
588
- atts = shelve( atts ) if atts
589
-
590
- "#{ sta }<#{ ht }#{ atts }>#{ content }</#{ ht }>"
591
-
592
- end
593
- end
594
- end
595
-
596
- LINK_RE = /
597
- ([\s\[{(]|[#{PUNCT}])? # $pre
598
- " # start
599
- (#{C}) # $atts
600
- ([^"]+?) # $text
601
- \s?
602
- (?:\(([^)]+?)\)(?="))? # $title
603
- ":
604
- (\S+?) # $url
605
- (\/)? # $slash
606
- ([^\w\/;]*?) # $post
607
- (?=<|\s|$)
608
- /x
609
-
610
- def inline_textile_link( text )
611
- text.gsub!( LINK_RE ) do |m|
612
- pre,atts,text,title,url,slash,post = $~[1..7]
613
-
614
- url, url_title = check_refs( url )
615
- title ||= url_title
616
-
617
- atts = pba( atts )
618
- atts = " href=\"#{ url }#{ slash }\"#{ atts }"
619
- atts << " title=\"#{ title }\"" if title
620
- atts = shelve( atts ) if atts
621
-
622
- "#{ pre }<a#{ atts }>#{ text }</a>#{ post }"
623
- end
624
- end
625
-
626
- MARKDOWN_REFLINK_RE = /
627
- \[([^\[\]]+)\] # $text
628
- [ ]? # opt. space
629
- (?:\n[ ]*)? # one optional newline followed by spaces
630
- \[(.*?)\] # $id
631
- /x
632
-
633
- def inline_markdown_reflink( text )
634
- text.gsub!( MARKDOWN_REFLINK_RE ) do |m|
635
- text, id = $~[1..2]
636
-
637
- if id.empty?
638
- url, title = check_refs( text )
639
- else
640
- url, title = check_refs( id )
641
- end
642
-
643
- atts = " href=\"#{ url }\""
644
- atts << " title=\"#{ title }\"" if title
645
- atts = shelve( atts )
646
-
647
- "<a#{ atts }>#{ text }</a>"
648
- end
649
- end
650
-
651
- MARKDOWN_LINK_RE = /
652
- \[([^\[\]]+)\] # $text
653
- \( # open paren
654
- [ \t]* # opt space
655
- <?(.+?)>? # $href
656
- [ \t]* # opt space
657
- (?: # whole title
658
- (['"]) # $quote
659
- (.*?) # $title
660
- \3 # matching quote
661
- )? # title is optional
662
- \)
663
- /x
664
-
665
- def inline_markdown_link( text )
666
- text.gsub!( MARKDOWN_LINK_RE ) do |m|
667
- text, url, quote, title = $~[1..4]
668
-
669
- atts = " href=\"#{ url }\""
670
- atts << " title=\"#{ title }\"" if title
671
- atts = shelve( atts )
672
-
673
- "<a#{ atts }>#{ text }</a>"
674
- end
675
- end
676
-
677
- TEXTILE_REFS_RE = /(^ *)\[([^\n]+?)\](#{HYPERLINK})(?=\s|$)/
678
- MARKDOWN_REFS_RE = /(^ *)\[([^\n]+?)\]:\s+<?(#{HYPERLINK})>?(?:\s+"((?:[^"]|\\")+)")?(?=\s|$)/m
679
-
680
- def refs( text )
681
- @rules.each do |rule_name|
682
- method( rule_name ).call( text ) if rule_name.to_s.match /^refs_/
683
- end
684
- end
685
-
686
- def refs_textile( text )
687
- text.gsub!( TEXTILE_REFS_RE ) do |m|
688
- flag, url = $~[2..3]
689
- @urlrefs[flag.downcase] = [url, nil]
690
- nil
691
- end
692
- end
693
-
694
- def refs_markdown( text )
695
- text.gsub!( MARKDOWN_REFS_RE ) do |m|
696
- flag, url = $~[2..3]
697
- title = $~[6]
698
- @urlrefs[flag.downcase] = [url, title]
699
- nil
700
- end
701
- end
702
-
703
- def check_refs( text )
704
- ret = @urlrefs[text.downcase] if text
705
- ret || [text, nil]
706
- end
707
-
708
- IMAGE_RE = /
709
- (<p>|.|^) # start of line?
710
- \! # opening
711
- (\<|\=|\>)? # optional alignment atts
712
- (#{C}) # optional style,class atts
713
- (?:\. )? # optional dot-space
714
- ([^\s(!]+?) # presume this is the src
715
- \s? # optional space
716
- (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title
717
- \! # closing
718
- (?::#{ HYPERLINK })? # optional href
719
- /x
720
-
721
- def inline_textile_image( text )
722
- text.gsub!( IMAGE_RE ) do |m|
723
- stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
724
- atts = pba( atts )
725
- atts = " src=\"#{ url }\"#{ atts }"
726
- atts << " title=\"#{ title }\"" if title
727
- atts << " alt=\"#{ title }\""
728
- # size = @getimagesize($url);
729
- # if($size) $atts.= " $size[3]";
730
-
731
- href, alt_title = check_refs( href ) if href
732
- url, url_title = check_refs( url )
733
-
734
- out = ''
735
- out << "<a#{ shelve( " href=\"#{ href }\"" ) }>" if href
736
- out << "<img#{ shelve( atts ) } />"
737
- out << "</a>#{ href_a1 }#{ href_a2 }" if href
738
-
739
- if algn
740
- algn = h_align( algn )
741
- if stln == "<p>"
742
- out = "<p style=\"float:#{ algn }\">#{ out }"
743
- else
744
- out = "#{ stln }<div style=\"float:#{ algn }\">#{ out }</div>"
745
- end
746
- else
747
- out = stln + out
748
- end
749
-
750
- out
751
- end
752
- end
753
-
754
- def shelve( val )
755
- @shelf << val
756
- " :redsh##{ @shelf.length }:"
757
- end
758
-
759
- def retrieve( text )
760
- @shelf.each_with_index do |r, i|
761
- text.gsub!( " :redsh##{ i + 1 }:", r )
762
- end
763
- end
764
-
765
- def incoming_entities( text )
766
- ## turn any incoming ampersands into a dummy character for now.
767
- ## This uses a negative lookahead for alphanumerics followed by a semicolon,
768
- ## implying an incoming html entity, to be skipped
769
-
770
- text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" )
771
- end
772
-
773
- def no_textile( text )
774
- text.gsub!( /(^|\s)==([^=]+.*?)==(\s|$)?/,
775
- '\1<notextile>\2</notextile>\3' )
776
- text.gsub!( /^ *==([^=]+.*?)==/m,
777
- '\1<notextile>\2</notextile>\3' )
778
- end
779
-
780
- def clean_white_space( text )
781
- # normalize line breaks
782
- text.gsub!( /\r\n/, "\n" )
783
- text.gsub!( /\r/, "\n" )
784
- text.gsub!( /\t/, ' ' )
785
- text.gsub!( /^ +$/, '' )
786
- text.gsub!( /\n{3,}/, "\n\n" )
787
- text.gsub!( /"$/, "\" " )
788
-
789
- # if entire document is indented, flush
790
- # to the left side
791
- flush_left text
792
- end
793
-
794
- def flush_left( text )
795
- indt = 0
796
- if text =~ /^ /
797
- while text !~ /^ {#{indt}}\S/
798
- indt += 1
799
- end unless text.empty?
800
- if indt.nonzero?
801
- text.gsub!( /^ {#{indt}}/, '' )
802
- end
803
- end
804
- end
805
-
806
- def footnote_ref( text )
807
- text.gsub!( /\b\[([0-9]+?)\](\s)?/,
808
- '<sup><a href="#fn\1">\1</a></sup>\2' )
809
- end
810
-
811
- OFFTAGS = /(code|pre|kbd|notextile)/
812
- OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi
813
- OFFTAG_OPEN = /<#{ OFFTAGS }/
814
- OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
815
- HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
816
- ALLTAG_MATCH = /(<\/?\w[^\n]*?>)|.*?(?=<\/?\w[^\n]*?>|$)/m
817
-
818
- def glyphs_textile( text, level = 0 )
819
- if text !~ HASTAG_MATCH
820
- pgl text
821
- footnote_ref text
822
- else
823
- codepre = 0
824
- text.gsub!( ALLTAG_MATCH ) do |line|
825
- ## matches are off if we're between <code>, <pre> etc.
826
- if $1
827
- if line =~ OFFTAG_OPEN
828
- codepre += 1
829
- elsif line =~ OFFTAG_CLOSE
830
- codepre -= 1
831
- codepre = 0 if codepre < 0
832
- end
833
- elsif codepre.zero?
834
- glyphs_textile( line, level + 1 )
835
- else
836
- htmlesc( line, :NoQuotes )
837
- end
838
- # p [level, codepre, line]
839
-
840
- line
841
- end
842
- end
843
- end
844
-
845
- def rip_offtags( text )
846
- if text =~ /<.*>/
847
- ## strip and encode <pre> content
848
- codepre, used_offtags = 0, {}
849
- text.gsub!( OFFTAG_MATCH ) do |line|
850
- if $3
851
- offtag, aftertag = $4, $5
852
- codepre += 1
853
- used_offtags[offtag] = true
854
- if codepre - used_offtags.length > 0
855
- htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
856
- @pre_list.last << line
857
- line = ""
858
- else
859
- htmlesc( aftertag, :NoQuotes ) if aftertag and not used_offtags['notextile']
860
- line = "<redpre##{ @pre_list.length }>"
861
- @pre_list << "#{ $3 }#{ aftertag }"
862
- end
863
- elsif $1 and codepre > 0
864
- if codepre - used_offtags.length > 0
865
- htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
866
- @pre_list.last << line
867
- line = ""
868
- end
869
- codepre -= 1 unless codepre.zero?
870
- used_offtags = {} if codepre.zero?
871
- end
872
- line
873
- end
874
- end
875
- text
876
- end
877
-
878
- def smooth_offtags( text )
879
- unless @pre_list.empty?
880
- ## replace <pre> content
881
- text.gsub!( /<redpre#(\d+)>/ ) { @pre_list[$1.to_i] }
882
- end
883
- end
884
-
885
- def inline( text )
886
- [/^inline_/, /^glyphs_/].each do |meth_re|
887
- @rules.each do |rule_name|
888
- method( rule_name ).call( text ) if rule_name.to_s.match( meth_re )
889
- end
890
- end
891
- end
892
-
893
- def h_align( text )
894
- H_ALGN_VALS[text]
895
- end
896
-
897
- def v_align( text )
898
- V_ALGN_VALS[text]
899
- end
900
-
901
- def textile_popup_help( name, windowW, windowH )
902
- ' <a target="_blank" href="http://hobix.com/textile/#' + helpvar + '" onclick="window.open(this.href, \'popupwindow\', \'width=' + windowW + ',height=' + windowH + ',scrollbars,resizable\'); return false;">' + name + '</a><br />'
903
- end
904
-
905
- # HTML cleansing stuff
906
- BASIC_TAGS = {
907
- 'a' => ['href', 'title'],
908
- 'img' => ['src', 'alt', 'title'],
909
- 'br' => [],
910
- 'i' => nil,
911
- 'u' => nil,
912
- 'b' => nil,
913
- 'pre' => nil,
914
- 'kbd' => nil,
915
- 'code' => ['lang'],
916
- 'cite' => nil,
917
- 'strong' => nil,
918
- 'em' => nil,
919
- 'ins' => nil,
920
- 'sup' => nil,
921
- 'sub' => nil,
922
- 'del' => nil,
923
- 'table' => nil,
924
- 'tr' => nil,
925
- 'td' => ['colspan', 'rowspan'],
926
- 'th' => nil,
927
- 'ol' => nil,
928
- 'ul' => nil,
929
- 'li' => nil,
930
- 'p' => nil,
931
- 'h1' => nil,
932
- 'h2' => nil,
933
- 'h3' => nil,
934
- 'h4' => nil,
935
- 'h5' => nil,
936
- 'h6' => nil,
937
- 'blockquote' => ['cite']
938
- }
939
-
940
- def clean_html( text, tags = BASIC_TAGS )
941
- text.gsub!( /<!\[CDATA\[/, '' )
942
- text.gsub!( /<(\/*)(\w+)([^>]*)>/ ) do
943
- raw = $~
944
- tag = raw[2].downcase
945
- if tags.has_key? tag
946
- pcs = [tag]
947
- tags[tag].each do |prop|
948
- ['"', "'", ''].each do |q|
949
- q2 = ( q != '' ? q : '\s' )
950
- if raw[3] =~ /#{prop}\s*=\s*#{q}([^#{q2}]+)#{q}/i
951
- attrv = $1
952
- next if prop == 'src' and attrv =~ %r{^(?!http)\w+:}
953
- pcs << "#{prop}=\"#{$1.gsub('"', '\\"')}\""
954
- break
955
- end
956
- end
957
- end if tags[tag]
958
- "<#{raw[1]}#{pcs.join " "}>"
959
- else
960
- " "
961
- end
962
- end
963
- end
964
- end