rabbit 0.9.2 → 0.9.3

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 (345) hide show
  1. data/Gemfile +16 -0
  2. data/README +1 -0
  3. data/Rakefile +161 -53
  4. data/TODO +2 -0
  5. data/bin/rabbit +78 -34
  6. data/bin/rabbit-command +16 -3
  7. data/bin/rabbiter +74 -73
  8. data/bin/rabrick +17 -4
  9. data/bin/rabwii +77 -0
  10. data/data/rabbit/image/dark-gradation-images/background-gradation.png +0 -0
  11. data/data/rabbit/image/dark-gradation-images/dark-gradation-images.rb +2 -0
  12. data/data/rabbit/image/dark-gradation-images/property.rb +4 -0
  13. data/doc/_config.yml +2 -0
  14. data/doc/_layouts/en.html +37 -0
  15. data/doc/_layouts/ja.html +37 -0
  16. data/doc/_layouts/skeleton.html +91 -0
  17. data/doc/_plugins/converters/hiki.rb +27 -0
  18. data/doc/_plugins/converters/rd.rb +73 -0
  19. data/doc/_site/css/jquery-ui/themes/ui-lightness.css +573 -0
  20. data/doc/_site/css/rabbit.css +247 -0
  21. data/doc/_site/en/development.html +140 -0
  22. data/doc/_site/en/faq.html +117 -0
  23. data/doc/_site/en/hiki.html +420 -0
  24. data/doc/_site/en/how-to-make/hiki.html +113 -0
  25. data/doc/_site/en/how-to-make/index.html +135 -0
  26. data/doc/_site/en/how-to-make/pdf.html +111 -0
  27. data/doc/_site/en/how-to-make/rd.html +151 -0
  28. data/doc/_site/en/how-to-make/theme.html +249 -0
  29. data/doc/_site/en/index.html +343 -0
  30. data/doc/_site/en/install/homebrew.html +279 -0
  31. data/doc/_site/en/install/index.html +144 -0
  32. data/doc/_site/en/install/macports.html +158 -0
  33. data/doc/_site/en/install/windows.html +200 -0
  34. data/doc/_site/en/news.html +928 -0
  35. data/doc/_site/en/rd.html +555 -0
  36. data/doc/_site/en/sample/hiki/rabbit.html +380 -0
  37. data/doc/_site/en/sample/index.html +117 -0
  38. data/doc/_site/en/sample/rd/rabbit.html +572 -0
  39. data/doc/_site/en/slides.html +113 -0
  40. data/doc/_site/en/usage.html +445 -0
  41. data/doc/_site/en/users.html +127 -0
  42. data/doc/_site/favicon.ico +0 -0
  43. data/doc/_site/favicon.png +0 -0
  44. data/doc/_site/images/background-sample.svg +290 -0
  45. data/doc/_site/images/background.png +0 -0
  46. data/doc/_site/images/background.svg +131 -0
  47. data/doc/_site/images/hare-and-tortoise.png +0 -0
  48. data/doc/_site/images/hare-and-tortoise.svg +541 -0
  49. data/doc/_site/images/jp.png +0 -0
  50. data/{sample/momo/usako/usako_psd_100.png → doc/_site/images/lavie-icon.png} +0 -0
  51. data/doc/_site/images/lavie.png +0 -0
  52. data/doc/_site/images/screenshots/en/blue-circle-raw.png +0 -0
  53. data/doc/_site/images/screenshots/en/blue-circle.png +0 -0
  54. data/doc/_site/images/screenshots/en/clear-blue-raw.png +0 -0
  55. data/doc/_site/images/screenshots/en/clear-blue.png +0 -0
  56. data/doc/_site/images/screenshots/en/cozmixng-raw.png +0 -0
  57. data/doc/_site/images/screenshots/en/cozmixng.png +0 -0
  58. data/doc/_site/images/screenshots/en/dark-gradation-raw.png +0 -0
  59. data/doc/_site/images/screenshots/en/dark-gradation.png +0 -0
  60. data/doc/_site/images/screenshots/en/day-white-raw.png +0 -0
  61. data/doc/_site/images/screenshots/en/day-white.png +0 -0
  62. data/doc/_site/images/screenshots/en/debian-raw.png +0 -0
  63. data/doc/_site/images/screenshots/en/debian.png +0 -0
  64. data/doc/_site/images/screenshots/en/green-circle-raw.png +0 -0
  65. data/doc/_site/images/screenshots/en/green-circle.png +0 -0
  66. data/doc/_site/images/screenshots/en/night-black-raw.png +0 -0
  67. data/doc/_site/images/screenshots/en/night-black.png +0 -0
  68. data/doc/_site/images/screenshots/en/rabbit-raw.png +0 -0
  69. data/doc/_site/images/screenshots/en/rabbit.png +0 -0
  70. data/doc/_site/images/screenshots/en/ranguba-raw.png +0 -0
  71. data/doc/_site/images/screenshots/en/ranguba.png +0 -0
  72. data/doc/_site/images/screenshots/en/red-frame-raw.png +0 -0
  73. data/doc/_site/images/screenshots/en/red-frame.png +0 -0
  74. data/doc/_site/images/screenshots/en/ruby-gnome2-raw.png +0 -0
  75. data/doc/_site/images/screenshots/en/ruby-gnome2.png +0 -0
  76. data/doc/_site/images/screenshots/ja/blue-circle-raw.png +0 -0
  77. data/doc/_site/images/screenshots/ja/blue-circle.png +0 -0
  78. data/doc/_site/images/screenshots/ja/clear-blue-raw.png +0 -0
  79. data/doc/_site/images/screenshots/ja/clear-blue.png +0 -0
  80. data/doc/_site/images/screenshots/ja/cozmixng-raw.png +0 -0
  81. data/doc/_site/images/screenshots/ja/cozmixng.png +0 -0
  82. data/doc/_site/images/screenshots/ja/dark-gradation-raw.png +0 -0
  83. data/doc/_site/images/screenshots/ja/dark-gradation.png +0 -0
  84. data/doc/_site/images/screenshots/ja/day-white-raw.png +0 -0
  85. data/doc/_site/images/screenshots/ja/day-white.png +0 -0
  86. data/doc/_site/images/screenshots/ja/debian-raw.png +0 -0
  87. data/doc/_site/images/screenshots/ja/debian.png +0 -0
  88. data/doc/_site/images/screenshots/ja/green-circle-raw.png +0 -0
  89. data/doc/_site/images/screenshots/ja/green-circle.png +0 -0
  90. data/doc/_site/images/screenshots/ja/night-black-raw.png +0 -0
  91. data/doc/_site/images/screenshots/ja/night-black.png +0 -0
  92. data/doc/_site/images/screenshots/ja/rabbit-raw.png +0 -0
  93. data/doc/_site/images/screenshots/ja/rabbit.png +0 -0
  94. data/doc/_site/images/screenshots/ja/ranguba-raw.png +0 -0
  95. data/doc/_site/images/screenshots/ja/ranguba.png +0 -0
  96. data/doc/_site/images/screenshots/ja/red-frame-raw.png +0 -0
  97. data/doc/_site/images/screenshots/ja/red-frame.png +0 -0
  98. data/doc/_site/images/screenshots/ja/ruby-gnome2-raw.png +0 -0
  99. data/doc/_site/images/screenshots/ja/ruby-gnome2.png +0 -0
  100. data/doc/_site/images/us.png +0 -0
  101. data/doc/_site/index.html.en +122 -0
  102. data/doc/_site/index.html.ja +122 -0
  103. data/doc/_site/ja/about.html +120 -0
  104. data/doc/_site/ja/development.html +141 -0
  105. data/doc/_site/ja/faq.html +232 -0
  106. data/doc/_site/ja/hiki.html +416 -0
  107. data/doc/_site/ja/how-to-make/hiki.html +113 -0
  108. data/doc/_site/ja/how-to-make/index.html +135 -0
  109. data/doc/_site/ja/how-to-make/pdf.html +112 -0
  110. data/doc/_site/ja/how-to-make/rd.html +161 -0
  111. data/doc/_site/ja/how-to-make/theme.html +254 -0
  112. data/doc/_site/ja/index.html +351 -0
  113. data/doc/_site/ja/install/homebrew.html +279 -0
  114. data/doc/_site/ja/install/index.html +146 -0
  115. data/doc/_site/ja/install/macports.html +177 -0
  116. data/doc/_site/ja/install/windows.html +200 -0
  117. data/doc/_site/ja/news.html +926 -0
  118. data/doc/_site/ja/rd.html +565 -0
  119. data/doc/_site/ja/sample/hiki/rabbit.html +390 -0
  120. data/doc/_site/ja/sample/index.html +117 -0
  121. data/doc/_site/ja/sample/rd/rabbit.html +580 -0
  122. data/doc/_site/ja/slides.html +142 -0
  123. data/doc/_site/ja/usage.html +458 -0
  124. data/doc/_site/ja/users.html +331 -0
  125. data/doc/_site/javascripts/jquery-ui.js +11544 -0
  126. data/doc/_site/javascripts/jquery.js +7179 -0
  127. data/doc/_site/screenshot.en.rab +10 -0
  128. data/doc/_site/screenshot.ja.rab +10 -0
  129. data/doc/css/jquery-ui/themes/ui-lightness.css +573 -0
  130. data/doc/css/rabbit.css +247 -0
  131. data/doc/en/development.rd +50 -0
  132. data/doc/en/faq.rd +18 -0
  133. data/doc/en/hiki.hiki +325 -0
  134. data/doc/en/how-to-make/hiki.hiki +9 -0
  135. data/doc/en/how-to-make/index.rd +25 -0
  136. data/doc/en/how-to-make/pdf.rd +7 -0
  137. data/doc/en/how-to-make/rd.rd +66 -0
  138. data/doc/en/how-to-make/theme.rd +135 -0
  139. data/doc/en/index.rd +276 -0
  140. data/doc/en/install/homebrew.rd +196 -0
  141. data/doc/en/install/index.rd +63 -0
  142. data/doc/en/install/macports.rd +77 -0
  143. data/doc/en/install/windows.rd +103 -0
  144. data/{NEWS.en → doc/en/news.rd} +78 -3
  145. data/doc/en/rd.rd +481 -0
  146. data/doc/en/sample/hiki/rabbit.hiki +389 -0
  147. data/doc/en/sample/index.rd +11 -0
  148. data/doc/en/sample/rd/rabbit.rd +467 -0
  149. data/doc/en/slides.rd +7 -0
  150. data/doc/en/usage.rd +365 -0
  151. data/doc/en/users.rd +29 -0
  152. data/doc/favicon.ico +0 -0
  153. data/doc/favicon.png +0 -0
  154. data/doc/images/background-sample.svg +290 -0
  155. data/doc/images/background.png +0 -0
  156. data/doc/images/background.svg +131 -0
  157. data/doc/images/hare-and-tortoise.png +0 -0
  158. data/doc/images/hare-and-tortoise.svg +541 -0
  159. data/doc/images/jp.png +0 -0
  160. data/doc/images/lavie-icon.png +0 -0
  161. data/doc/images/lavie.png +0 -0
  162. data/doc/images/screenshots/en/blue-circle-raw.png +0 -0
  163. data/doc/images/screenshots/en/blue-circle.png +0 -0
  164. data/doc/images/screenshots/en/clear-blue-raw.png +0 -0
  165. data/doc/images/screenshots/en/clear-blue.png +0 -0
  166. data/doc/images/screenshots/en/cozmixng-raw.png +0 -0
  167. data/doc/images/screenshots/en/cozmixng.png +0 -0
  168. data/doc/images/screenshots/en/dark-gradation-raw.png +0 -0
  169. data/doc/images/screenshots/en/dark-gradation.png +0 -0
  170. data/doc/images/screenshots/en/day-white-raw.png +0 -0
  171. data/doc/images/screenshots/en/day-white.png +0 -0
  172. data/doc/images/screenshots/en/debian-raw.png +0 -0
  173. data/doc/images/screenshots/en/debian.png +0 -0
  174. data/doc/images/screenshots/en/green-circle-raw.png +0 -0
  175. data/doc/images/screenshots/en/green-circle.png +0 -0
  176. data/doc/images/screenshots/en/night-black-raw.png +0 -0
  177. data/doc/images/screenshots/en/night-black.png +0 -0
  178. data/doc/images/screenshots/en/rabbit-raw.png +0 -0
  179. data/doc/images/screenshots/en/rabbit.png +0 -0
  180. data/doc/images/screenshots/en/ranguba-raw.png +0 -0
  181. data/doc/images/screenshots/en/ranguba.png +0 -0
  182. data/doc/images/screenshots/en/red-frame-raw.png +0 -0
  183. data/doc/images/screenshots/en/red-frame.png +0 -0
  184. data/doc/images/screenshots/en/ruby-gnome2-raw.png +0 -0
  185. data/doc/images/screenshots/en/ruby-gnome2.png +0 -0
  186. data/doc/images/screenshots/ja/blue-circle-raw.png +0 -0
  187. data/doc/images/screenshots/ja/blue-circle.png +0 -0
  188. data/doc/images/screenshots/ja/clear-blue-raw.png +0 -0
  189. data/doc/images/screenshots/ja/clear-blue.png +0 -0
  190. data/doc/images/screenshots/ja/cozmixng-raw.png +0 -0
  191. data/doc/images/screenshots/ja/cozmixng.png +0 -0
  192. data/doc/images/screenshots/ja/dark-gradation-raw.png +0 -0
  193. data/doc/images/screenshots/ja/dark-gradation.png +0 -0
  194. data/doc/images/screenshots/ja/day-white-raw.png +0 -0
  195. data/doc/images/screenshots/ja/day-white.png +0 -0
  196. data/doc/images/screenshots/ja/debian-raw.png +0 -0
  197. data/doc/images/screenshots/ja/debian.png +0 -0
  198. data/doc/images/screenshots/ja/green-circle-raw.png +0 -0
  199. data/doc/images/screenshots/ja/green-circle.png +0 -0
  200. data/doc/images/screenshots/ja/night-black-raw.png +0 -0
  201. data/doc/images/screenshots/ja/night-black.png +0 -0
  202. data/doc/images/screenshots/ja/rabbit-raw.png +0 -0
  203. data/doc/images/screenshots/ja/rabbit.png +0 -0
  204. data/doc/images/screenshots/ja/ranguba-raw.png +0 -0
  205. data/doc/images/screenshots/ja/ranguba.png +0 -0
  206. data/doc/images/screenshots/ja/red-frame-raw.png +0 -0
  207. data/doc/images/screenshots/ja/red-frame.png +0 -0
  208. data/doc/images/screenshots/ja/ruby-gnome2-raw.png +0 -0
  209. data/doc/images/screenshots/ja/ruby-gnome2.png +0 -0
  210. data/doc/images/us.png +0 -0
  211. data/doc/index.html.en +48 -0
  212. data/doc/index.html.ja +48 -0
  213. data/doc/ja/about.rd +21 -0
  214. data/doc/ja/development.rd +49 -0
  215. data/doc/ja/faq.rd +177 -0
  216. data/doc/ja/hiki.hiki +319 -0
  217. data/doc/ja/how-to-make/hiki.hiki +9 -0
  218. data/doc/ja/how-to-make/index.rd +25 -0
  219. data/doc/ja/how-to-make/pdf.rd +8 -0
  220. data/doc/ja/how-to-make/rd.rd +83 -0
  221. data/doc/ja/how-to-make/theme.rd +142 -0
  222. data/doc/ja/index.rd +283 -0
  223. data/doc/ja/install/homebrew.rd +196 -0
  224. data/doc/ja/install/index.rd +65 -0
  225. data/doc/ja/install/macports.rd +105 -0
  226. data/doc/ja/install/windows.rd +100 -0
  227. data/{NEWS.ja → doc/ja/news.rd} +84 -3
  228. data/doc/ja/rd.rd +489 -0
  229. data/doc/ja/sample/hiki/rabbit.hiki +405 -0
  230. data/doc/ja/sample/index.rd +11 -0
  231. data/doc/ja/sample/rd/rabbit.rd +475 -0
  232. data/doc/ja/slides.rd +29 -0
  233. data/doc/ja/usage.rd +380 -0
  234. data/doc/ja/users.rd +173 -0
  235. data/doc/javascripts/jquery-ui.js +11544 -0
  236. data/doc/javascripts/jquery.js +7179 -0
  237. data/doc/screenshot.en.rab +10 -0
  238. data/doc/screenshot.ja.rab +10 -0
  239. data/lib/rabbit/action/toggle.rb +0 -14
  240. data/lib/rabbit/canvas.rb +42 -46
  241. data/lib/rabbit/console.rb +9 -1
  242. data/lib/rabbit/front.rb +1 -1
  243. data/lib/rabbit/keys.rb +0 -8
  244. data/lib/rabbit/logger/gui.rb +3 -5
  245. data/lib/rabbit/parser/pdf.rb +1 -1
  246. data/lib/rabbit/parser/wiki/output.rb +17 -1
  247. data/lib/rabbit/rabbit.rb +12 -1
  248. data/lib/rabbit/renderer/base.rb +0 -25
  249. data/lib/rabbit/renderer/display/clutter-embed.rb +5 -69
  250. data/lib/rabbit/renderer/display/drawing-area.rb +0 -2
  251. data/lib/rabbit/renderer/display/key-handler.rb +0 -8
  252. data/lib/rabbit/source/base.rb +4 -0
  253. data/lib/rabbit/theme/background-image-toolkit/background-image-toolkit.rb +4 -8
  254. data/lib/rabbit/theme/clutter-comment/clutter-comment.rb +76 -0
  255. data/lib/rabbit/theme/clutter-comment/property.rb +3 -0
  256. data/lib/rabbit/theme/color-circle/color-circle.rb +3 -0
  257. data/lib/rabbit/theme/dark-gradation/dark-gradation.rb +187 -0
  258. data/lib/rabbit/theme/dark-gradation/property.rb +3 -0
  259. data/lib/rabbit/theme/debian/debian.rb +125 -145
  260. data/lib/rabbit/theme/default/default.rb +6 -0
  261. data/lib/rabbit/theme/footer-comment/footer-comment.rb +46 -0
  262. data/lib/rabbit/theme/footer-comment/property.rb +3 -0
  263. data/lib/rabbit/theme/image/image.rb +3 -2
  264. data/lib/rabbit/theme/per-slide-background-color/property.rb +1 -1
  265. data/lib/rabbit/theme/slide-number/slide-number.rb +9 -3
  266. data/lib/rabbit/theme/stream-comment/property.rb +3 -0
  267. data/lib/rabbit/theme/stream-comment/stream-comment.rb +66 -0
  268. data/lib/rabbit/theme/tag/property.rb +1 -1
  269. data/lib/rabbit/theme/title-background-image/title-background-image.rb +6 -5
  270. data/lib/rabbit/theme/twitter-comment/property.rb +4 -0
  271. data/lib/rabbit/theme/twitter-comment/twitter-comment.rb +15 -0
  272. data/lib/rabbit/twitter.rb +216 -0
  273. data/lib/rabbit/utils.rb +26 -0
  274. data/misc/emacs/README.ja +1 -1
  275. data/misc/emacs/rabbit-mode.el +1 -1
  276. data/po/en/rabbit.po +429 -267
  277. data/po/fr/rabbit.po +440 -268
  278. data/po/ja/rabbit.po +455 -270
  279. data/po/rabbit.pot +2567 -0
  280. data/sample/rabbit-en.hiki +384 -0
  281. data/sample/rabbit-en.rd +1 -1
  282. data/sample/rabbit-implementation.rd +1 -1
  283. data/sample/rabbit.hiki +85 -13
  284. data/sample/rabbit.rd +1 -1
  285. data/sample/theme-bench-en.hiki +100 -0
  286. data/sample/theme-bench.hiki +101 -0
  287. metadata +413 -118
  288. data/README.en +0 -850
  289. data/README.ja +0 -885
  290. data/bin/rabbit.bat +0 -8
  291. data/data/locale/en/LC_MESSAGES/rabbit.mo +0 -0
  292. data/data/locale/fr/LC_MESSAGES/rabbit.mo +0 -0
  293. data/data/locale/ja/LC_MESSAGES/rabbit.mo +0 -0
  294. data/lib/rabbit/comment-canvas.rb +0 -21
  295. data/lib/rabbit/comment/log.rb +0 -74
  296. data/lib/rabbit/renderer/display/comment-drawing-area.rb +0 -175
  297. data/lib/rabbit/renderer/display/comment.rb +0 -194
  298. data/lib/rabbit/theme/comment/comment.rb +0 -5
  299. data/lib/rabbit/theme/comment/property.rb +0 -3
  300. data/lib/rt/rt2html-lib.rb +0 -157
  301. data/lib/rt/rtparser.rb +0 -226
  302. data/lib/rt/rtvisitor.rb +0 -68
  303. data/lib/rwiki/soap/common.rb +0 -5
  304. data/lib/rwiki/soap/driver.rb +0 -43
  305. data/lib/rwiki/soap/servant.rb +0 -78
  306. data/sample/asahina/alice.png +0 -0
  307. data/sample/asahina/yukiusa.png +0 -0
  308. data/sample/momo/banner/bn1.png +0 -0
  309. data/sample/momo/banner/bn2.png +0 -0
  310. data/sample/momo/banner/bn_psd.psd +0 -0
  311. data/sample/momo/banner/bn_psd2.psd +0 -0
  312. data/sample/momo/tailavi/tailavi-ruby.png +0 -0
  313. data/sample/momo/tailavi/tailavi-ruby.psd +0 -0
  314. data/sample/momo/tailavi/tailavi-taiyaki.png +0 -0
  315. data/sample/momo/tailavi/tailavi-taiyaki.psd +0 -0
  316. data/sample/momo/tailavi/tailavi-yokubari.png +0 -0
  317. data/sample/momo/tailavi/tailavi-yokubari.psd +0 -0
  318. data/sample/momo/tailavi/taiyaki.png +0 -0
  319. data/sample/momo/tailavi/taiyaki.psd +0 -0
  320. data/sample/momo/usako/blue_dot.png +0 -0
  321. data/sample/momo/usako/green_dot.png +0 -0
  322. data/sample/momo/usako/rabbit.png +0 -0
  323. data/sample/momo/usako/rabbit_mimi.png +0 -0
  324. data/sample/momo/usako/rabbit_mimi2.png +0 -0
  325. data/sample/momo/usako/red_dot.png +0 -0
  326. data/sample/momo/usako/ruby.png +0 -0
  327. data/sample/momo/usako/ruby_new.png +0 -0
  328. data/sample/momo/usako/usa1.png +0 -0
  329. data/sample/momo/usako/usa2.png +0 -0
  330. data/sample/momo/usako/usa3.png +0 -0
  331. data/sample/momo/usako/usako_psd.psd +0 -0
  332. data/sample/momo/usako/usako_psd_200.png +0 -0
  333. data/sample/rabbit-balloon.eps +0 -233
  334. data/sample/sode/kame-color.riff +0 -0
  335. data/sample/sode/kame.riff +0 -0
  336. data/sample/usatti/kame-taro.png +0 -0
  337. data/sample/usatti/rabbit-pink-logo.png +0 -0
  338. data/sample/usatti/rabbit-pink-logo2.png +0 -0
  339. data/sample/usatti/ruby-pink-circle-logo.png +0 -0
  340. data/sample/usatti/ruby-pink-circle.png +0 -0
  341. data/sample/usatti/ruby-pink-polygon-logo.png +0 -0
  342. data/sample/usatti/ruby-pink-polygon.png +0 -0
  343. data/sample/usatti/tanu-kitaro.png +0 -0
  344. data/sample/usatti/usa-taro.png +0 -0
  345. data/sample/usatti/yukidaru-taro.png +0 -0
data/doc/en/rd.rd ADDED
@@ -0,0 +1,481 @@
1
+ ---
2
+ layout: en
3
+ title: RD
4
+ apply_data: false
5
+ ---
6
+ == What is RD?
7
+
8
+ RD is Ruby's POD, embeddable documentation format in script file.
9
+
10
+ RD is influenced mainly from plain2, a program to translate from plain text to
11
+ some mark-up language. So, RD looks like plain text, and its simpleness and
12
+ neatness make it easy to read and write.
13
+
14
+ == How does the interpreter work for RD?
15
+
16
+ Ruby's interpreter, (({ruby})), simply ignores text between a line beginning
17
+ with "(({=begin}))" and one beginning with "(({=end}))". So, RD is not only
18
+ embeddable. You can write anything between (({=begin})) and (({=end})). RD is
19
+ one of them, but RD will be a standard one.((- If you are interested in others,
20
+ see rubyapi2
21
+ ((<URL:http://www.ueda.info.waseda.ac.jp/~igarashi/ruby/xml.html#rubyapi2>))
22
+ for example. -))
23
+
24
+ == Concepts and Syntax
25
+ === Element, Block and Inline
26
+
27
+ We will use the term "Element" for features of RD which add information
28
+ of document structure to text. In addition, we use a term
29
+ "((<Block>))" for Elements for large and global structures, and a term
30
+ "((<Inline>))" for ones for small and local decorations.
31
+
32
+ Paragraph, headline or list is a kind of Block. RD uses indentation and
33
+ special characters to describe Blocks. You can also write complicated
34
+ structure to nested Blocks. And this style of Block looks naturally like
35
+ plain text format. See ((<Block>)) for details.
36
+
37
+ Emphasis, code or reference is a kind of Inline. Parentheses and special
38
+ characters, like (('((? ... ?))')), are used for Inline. Almost all
39
+ Inline may be nested inside each other. See ((<Inline>)) for more details.
40
+
41
+ === Block
42
+ ==== Basic Syntax
43
+
44
+ Block has line oriented syntax. i.e. each character on the same line belongs to the
45
+ same Block. And the indentation of the line represents nesting level and type of Block.
46
+ The first character of the line represents the type of Block.
47
+
48
+ + Concepts and Terms
49
+
50
+ :Baseline
51
+ Baseline is standard depth of indent. Relative depth between indent of one
52
+ line and Baseline affects its Block-type.
53
+
54
+ :Head Char
55
+ Head Char is the first character of line, except whitespace.
56
+
57
+ :STRINGLINE
58
+ STRINGLINE is line which consists of strings.
59
+ STRINGLINE doesn't have "(({*}))", "(({(((|num|)))}))", "(({:}))", "(({=}))"
60
+ nor "(({+}))" as Head Char. But if the line is indented, "(({=}))" and "(({+}))"
61
+ can be Head Char.
62
+
63
+ :WHITELINE
64
+ WHITELINE is a line which consists of whitespace, "(({\s}))", "(({\t}))" and
65
+ "(({\n}))".
66
+
67
+ :Comment
68
+ A line which is matched with (({/^#/})) is regarded as a comment.
69
+
70
+ + How Baseline is defined and how it works
71
+ At the top level, Baseline is at left end, i.e., indent is 0. In List,
72
+ Baseline is defined by first Block of ListItem. For example,
73
+
74
+ Example: "|" means Baseline
75
+ |Regard this line as one of TextBlock's in top level.
76
+ |<- So this Baseline is at the left-most position.
77
+ *|it is in List. (1)
78
+ |<- this Baseline is defined by the marked with a (1).
79
+ * |Different Item of List can have different Baseline inside.
80
+ |<- So this Baseline differs from one of this list's first item.
81
+
82
+ |Regard this line as one of TextBlock's in top level.
83
+ |<- So this Baseline is at the left-most position.
84
+ *|it is in List. (1)
85
+ |<- this Baseline is defined by the marked with a (1).
86
+ * |Different Items in Lists can have different Baselines inside.
87
+ |<- So this Baseline differs from the one of this list's first item.
88
+
89
+
90
+ If one Block is nested in another Block, the Baseline of the inside Blocks is deeper
91
+ than the Baseline of outside Blocks.
92
+
93
+ The relative position between Baseline and indent affects the type of Block.
94
+ If a ((<STRINGLINE>)) has same indent with Baseline, it belongs to
95
+ ((<TextBlock>)), otherwise, i.e. it has deeper indent than Baseline,
96
+ it belongs to ((<Verbatim>)).
97
+
98
+ ==== Types of Block
99
+ + Headline
100
+
101
+ Headline consists of a line which ((<Head Char>)) is "(({=}))" or
102
+ "(({+}))". And Headline can't include more than one line. Headline can
103
+ be on only top level.
104
+ Example:
105
+ |<- Regard this as top level Baseline.
106
+ = Headline 1.
107
+ === Headline 1.1.1.
108
+ + Headline 1.1.1.1.1.
109
+
110
+ = Headline 1.
111
+ === Headline 1.1.1.
112
+ + Headline 1.1.1.1.1.
113
+
114
+ Headline Mark represents level of Headline. See following figure. first
115
+ Mark is biggest one, and last Mark has two parts.
116
+ Fig: Headline Marks
117
+ =
118
+ ==
119
+ ===
120
+ ====
121
+ +
122
+ ++
123
+
124
+ Text which follows Mark is title of Headline. It is also used as Label of
125
+ ((<Reference>)).
126
+
127
+ Title of Headline can contain ((<Inline>))s except for ((<Reference>)) and
128
+ Footnote.
129
+
130
+ + Include
131
+
132
+ Include is a line that line head "(({<<<}))" and included file name.
133
+ You can input from other file text, both RD and target format, with Include.
134
+
135
+ When you include RD file, included file name have to have ".rd" or ".rb" as
136
+ suffix, like "foo.rd", and write full name (not full path) of file after
137
+ "(({<<<}))". For example,
138
+ <<< foo.rd
139
+
140
+ When you include target format file, include file name have to have suffix
141
+ of target format standard one, for example ".html" in the case of outputting
142
+ HTML, ".texi" in the case of outputting Texinfo, and write base name of file
143
+ after "(({<<<}))". For example,
144
+ <<< foo
145
+ RD formatter include "foo.html" to output HTML, and include "foo.texi" to
146
+ output Texinfo. If you want to use Include for target format, you should
147
+ prepare plural type of included file.
148
+
149
+ + TextBlock
150
+
151
+ TextBlock is composed of ((<STRINGLINE>))s, but the ((<STRINGLINE>))s
152
+ must have same indent with ((<Baseline>)). If its indent is deeper
153
+ than ((<Baseline>)), the ((<STRINGLINE>)) belongs to ((<Verbatim>)).
154
+
155
+ TextBlock can include ((<Inline>)) inside.
156
+
157
+ Example:
158
+ |
159
+ This is TextBlock.
160
+ Second line of same TextBlock.
161
+ This line is not TextBlock, but Verbatim.
162
+ * And this line is List. (But this line is exactly TextBlock in ListItem.)
163
+
164
+ And this example is formatted such like:
165
+
166
+ This is TextBlock.
167
+ Second line of same TextBlock.
168
+ This line is not TextBlock, but Verbatim.
169
+ * And this line is List. (But this line is exactly TextBlock in ListItem.)
170
+
171
+ + Verbatim
172
+
173
+ You can use Verbatim to cite Ruby script. Verbatim is composed of
174
+ ((<STRINGLINE>))s, and they must be indented deeper than
175
+ ((<Baseline>)). Verbatim can also include a line whose ((<Head Char>)) is
176
+ "(({*}))", "(({(1)}))" and "(({:}))", But it can't be first line of
177
+ Verbatim, it is regarded as ((<List>)). Verbatim can't include a line
178
+ which is indented shallower than first line. Verbatim can include
179
+ ((<WHITELINE>)).
180
+
181
+ You can't use ((<Inline>)) in Verbatim.
182
+
183
+ Example:
184
+ This is Verbatim.
185
+ Even if a line is indented deeper than first line, it is also in same
186
+ Verbatim.
187
+ * A line seems like list is also included in Verbatim.
188
+ But if the line is indented shallower, it is not in same Verbatim.
189
+ It is in other Verbatim.
190
+
191
+ And this example is formatted such like:
192
+
193
+ This is Verbatim.
194
+ Even if a line is indented deeper than first line, it is also in same
195
+ Verbatim.
196
+ * A line seems like list is also included in Verbatim.
197
+ But if the line is indented shallower, it is not in same Verbatim.
198
+ It is in other Verbatim.
199
+
200
+ + List
201
+
202
+ List is special ((<Block>)). List is composed of ListItems, and
203
+ ListItem is composed of Blocks. So List can include Blocks inside,
204
+ even also List itself.((- But List can't include ((<Headline>))
205
+ nor ((<Include>)). -))
206
+
207
+ ListItem can include ((<WHITELINE>)), and ((<TextBlock>)) can't
208
+ include WHITELINE, so when you want to write 2 TextBlock inside
209
+ ListItem, put a WHITELINE between TextBlocks.
210
+
211
+ There is 3 type of List, "((<ItemList>))", "((<EnumList>))",
212
+ "((<DescList>))" and "((<MethodList>)).
213
+
214
+ ++ ItemList
215
+
216
+ ItemList is simple and not numbered List. ItemListItem begins by a line
217
+ whose ((<Head Char>)) is "(({*}))", and first Block of ItemListItem must be
218
+ ((<TextBlock>)).
219
+
220
+ Example:
221
+ * first item of parent list
222
+ * first item of sub list
223
+ * second item of sub list
224
+ text block ( line of first item of parent list)
225
+
226
+ And this example is formatted such like:
227
+
228
+ * first item of parent list
229
+ * first item of sub list
230
+ * second item of sub list
231
+ text block ( line of first item of parent list)
232
+
233
+ ++ EnumList
234
+
235
+ EnumList is numbered List. EnumListItem starts with a line whose
236
+ ((<Head Char>)) is "(({(((|num|)))}))"(((|num|)) is integer). EnumList
237
+ is same as ((<ItemList>)) on other points.
238
+
239
+ Example:
240
+ (1) first line of parent list
241
+ * first line of sub list(ItemList)
242
+ (2) second list of parent list
243
+ (10) number is ignored...
244
+
245
+ And this example is formatted such like:
246
+
247
+ (1) first line of parent list
248
+ * first line of sub list(ItemList)
249
+ (2) second list of parent list
250
+ (10) number is ignored...
251
+
252
+ ++ DescList
253
+
254
+ DescList is List for descriptions. DescListItem has 2 part. One is Term part,
255
+ the other is Description part. Term of DescListItem is also used as Label
256
+ for ((<Reference>)).
257
+
258
+ Term part is composed of a line whose ((<Head Char>)) is "(({:}))",
259
+ and Term part is same as ((<Headline>)), except that a line of Term
260
+ part can be indented.
261
+
262
+ Description part is starts with next line of Term part. ((<Baseline>)) of
263
+ Description part must be same or deeper than term of Term part of its pair.
264
+ For example, following style is illegal.
265
+ Example:
266
+ : |Term
267
+ |Description.
268
+
269
+ Description part can include ((<Block>))s. ((<List>)) can be first
270
+ Block of Description part. Term part can contain ((<Inline>))s except
271
+ for ((<Reference>)) and ((<Footnote>)).
272
+
273
+ Example:
274
+ :Term
275
+ first line of Description
276
+ second line of Description
277
+ :Term2
278
+ * also include List
279
+ * ...
280
+
281
+ And this example is formatted such like:
282
+
283
+ :Term
284
+ first line of definition.
285
+ second line of definition
286
+ :Term2
287
+ * also include list
288
+ * ...
289
+
290
+ ++ MethodList
291
+
292
+ MethodList is the special type of ((<DescList>)) for explanation
293
+ methods of your classes. MethodList is similar with ((<DescList>)) in
294
+ almost all part, but it is labeled differently. RD formatters know it
295
+ is some kind of program code, e.g. method or constants of class in
296
+ Ruby or function prototype in C..., which is on Term part of
297
+ MethodList. So, MethodList is labeled without the part which seems to
298
+ be parameters of methods. See ((<Label and Reference>)) for more
299
+ detail.
300
+
301
+ Each item of MethodList has Term part and Description part like
302
+ ((<DescList>)). And its Term part start with its ((<Head Char>)),
303
+ "(({---}))". Its Description part can contain ((<TextBlock>)),
304
+ ((<Verbatim>)) and ((<List>)). But you shouldn't write MethodList
305
+ in any kind of ((<List>)). RD will come to deny it possibly in
306
+ future.
307
+
308
+ Example:
309
+ --- Array#each {|i| ... } # => labeled as "Array#each"
310
+ yield block for each item.
311
+ --- Array#index(val) # => labeled as "Array#index"
312
+ return index of first item which equals with ((|val|)). if it hasn't
313
+ same item, return (({nil})).
314
+
315
+ And this example is formatted such like:
316
+
317
+ --- Array#each {|i| ... }
318
+ yield block for each item.
319
+ --- Array#index(val)
320
+ return index of first item which equals with ((|val|)). if it hasn't
321
+ same item, return (({nil})).
322
+
323
+ Some formatter assumes it is Ruby's methods, constants or etc. which
324
+ is in Term part of MethodList. it can format term part of MethodList
325
+ intelligently, but you have to write according as specific formula
326
+ to make the best of its feature.
327
+
328
+ Standard Ruby class reference formula is suggested such like:
329
+ : instance method
330
+ instance method ((|method|)) of class ((|Class|))
331
+ Class#method(its params ...) { parameter block }
332
+ : class method (class singleton method)
333
+ class method ((|method|)) of class ((|Class|))
334
+ Class.method(its params ...) { parameter block }
335
+ : class constants
336
+ constant ((|Const|)) of class ((|Class|))
337
+ Class::Const
338
+ : functions (private methods on top level)
339
+ function ((|func|))
340
+ function#func(its params ...) { parameter block }
341
+
342
+ Ruby use some symbol characters (e.g. [], []=, +, - or <<) for the names
343
+ of methods. ruby, Ruby interpreter, parses them with different manner from
344
+ normal methods, but write them as same as others in this formula.
345
+
346
+ Example:
347
+ --- Array#[](key)
348
+ return value which in at index ((|key|)).
349
+ --- Array#[]=(key, value)
350
+ put ((|value|)) into cell of index ((|key|)).
351
+ --- Array#+(other)
352
+ return concatenated (({Array})).
353
+
354
+ === Inline
355
+
356
+ You can use Inline in ((<TextBlock>)), ((<Headline>)) and Term part of
357
+ ((<DescList>)). Common style of parentheses is used for Inline. Inline
358
+ can nest each other.
359
+
360
+ in following list of Inlines, preformatted text is on left hand side
361
+ and postformatted text is on right hand side.
362
+
363
+ :(('((*Em*))')) => ((*Em*))
364
+ Emphasis.
365
+
366
+ :(('(({while gets...}))')) => (({while gets...}))
367
+ Code.
368
+
369
+ :(('((|var|))')) => ((|var|))
370
+ Var.((- You can read very good explanation about Var in texinfo.info. -))
371
+
372
+ :(('((%ruby -v%))')) => ((%ruby -v%))
373
+ Keyboard.
374
+
375
+ :(('((:Term:))'))
376
+ => ((:Term:))
377
+
378
+ Term of Index.
379
+
380
+ :(('((<Identity or URL>))'))
381
+ => ((<Identity or URL>))
382
+
383
+ Link, Reference. See ((<RD/Label and Reference>)) for more detail.
384
+
385
+ :(('((-Footnote-))'))
386
+ => ((-Footnote-))
387
+
388
+ Footnote.
389
+
390
+ :(('(('verb\'))')) => (('verb'))
391
+ Inline Verbatim.
392
+
393
+ ==== Label and Reference
394
+
395
+ Reference needs Label. In RD, only title of ((<Headline>)) and Term of
396
+ ((<DescList>)) and ((<MethodList>)) is regarded as Label. So, you must
397
+ choose different titles for different ((<Headline>))s. This problem
398
+ has not resolved yet.
399
+
400
+ + How to RD generates Label from Headline, DescList or MethodList
401
+
402
+ Title of ((<Headline>)) and Term part of ((<DescList>)) and ((<MethodList>))
403
+ are regarded as Label. But they can contain ((<Inline>))s, so the situation
404
+ isn't so simple.
405
+
406
+ First, ((<MethodList>)) is special in the part of Labeling. Term part of
407
+ ((<MethodList>)) can't contain ((<Inline>))s, and RD assumes it is method
408
+ reference or such thing which is in Term part of ((<MethodList>)). So
409
+ it is Labeled under following rules.
410
+
411
+ (1) It is regarded as Label which is before a character of "(({(}))" or
412
+ "(({{}))".((- text inside "(({(...)}))" is regarded as parameters
413
+ of method, and text inside "(({{...}}))" is regarded as parameter
414
+ block of methods.-))
415
+
416
+ Following example will help you to understand how this rule works. the Label
417
+ which is generated from the term part of ((<MethodList>)) is after mark of
418
+ "(({# =>}))".
419
+
420
+ Example:
421
+ --- Array.new([size[, val]]) # => Array.new
422
+ --- Array#[]=(key, val) # => Array#[]=
423
+ --- Array#each { ... } # => Array#each
424
+ --- void rb_define_method(VALUE class, ...) # => void rb_define_method
425
+
426
+ Second, in the case of title of ((<Headline>)) or term part of ((<DescList>)),
427
+ there is not such a special rule. But you can use ((<Inline>))s for text on
428
+ them, so there are rules to strip ((<Inline>)) mark-ups from text.
429
+
430
+ (1) Any ((<Inline>)) mark-ups makes any difference to Label. So, both
431
+ = ((*Headline*))
432
+ and
433
+ = Headline
434
+ are Labeled as "Headline".
435
+ (2) But white spaces which is after open parenthesis and before close
436
+ parenthesis of ((<Inline>)) are striped when RD generates Label from
437
+ it. So, both
438
+ = ((* Headline *))
439
+ and
440
+ = ((*Headline*))
441
+ are Labeled as "Headline".
442
+
443
+ + Reference
444
+
445
+ You can refer Labeled element with Reference which is a kind of ((<Inline>))
446
+ marked up with (('((<...>))')).
447
+
448
+ Most simple use of Reference is to write Label inside parenthesis.
449
+ ((<Label>))
450
+ This works as reference to Label of "Label" and text "Label" is used
451
+ also for display such like: ((<Label>)).((- There is no element Labeled
452
+ "Label", so it doesn't seems to be Reference probably. -))
453
+
454
+ When you want to refer a resource pointed with URL, write such like:
455
+ ((<URL:http://www.ruby-lang.org/en/raa.html>))
456
+ RD formatter will format it as hyper-link to its URL if possible
457
+ such like:((<URL:http://www.ruby-lang.org/en/raa.html>)).
458
+
459
+ When you want to use other text than Label for display, write such like:
460
+ ((<Text for display|Label>))
461
+ "Text for display" is used for display and "Label" is used as Label to
462
+ refer such like: ((<Text for display|Label>))
463
+
464
+ Text for display can contain some ((<Inline>)), except for Footnotes and
465
+ Reference.
466
+
467
+ In Reference, "|" and "/" are syntax keywords. So if you will write them
468
+ inside Reference, you have to double-quote the part it's inside, such like:
469
+ ((<"Bar | inside display text"|Label>))
470
+ ((<"Bar | inside display text"|Label>))
471
+
472
+ The situations are same whether you will write them inside Substitution
473
+ part, Filename part and Label part.
474
+
475
+ Of course, you can use the text for the display for Reference to URL resource.
476
+ ((<Ruby Application Archive|URL:http://www.ruby-lang.org/en/raa.html>))
477
+ ((<Ruby Application Archive|URL:http://www.ruby-lang.org/en/raa.html>))
478
+
479
+ When the text for the display is omitted, you can use ((<Inline>)) for Label.
480
+ ((<((*Label*))>))
481
+ ((<((*Label*))>))