yard 0.2.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yard might be problematic. Click here for more details.

Files changed (365) hide show
  1. data/.yardopts +12 -10
  2. data/ChangeLog +5686 -0
  3. data/{README.markdown → README.md} +65 -11
  4. data/Rakefile +25 -13
  5. data/benchmarks/concat_vs_join.rb +12 -0
  6. data/benchmarks/erb_vs_erubis.rb +14 -14
  7. data/benchmarks/marshal_vs_dbm.rb +1 -1
  8. data/benchmarks/pathname_vs_string.rb +50 -0
  9. data/benchmarks/template_erb.rb +22 -0
  10. data/benchmarks/template_format.rb +6 -0
  11. data/benchmarks/template_profile.rb +17 -0
  12. data/bin/yri +16 -7
  13. data/docs/{CODE_OBJECTS.markdown → CodeObjects.md} +0 -0
  14. data/docs/{GETTING_STARTED.markdown → GettingStarted.md} +49 -11
  15. data/docs/{GLOSSARY.markdown → Glossary.md} +0 -0
  16. data/docs/{HANDLERS.markdown → Handlers.md} +5 -5
  17. data/docs/{OVERVIEW.markdown → Overview.md} +9 -13
  18. data/docs/{PARSER.markdown → Parser.md} +1 -1
  19. data/docs/{TAGS.markdown → Tags.md} +1 -1
  20. data/docs/Templates.md +286 -0
  21. data/docs/{WHATSNEW.markdown → WhatsNew.md} +82 -2
  22. data/lib/rubygems_plugin.rb +17 -20
  23. data/lib/yard.rb +47 -1
  24. data/lib/yard/autoload.rb +38 -47
  25. data/lib/yard/cli/yard_graph.rb +36 -13
  26. data/lib/yard/cli/yardoc.rb +74 -12
  27. data/lib/yard/code_objects/base.rb +182 -14
  28. data/lib/yard/code_objects/class_object.rb +39 -2
  29. data/lib/yard/code_objects/class_variable_object.rb +4 -0
  30. data/lib/yard/code_objects/constant_object.rb +8 -0
  31. data/lib/yard/code_objects/extended_method_object.rb +14 -0
  32. data/lib/yard/code_objects/method_object.rb +60 -2
  33. data/lib/yard/code_objects/module_object.rb +6 -0
  34. data/lib/yard/code_objects/namespace_object.rb +99 -2
  35. data/lib/yard/code_objects/proxy.rb +53 -6
  36. data/lib/yard/code_objects/root_object.rb +2 -0
  37. data/lib/yard/core_ext/array.rb +61 -0
  38. data/lib/yard/core_ext/file.rb +21 -4
  39. data/lib/yard/core_ext/module.rb +11 -1
  40. data/lib/yard/core_ext/string.rb +13 -2
  41. data/lib/yard/core_ext/symbol_hash.rb +51 -3
  42. data/lib/yard/docstring.rb +68 -19
  43. data/lib/yard/globals.rb +5 -2
  44. data/lib/yard/handlers/base.rb +13 -3
  45. data/lib/yard/handlers/processor.rb +64 -2
  46. data/lib/yard/handlers/ruby/class_handler.rb +1 -1
  47. data/lib/yard/handlers/ruby/class_variable_handler.rb +5 -1
  48. data/lib/yard/handlers/ruby/constant_handler.rb +38 -4
  49. data/lib/yard/handlers/ruby/exception_handler.rb +1 -0
  50. data/lib/yard/handlers/ruby/legacy/base.rb +2 -2
  51. data/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +6 -3
  52. data/lib/yard/handlers/ruby/legacy/constant_handler.rb +21 -2
  53. data/lib/yard/handlers/ruby/legacy/method_handler.rb +10 -0
  54. data/lib/yard/handlers/ruby/legacy/yield_handler.rb +2 -1
  55. data/lib/yard/handlers/ruby/method_handler.rb +10 -0
  56. data/lib/yard/handlers/ruby/yield_handler.rb +2 -1
  57. data/lib/yard/logging.rb +17 -0
  58. data/lib/yard/parser/ruby/ast_node.rb +101 -0
  59. data/lib/yard/parser/ruby/legacy/ruby_lex.rb +2 -2
  60. data/lib/yard/parser/ruby/legacy/statement_list.rb +10 -9
  61. data/lib/yard/parser/ruby/ruby_parser.rb +32 -3
  62. data/lib/yard/parser/source_parser.rb +82 -5
  63. data/lib/yard/rake/yardoc_task.rb +38 -3
  64. data/lib/yard/registry.rb +112 -2
  65. data/lib/yard/serializers/base.rb +48 -1
  66. data/lib/yard/serializers/file_system_serializer.rb +23 -2
  67. data/lib/yard/serializers/process_serializer.rb +10 -0
  68. data/lib/yard/serializers/stdout_serializer.rb +11 -0
  69. data/lib/yard/tags/library.rb +4 -1
  70. data/lib/yard/tags/overload_tag.rb +3 -12
  71. data/lib/yard/templates/engine.rb +162 -0
  72. data/lib/yard/{generators → templates}/helpers/base_helper.rb +14 -13
  73. data/lib/yard/{generators → templates}/helpers/filter_helper.rb +1 -1
  74. data/lib/yard/templates/helpers/html_helper.rb +287 -0
  75. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +29 -0
  76. data/lib/yard/templates/helpers/html_syntax_highlight_helper18.rb +27 -0
  77. data/lib/yard/{generators → templates}/helpers/markup_helper.rb +15 -11
  78. data/lib/yard/{generators → templates}/helpers/method_helper.rb +8 -1
  79. data/lib/yard/templates/helpers/module_helper.rb +15 -0
  80. data/lib/yard/templates/helpers/text_helper.rb +60 -0
  81. data/lib/yard/templates/helpers/uml_helper.rb +33 -0
  82. data/lib/yard/templates/template.rb +355 -0
  83. data/lib/yard/verifier.rb +110 -0
  84. data/spec/cli/yardoc_spec.rb +23 -1
  85. data/spec/code_objects/base_spec.rb +8 -0
  86. data/spec/code_objects/class_object_spec.rb +166 -156
  87. data/spec/code_objects/method_object_spec.rb +2 -2
  88. data/spec/code_objects/module_object_spec.rb +112 -110
  89. data/spec/code_objects/proxy_spec.rb +9 -0
  90. data/spec/core_ext/array_spec.rb +33 -0
  91. data/spec/core_ext/file_spec.rb +40 -12
  92. data/spec/core_ext/module_spec.rb +15 -0
  93. data/spec/core_ext/string_spec.rb +10 -2
  94. data/spec/docstring_spec.rb +157 -135
  95. data/spec/handlers/class_handler_spec.rb +3 -0
  96. data/spec/handlers/class_variable_handler_spec.rb +3 -1
  97. data/spec/handlers/constant_handler_spec.rb +38 -0
  98. data/spec/handlers/examples/class_handler_001.rb.txt +14 -1
  99. data/spec/handlers/examples/class_variable_handler_001.rb.txt +1 -0
  100. data/spec/handlers/examples/constant_handler_001.rb.txt +10 -1
  101. data/spec/handlers/examples/exception_handler_001.rb.txt +5 -0
  102. data/spec/handlers/examples/method_handler_001.rb.txt +15 -0
  103. data/spec/handlers/examples/mixin_handler_001.rb.txt +13 -0
  104. data/spec/handlers/exception_handler_spec.rb +4 -0
  105. data/spec/handlers/method_handler_spec.rb +22 -0
  106. data/spec/handlers/mixin_handler_spec.rb +5 -3
  107. data/spec/handlers/yield_handler_spec.rb +1 -1
  108. data/spec/parser/ruby/ast_node_spec.rb +16 -0
  109. data/spec/parser/ruby/legacy/statement_list_spec.rb +36 -0
  110. data/spec/parser/ruby/ruby_parser_spec.rb +80 -0
  111. data/spec/parser/source_parser_spec.rb +48 -2
  112. data/spec/rake/yardoc_task_spec.rb +62 -25
  113. data/spec/serializers/file_system_serializer_spec.rb +1 -1
  114. data/spec/templates/class_spec.rb +34 -0
  115. data/spec/templates/engine_spec.rb +121 -0
  116. data/spec/templates/examples/class001.html +271 -0
  117. data/spec/templates/examples/class001.txt +31 -0
  118. data/spec/templates/examples/method001.html +96 -0
  119. data/spec/templates/examples/method001.txt +28 -0
  120. data/spec/templates/examples/method002.html +81 -0
  121. data/spec/templates/examples/method002.txt +20 -0
  122. data/spec/templates/examples/method003.html +137 -0
  123. data/spec/templates/examples/method003.txt +45 -0
  124. data/spec/templates/examples/module001.dot +31 -0
  125. data/spec/templates/examples/module001.html +294 -0
  126. data/spec/templates/examples/module001.txt +33 -0
  127. data/spec/templates/examples/tag001.txt +82 -0
  128. data/spec/templates/helpers/base_helper_spec.rb +129 -0
  129. data/spec/{generators → templates}/helpers/html_helper_spec.rb +73 -16
  130. data/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +39 -0
  131. data/spec/{generators → templates}/helpers/markup_helper_spec.rb +6 -7
  132. data/spec/templates/method_spec.rb +75 -0
  133. data/spec/templates/module_spec.rb +50 -0
  134. data/spec/templates/spec_helper.rb +33 -0
  135. data/spec/templates/tag_spec.rb +39 -0
  136. data/spec/templates/template_spec.rb +398 -0
  137. data/spec/verifier_spec.rb +51 -0
  138. data/spec/yard_spec.rb +46 -0
  139. data/templates/default/class/dot/setup.rb +6 -0
  140. data/templates/default/class/dot/superklass.erb +3 -0
  141. data/templates/default/class/html/constructor_details.erb +8 -0
  142. data/templates/default/class/html/setup.rb +1 -0
  143. data/templates/default/class/html/subclasses.erb +4 -0
  144. data/templates/default/class/setup.rb +29 -0
  145. data/templates/default/class/text/setup.rb +11 -0
  146. data/templates/default/class/text/subclasses.erb +5 -0
  147. data/templates/default/docstring/html/abstract.erb +4 -0
  148. data/templates/default/docstring/html/deprecated.erb +1 -0
  149. data/templates/default/docstring/html/index.erb +5 -0
  150. data/templates/default/docstring/html/note.erb +6 -0
  151. data/templates/default/docstring/html/text.erb +1 -0
  152. data/templates/default/docstring/html/todo.erb +6 -0
  153. data/templates/default/docstring/setup.rb +39 -0
  154. data/templates/default/docstring/text/abstract.erb +2 -0
  155. data/templates/default/docstring/text/deprecated.erb +2 -0
  156. data/templates/default/docstring/text/index.erb +2 -0
  157. data/templates/default/docstring/text/note.erb +4 -0
  158. data/templates/default/docstring/text/text.erb +1 -0
  159. data/templates/default/docstring/text/todo.erb +4 -0
  160. data/templates/default/fulldoc/html/css/common.css +1 -0
  161. data/templates/default/fulldoc/html/css/full_list.css +23 -0
  162. data/templates/default/fulldoc/html/css/style.css +261 -0
  163. data/templates/default/fulldoc/html/full_list.erb +36 -0
  164. data/templates/default/fulldoc/html/js/app.js +91 -0
  165. data/templates/default/fulldoc/html/js/full_list.js +39 -0
  166. data/templates/default/fulldoc/html/js/jquery.js +19 -0
  167. data/templates/default/fulldoc/html/setup.rb +86 -0
  168. data/templates/default/{uml → layout}/dot/header.erb +2 -2
  169. data/templates/default/layout/dot/setup.rb +14 -0
  170. data/templates/default/layout/html/breadcrumb.erb +11 -0
  171. data/templates/default/layout/html/footer.erb +5 -0
  172. data/templates/default/layout/html/headers.erb +13 -0
  173. data/templates/default/layout/html/index.erb +49 -0
  174. data/templates/default/layout/html/layout.erb +20 -0
  175. data/templates/default/layout/html/search.erb +5 -0
  176. data/templates/default/layout/html/setup.rb +58 -0
  177. data/templates/default/method/html/header.erb +14 -3
  178. data/templates/default/method/setup.rb +3 -0
  179. data/templates/default/method/text/header.erb +1 -1
  180. data/templates/default/method_details/html/header.erb +3 -0
  181. data/templates/default/method_details/html/method_signature.erb +17 -0
  182. data/templates/default/method_details/html/source.erb +10 -0
  183. data/templates/default/method_details/setup.rb +8 -0
  184. data/templates/default/method_details/text/header.erb +10 -0
  185. data/templates/default/method_details/text/method_signature.erb +12 -0
  186. data/templates/default/method_details/text/setup.rb +10 -0
  187. data/templates/default/module/dot/child.erb +1 -0
  188. data/templates/default/module/dot/dependencies.erb +3 -0
  189. data/templates/default/{uml/dot/subgraph.erb → module/dot/header.erb} +3 -3
  190. data/templates/default/{uml → module}/dot/info.erb +4 -4
  191. data/templates/default/module/dot/setup.rb +14 -0
  192. data/templates/default/module/html/attribute_details.erb +11 -0
  193. data/templates/default/module/html/attribute_summary.erb +8 -0
  194. data/templates/default/module/html/box_info.erb +32 -0
  195. data/templates/default/module/html/children.erb +8 -0
  196. data/templates/default/module/html/constant_summary.erb +13 -0
  197. data/templates/default/module/html/defines.erb +3 -0
  198. data/templates/default/module/html/header.erb +4 -4
  199. data/templates/default/module/html/inherited_constants.erb +8 -0
  200. data/templates/default/module/html/inherited_methods.erb +9 -0
  201. data/templates/default/module/html/item_summary.erb +20 -0
  202. data/templates/default/module/html/method_details_list.erb +8 -0
  203. data/templates/default/module/html/method_summary.erb +8 -0
  204. data/templates/default/module/html/methodmissing.erb +12 -0
  205. data/templates/default/module/html/pre_docstring.erb +1 -0
  206. data/templates/default/module/setup.rb +83 -0
  207. data/templates/default/module/text/children.erb +10 -0
  208. data/templates/default/module/text/class_meths_list.erb +8 -0
  209. data/templates/default/module/text/extends.erb +8 -0
  210. data/templates/default/module/text/header.erb +7 -0
  211. data/templates/default/module/text/includes.erb +8 -0
  212. data/templates/default/module/text/instance_meths_list.erb +8 -0
  213. data/templates/default/module/text/setup.rb +12 -0
  214. data/templates/default/root/dot/child.erb +3 -0
  215. data/templates/default/root/dot/setup.rb +5 -0
  216. data/templates/default/tags/html/example.erb +5 -16
  217. data/templates/default/tags/html/index.erb +3 -0
  218. data/templates/default/tags/html/option.erb +17 -20
  219. data/templates/default/tags/html/overload.erb +13 -0
  220. data/templates/default/tags/html/see.erb +5 -10
  221. data/templates/default/tags/html/tag.erb +20 -0
  222. data/templates/default/tags/setup.rb +50 -0
  223. data/templates/default/tags/text/example.erb +8 -10
  224. data/templates/default/tags/text/index.erb +1 -0
  225. data/templates/default/tags/text/option.erb +18 -3
  226. data/templates/default/tags/text/overload.erb +19 -0
  227. data/templates/default/tags/text/see.erb +8 -2
  228. data/templates/default/tags/text/tag.erb +13 -0
  229. metadata +142 -158
  230. data/bin/view_generator +0 -17
  231. data/docs/FAQ.markdown +0 -34
  232. data/docs/GENERATORS.markdown +0 -211
  233. data/lib/yard/generators/attributes_generator.rb +0 -22
  234. data/lib/yard/generators/base.rb +0 -305
  235. data/lib/yard/generators/class_generator.rb +0 -27
  236. data/lib/yard/generators/constants_generator.rb +0 -74
  237. data/lib/yard/generators/constructor_generator.rb +0 -25
  238. data/lib/yard/generators/deprecated_generator.rb +0 -15
  239. data/lib/yard/generators/docstring_generator.rb +0 -15
  240. data/lib/yard/generators/full_doc_generator.rb +0 -127
  241. data/lib/yard/generators/helpers/html_helper.rb +0 -196
  242. data/lib/yard/generators/helpers/html_syntax_highlight_helper.rb +0 -49
  243. data/lib/yard/generators/helpers/uml_helper.rb +0 -16
  244. data/lib/yard/generators/inheritance_generator.rb +0 -16
  245. data/lib/yard/generators/method_details_generator.rb +0 -18
  246. data/lib/yard/generators/method_generator.rb +0 -43
  247. data/lib/yard/generators/method_listing_generator.rb +0 -105
  248. data/lib/yard/generators/method_missing_generator.rb +0 -25
  249. data/lib/yard/generators/method_signature_generator.rb +0 -19
  250. data/lib/yard/generators/method_summary_generator.rb +0 -21
  251. data/lib/yard/generators/mixins_generator.rb +0 -21
  252. data/lib/yard/generators/module_generator.rb +0 -23
  253. data/lib/yard/generators/overloads_generator.rb +0 -20
  254. data/lib/yard/generators/quick_doc_generator.rb +0 -25
  255. data/lib/yard/generators/root_generator.rb +0 -32
  256. data/lib/yard/generators/source_generator.rb +0 -11
  257. data/lib/yard/generators/tags_generator.rb +0 -99
  258. data/lib/yard/generators/uml_generator.rb +0 -102
  259. data/lib/yard/generators/visibility_group_generator.rb +0 -26
  260. data/spec/generators/base_spec.rb +0 -64
  261. data/spec/generators/full_doc_generator_spec.rb +0 -29
  262. data/spec/generators/helpers/base_helper_spec.rb +0 -15
  263. data/spec/generators/quick_doc_generator_spec.rb +0 -13
  264. data/templates/default/attributes/html/header.erb +0 -47
  265. data/templates/default/attributes/text/header.erb +0 -10
  266. data/templates/default/class/html/header.erb +0 -4
  267. data/templates/default/constants/html/constants.erb +0 -9
  268. data/templates/default/constants/html/header.erb +0 -3
  269. data/templates/default/constants/html/included.erb +0 -9
  270. data/templates/default/constants/html/inherited.erb +0 -9
  271. data/templates/default/constructor/html/header.erb +0 -10
  272. data/templates/default/deprecated/html/main.erb +0 -6
  273. data/templates/default/deprecated/text/main.erb +0 -3
  274. data/templates/default/docstring/html/main.erb +0 -3
  275. data/templates/default/docstring/text/main.erb +0 -3
  276. data/templates/default/fulldoc/html/all_files.erb +0 -19
  277. data/templates/default/fulldoc/html/all_methods.erb +0 -26
  278. data/templates/default/fulldoc/html/all_namespaces.erb +0 -22
  279. data/templates/default/fulldoc/html/app.js +0 -18
  280. data/templates/default/fulldoc/html/custom.css +0 -1
  281. data/templates/default/fulldoc/html/file.erb +0 -16
  282. data/templates/default/fulldoc/html/footer.erb +0 -5
  283. data/templates/default/fulldoc/html/header.erb +0 -16
  284. data/templates/default/fulldoc/html/html_head.erb +0 -4
  285. data/templates/default/fulldoc/html/index.erb +0 -19
  286. data/templates/default/fulldoc/html/jquery.js +0 -11
  287. data/templates/default/fulldoc/html/style.css +0 -81
  288. data/templates/default/fulldoc/html/syntax_highlight.css +0 -24
  289. data/templates/default/inheritance/html/header.erb +0 -8
  290. data/templates/default/inheritance/text/header.erb +0 -3
  291. data/templates/default/method/html/aliases.erb +0 -6
  292. data/templates/default/method/html/title.erb +0 -3
  293. data/templates/default/method/text/title.erb +0 -1
  294. data/templates/default/methoddetails/html/header.erb +0 -8
  295. data/templates/default/methoddetails/html/method_header.erb +0 -3
  296. data/templates/default/methodmissing/html/header.erb +0 -12
  297. data/templates/default/methodsignature/html/main.erb +0 -10
  298. data/templates/default/methodsignature/text/main.erb +0 -8
  299. data/templates/default/methodsummary/html/header.erb +0 -5
  300. data/templates/default/methodsummary/html/included.erb +0 -9
  301. data/templates/default/methodsummary/html/inherited.erb +0 -9
  302. data/templates/default/methodsummary/html/summary.erb +0 -29
  303. data/templates/default/methodsummary/text/header.erb +0 -5
  304. data/templates/default/methodsummary/text/included.erb +0 -0
  305. data/templates/default/methodsummary/text/inherited.erb +0 -0
  306. data/templates/default/methodsummary/text/summary.erb +0 -6
  307. data/templates/default/mixins/html/header.erb +0 -4
  308. data/templates/default/overloads/html/header.erb +0 -8
  309. data/templates/default/overloads/text/header.erb +0 -8
  310. data/templates/default/quickdoc/html/header.erb +0 -15
  311. data/templates/default/quickdoc/text/header.erb +0 -12
  312. data/templates/default/root/html/header.erb +0 -4
  313. data/templates/default/source/html/main.erb +0 -15
  314. data/templates/default/source/text/main.erb +0 -4
  315. data/templates/default/tags/html/header.erb +0 -4
  316. data/templates/default/tags/html/param.erb +0 -21
  317. data/templates/default/tags/html/tags.erb +0 -23
  318. data/templates/default/tags/html/todo.erb +0 -8
  319. data/templates/default/tags/text/header.erb +0 -3
  320. data/templates/default/tags/text/param.erb +0 -9
  321. data/templates/default/tags/text/tags.erb +0 -7
  322. data/templates/default/uml/dot/child.erb +0 -1
  323. data/templates/default/uml/dot/dependencies.erb +0 -10
  324. data/templates/default/uml/dot/superclasses.erb +0 -9
  325. data/templates/default/uml/dot/unknown.erb +0 -3
  326. data/templates/default/uml/dot/unknown_child.erb +0 -1
  327. data/templates/default/visibilitygroup/html/header.erb +0 -6
  328. data/templates/javadoc/attributes/html/header.erb +0 -16
  329. data/templates/javadoc/class/html/header.erb +0 -4
  330. data/templates/javadoc/constants/html/constants.erb +0 -9
  331. data/templates/javadoc/constants/html/header.erb +0 -3
  332. data/templates/javadoc/constants/html/included.erb +0 -12
  333. data/templates/javadoc/constants/html/inherited.erb +0 -12
  334. data/templates/javadoc/constructor/html/header.erb +0 -10
  335. data/templates/javadoc/deprecated/html/main.erb +0 -0
  336. data/templates/javadoc/docstring/html/main.erb +0 -6
  337. data/templates/javadoc/fulldoc/html/all_methods.erb +0 -25
  338. data/templates/javadoc/fulldoc/html/all_namespaces.erb +0 -19
  339. data/templates/javadoc/fulldoc/html/app.js +0 -18
  340. data/templates/javadoc/fulldoc/html/header.erb +0 -15
  341. data/templates/javadoc/fulldoc/html/html_head.erb +0 -3
  342. data/templates/javadoc/fulldoc/html/index.erb +0 -18
  343. data/templates/javadoc/fulldoc/html/jquery.js +0 -11
  344. data/templates/javadoc/fulldoc/html/readme.erb +0 -15
  345. data/templates/javadoc/fulldoc/html/style.css +0 -22
  346. data/templates/javadoc/fulldoc/html/syntax_highlight.css +0 -21
  347. data/templates/javadoc/inheritance/html/header.erb +0 -6
  348. data/templates/javadoc/method/html/aliases.erb +0 -6
  349. data/templates/javadoc/method/html/header.erb +0 -4
  350. data/templates/javadoc/method/html/title.erb +0 -4
  351. data/templates/javadoc/methoddetails/html/header.erb +0 -8
  352. data/templates/javadoc/methoddetails/html/method_header.erb +0 -0
  353. data/templates/javadoc/methodmissing/html/header.erb +0 -12
  354. data/templates/javadoc/methodsignature/html/main.erb +0 -8
  355. data/templates/javadoc/methodsummary/html/header.erb +0 -5
  356. data/templates/javadoc/methodsummary/html/included.erb +0 -12
  357. data/templates/javadoc/methodsummary/html/inherited.erb +0 -12
  358. data/templates/javadoc/methodsummary/html/summary.erb +0 -25
  359. data/templates/javadoc/mixins/html/header.erb +0 -5
  360. data/templates/javadoc/module/html/header.erb +0 -4
  361. data/templates/javadoc/source/html/main.erb +0 -15
  362. data/templates/javadoc/tags/html/header.erb +0 -5
  363. data/templates/javadoc/tags/html/see.erb +0 -8
  364. data/templates/javadoc/tags/html/tags.erb +0 -19
  365. data/templates/javadoc/visibilitygroup/html/header.erb +0 -5
File without changes
@@ -4,14 +4,14 @@ Handlers Architecture
4
4
  Handlers allow the processing of parsed source code. Handling is done after
5
5
  parsing to abstract away the implementation details of lexical and semantic
6
6
  analysis on source and to only deal with the logic regarding recognizing
7
- source statements as {file:CODE_OBJECTS.markdown code objects}.
7
+ source statements as {file:CodeObjects.md code objects}.
8
8
 
9
9
  ![Handlers Architecture Class Diagram](images/handlers-class-diagram.png)
10
10
 
11
11
  The Pipeline
12
12
  ------------
13
13
 
14
- After the {file:PARSER.markdown parser component} finishes analyzing the
14
+ After the {file:Parser.md parser component} finishes analyzing the
15
15
  source, it is handed off for post-processing to the {YARD::Handlers::Processor}
16
16
  class, which is responsible for traversing the set of statements given by
17
17
  the parser and delegating them to matching handlers. Handlers match when the
@@ -51,7 +51,7 @@ class method. A very simple handler that handles a module definition would be:
51
51
  end
52
52
 
53
53
  For details on what nodes are, and what node types are, see the
54
- {file:PARSER.markdown parser architecture document}.
54
+ {file:Parser.md parser architecture document}.
55
55
 
56
56
  In this case the node type being handled is the `:module` type. More than one
57
57
  node type or `handles` declarations may describe a single handler, for instance,
@@ -89,7 +89,7 @@ Creating a new Code Object
89
89
  --------------------------
90
90
 
91
91
  Usually (but not always) handling is performed to create new code objects to add
92
- to the registry (for information about code objects, see {file:CODE_OBJECTS.markdown this document}).
92
+ to the registry (for information about code objects, see {file:CodeObjects.md this document}).
93
93
  Code objects should simply be created and added to the existing `namespace`. This
94
94
  will be enough to add them to the registry. There is also a convenience
95
95
  {YARD::Handlers::Base#register register} method which quickly sets standard attributed
@@ -132,7 +132,7 @@ Because the legacy handler uses the legacy parser and therefore a different kind
132
132
  of AST, there are subtle differences in the handler API. Most importantly, the
133
133
  `handles` method usually deals with either lexical tokens or source code as a string
134
134
  or RegExp object. The statement object, similarly, is made up of lexical tokens instead
135
- of semantically parsed nodes (this is described in the {file:PARSER.markdown parser document}).
135
+ of semantically parsed nodes (this is described in the {file:Parser.md parser document}).
136
136
 
137
137
  The module example above can be rewritten as a legacy handler as follows:
138
138
 
@@ -8,7 +8,7 @@ that tools like RDoc do not do. These components are:
8
8
 
9
9
  * [Code Parsing & Processing Component](#parsing)
10
10
  * [Data Storage Component](#storage)
11
- * [Post Processing & Output Generation Component](#generators)
11
+ * [Post Processing & Templating System](#templates)
12
12
 
13
13
  This separation is a major goal of the project, and means that YARD is not *just*
14
14
  a tool to generate HTML output. The expectation is that any subset of YARD's
@@ -30,10 +30,10 @@ This component is made up of four sub-components, each of which have separate
30
30
  tasks during the data gathering process (*note: the tag architecture is not*
31
31
  *shown in the class diagram*). These sub-components are:
32
32
 
33
- * {file:PARSER.markdown Parser Architecture}
34
- * {file:HANDLERS.markdown Handler Architecture}
35
- * {file:CODE_OBJECTS.markdown Code Object Architecture}
36
- * {file:TAGS.markdown Tag Architecture}
33
+ * {file:Parser.md Parser Architecture}
34
+ * {file:Handlers.md Handler Architecture}
35
+ * {file:CodeObjects.md Code Object Architecture}
36
+ * {file:Tags.md Tag Architecture}
37
37
 
38
38
  The parser component reads source files and converts it into a set of statements
39
39
  which the handlers then process, creating code objects which in turn create tags
@@ -50,15 +50,11 @@ is the centralized repository for all data being parsed, stored and accessed. Th
50
50
  are future plans to improve this storage mechanism to be backend agnostic and allow
51
51
  for more robust storage.
52
52
 
53
- <a name="generators"></a>
54
- Post Processing & Output Generation Component
55
- ---------------------------------------------
53
+ <a name="templates"></a>
54
+ Post Processing & Templating System
55
+ -----------------------------------
56
56
 
57
57
  This component handles processing of objects from the registry through a templating
58
58
  engine that allows output to a variety of formats. Practically speaking, this is
59
59
  where templates can be implemented to change the design, output or structure of
60
- the data. The next release, 0.2.4, will see a significant change in the design of
61
- this component, so documentation might be sparse for now.
62
-
63
- The current design is documented in the {file:GENERATORS.markdown Generators Architecture}
64
- document.
60
+ the data. See {file:Templates.md Templates Architecture} for a complete overview.
@@ -3,7 +3,7 @@ Parser Architecture
3
3
 
4
4
  The parser component of YARD is the first component in the data processing pipeline
5
5
  that runs before any handling is done on the source. The parser is meant to translate
6
- the source into a set of statements that can be understood by the {file:HANDLERS.markdown Handlers}
6
+ the source into a set of statements that can be understood by the {file:Handlers.md Handlers}
7
7
  that run immediately afterwards.
8
8
 
9
9
  The important classes are described in the class diagram of the entire parser
@@ -19,7 +19,7 @@ class.
19
19
  Accessing Tag Information
20
20
  -------------------------
21
21
 
22
- Tag metadata is added when a {YARD::Docstring} is added to a {file:CODE_OBJECTS.markdown code object}
22
+ Tag metadata is added when a {YARD::Docstring} is added to a {file:CodeObjects.md code object}
23
23
  using the {YARD::CodeObjects::Base#docstring=} attribute. In addition to adding
24
24
  conventional comments, tags are parsed and associated with the object. The easiest
25
25
  way to access tags on an object is to use the {YARD::CodeObjects::Base#tag} and `#tags`
@@ -0,0 +1,286 @@
1
+ Templates Architecture
2
+ ======================
3
+
4
+ Templates are the main component in the output rendering process of YARD,
5
+ which is invoked when conventional HTML/text output needs to be rendered
6
+ for a set of code objects.
7
+
8
+ Design Goals
9
+ ------------
10
+
11
+ The general design attempts to be as abstracted from actual content and templates
12
+ as possible. Unlike RDoc which uses one file to describe the entire template,
13
+ YARD splits up the rendering of code objects into small components, allowing
14
+ template modification for smaller subsets of a full template without having to
15
+ duplicate the entire template itself. This is necessary because of YARD's support
16
+ for plugins. YARD is designed for extensibility by external plugins, and because
17
+ of this, no one plugin can be responsible for the entire template because no
18
+ one plugin knows about the other plugins being used. For instance, if an RSpec
19
+ plugin was added to support and document specifications in class templates,
20
+ this information would need to be transparently added to the template to work
21
+ in conjunction with any other plugin that performed similar template modifications.
22
+ The design goals can be summarized as follows:
23
+
24
+ 1. Output should be able to be rendered for any arbitrary format with little
25
+ modification to YARD's source code. The addition of extra templates should
26
+ be sufficient.
27
+ 2. The output rendered for an object should independently rendered data
28
+ from arbitrary sources. These independent components are called "sections".
29
+ 3. Sections should be able to be inserted into any object without affecting
30
+ any existing sections in the document. This allows for easy modification
31
+ of templates by plugins.
32
+
33
+ Templates
34
+ ---------
35
+
36
+ Template modules are the objects used to orchestrate the design goals listed
37
+ above. Specifically, they organize the sections and render the template contents
38
+ depending on the format.
39
+
40
+ Engine
41
+ ------
42
+
43
+ The Engine class orchestrates the creation and rendering of Template modules and
44
+ handles serialization or specific rendering scenarios (like HTML). To create
45
+ a template, use the {YARD::Templates::Engine.template template} method. The two most
46
+ common methods used to initiate output are the {YARD::Templates::Engine.render render}
47
+ and {YARD::Templates::Engine.generate generate} methods which generate and
48
+ optionally serialize output to a file. The latter, `#generate`, is used
49
+ specially to generate HTML documentation and copy over assets that may be
50
+ needed. For instance, an object may be rendered with:
51
+
52
+ YARD::Templates::Engine.render(:object => myobject)
53
+
54
+ A set of objects may be rendered into HTML documentation by using:
55
+
56
+ # all_objects is an array of module and class objects
57
+ # options includes a :serializer key to copy output to the file system
58
+ YARD::Templates::Engine.generate(all_objects, options)
59
+
60
+ Note that these methods should not be called directly. The {YARD::CodeObjects::Base}
61
+ class has a {YARD::CodeObjects::Base#format #format} helper method to render an
62
+ object. For instance, the above render example is equivalent to the simple
63
+ call `myobject.format`. The `generate` method is a special kind of render
64
+ and is called from the {YARD::CLI::Yardoc} command line utility.
65
+
66
+ Template Options
67
+ ----------------
68
+
69
+ A template keeps state when it is rendering output. This state is kept in
70
+ an options hash which is initially passed to it during instantiation. Some
71
+ default options set the template style (`:template`), the output format (`:format`),
72
+ and the serializer to use (`:serializer`). This options hash is modifiable
73
+ from all methods seen above. For example, initializing a template to output as
74
+ HTML instead of text can be done as follows:
75
+
76
+ myobject.format(:format => :html)
77
+
78
+ Serializer
79
+ ----------
80
+
81
+ This class abstracts the logic involved in deciding how to serialize data to
82
+ the expected endpoint. For instance, there is both a {YARD::Serializers::StdoutSerializer StdoutSerializer}
83
+ and {YARD::Serializers::FileSystemSerializer FileSystemSerializer} class for
84
+ outputting to console or to a file respectively. When endpoints with locations
85
+ are used (like files or URLs), the serializer implements the {YARD::Serializers::Base#serialized_path #serialized_path}
86
+ method. This allows the translation from a code object to its path at the endpoint,
87
+ which enables inter-document linking.
88
+
89
+ Rendered objects are automatically serialized using the object if present,
90
+ otherwise the rendered object is returned as a string to its parent. Nested
91
+ Templates automatically set the serializer to nil so that they return
92
+ as a String to their parent.
93
+
94
+ Creating a Template
95
+ -------------------
96
+
97
+ Templates are represented by a directory inside the {YARD::Templates::Engine.template_paths}
98
+ on disk. A standard template directory looks like the following tree:
99
+
100
+ (Assuming templates/ is a template path)
101
+ templates
102
+ `-- default
103
+ |-- class
104
+ | |-- dot
105
+ | | |-- setup.rb
106
+ | | `-- superklass.erb
107
+ | |-- html
108
+ | | |-- constructor_details.erb
109
+ | | |-- setup.rb
110
+ | | `-- subclasses.erb
111
+ | |-- setup.rb
112
+ | `-- text
113
+ | |-- setup.rb
114
+ | `-- subclasses.erb
115
+ |-- docstring
116
+ | |-- html
117
+ | | |-- abstract.erb
118
+ | | |-- deprecated.erb
119
+ | | |-- index.erb
120
+ | | `-- text.erb
121
+ | |-- setup.rb
122
+ | `-- text
123
+ | |-- abstract.erb
124
+ | |-- deprecated.erb
125
+ | |-- index.erb
126
+ | `-- text.erb
127
+
128
+ The path `default` refers to the template style (:template key in options hash)
129
+ and the directories at the next level (such as `class`) refer to template
130
+ `:type` (options hash key) for a template. The next directory refers to the
131
+ output format being used defined by the `:format` template option.
132
+
133
+ As we saw in the above example, the format option can be set to `:html`, which
134
+ would use the `html/` directory instead of `text/`. Finally, the individual .erb
135
+ files are the sections that make up the template.
136
+
137
+ Note that the subdirectory `html/` is also its own "template" that inherits
138
+ from the parent directory. We will see more on this later.
139
+
140
+ setup.rb
141
+ --------
142
+
143
+ Every template should have at least one `setup.rb` file that defines the
144
+ {YARD::Templates::Template#init #init} method to set the
145
+ {YARD::Templates::Template#sections #sections} used by the template. If
146
+ a setup.rb is not defined in the template itself, there should be a template
147
+ that is inherited (via parent directory or explcitly) that sets the sections
148
+ on a newly created template.
149
+
150
+ A standard setup.rb file looks like:
151
+
152
+ def init
153
+ sections :section1, :section2, :section3
154
+ end
155
+
156
+ Sections
157
+ --------
158
+
159
+ Sections are smaller components that correlate to template
160
+ fragments. Practically speaking, a section can either be a template fragment
161
+ (a conventional .erb file or other supported templating language), a method
162
+ (which returns a String) or another {YARD::Templates::Template} (which in turn has its own
163
+ list of sections).
164
+
165
+ Nested Sections
166
+ ---------------
167
+
168
+ Sections often require the ability to encapsulate a set of sub-sections in markup
169
+ (HTML, for instance). Rather than use heavier Template subclass objects, a more
170
+ lightweight solution is to nest a set of sub-sections as a list that follows
171
+ a section, for example:
172
+
173
+ def init
174
+ sections :header, [:section_a, :section_b]
175
+ end
176
+
177
+ The above example nests `section_a` and `section_b` within the `header` section.
178
+ Practically speaking, these sections can be placed in the result by `yield`ing
179
+ to them. A sample header.erb template might contain:
180
+
181
+ <h2>Header</h2>
182
+ <div id="contents">
183
+ <%= yieldall %>
184
+ </div>
185
+
186
+ This template code would place the output of `section_a` and `section_b` within
187
+ the above div element. Using `yieldall`, we can also change the object that is being
188
+ rendered. For example, we may want to yield the first method of the class.
189
+ We can do this like so:
190
+
191
+ <h2>First method</h2>
192
+ <%= yieldall :object => object.meths.first %>
193
+
194
+ This would run the nested sections for the method object instead of the class.
195
+
196
+ Note that `yieldall` yields to all subsections, whereas `yield` will yield
197
+ to each individually (in order) until there are no more left to yield to.
198
+ In the vast majority of cases, you'd want to use `yieldall`, since `yield`
199
+ makes it hard for users to override your template.
200
+
201
+ Inheriting Templates
202
+ --------------------
203
+
204
+ Parent directory templates are automatically inherited (or mixed in, to be
205
+ more accurate) by the current template. This means that the 'default/class/html'
206
+ template automatically inherits from 'default/class'. This also means that anything
207
+ defined in 'default/class/setup.rb' can be overridden by 'default/class/html/setup.rb'.
208
+
209
+ Since the Template module is a module, and not a class, they can be mixed in
210
+ explicitly (via include/extend) from other templates, which allows templates
211
+ to share erb files or helper logic. The 'default/class' template explicitly
212
+ mixes in the 'default/module' template, since it uses much of the same sections.
213
+ This is done with the helper {YARD::Templates::Template::ClassMethods#T T} method, which
214
+ is simply a shorthand for {YARD::Templates::Engine.template Engine.template}.
215
+ It can then override (using standard inheritance) the sections from the module
216
+ template and insert sections pertaining to classes. This is one of the design
217
+ goals described above.
218
+
219
+ For instance, the first line in `default/class/html/setup.rb` is:
220
+
221
+ include T('default/module/html')
222
+
223
+ This includes the 'default/module/html', which means it also includes 'default/module'
224
+ by extension. This allows class to make use of any of module's erb files.
225
+
226
+ Inserting Sections
227
+ ------------------
228
+
229
+ The ability to insert sections was mentioned above. The class template, for
230
+ instance, will modify the #init method to insert class specific sections:
231
+
232
+ def init
233
+ super
234
+ sections.place(:subclasses).before(:children)
235
+ sections.delete(:children)
236
+ sections.place([:constructor_details, [T('method_details')]]).before(:methodmissing)
237
+ end
238
+
239
+ Observe how sections has been modified after the super method was called (the
240
+ super method would have been defined in `default/module/setup.rb`). The
241
+ custom method {Array#place} is added by YARD to allow sections to be inserted
242
+ before or after another section by it's given name rather than index. This
243
+ allows the overriding of templates in a way that does not depend on where
244
+ the section is located (since it may have been overriden by another module).
245
+
246
+ Overriding Templates by Registering a Template Path
247
+ ---------------------------------------------------
248
+
249
+ Inheriting templates explicitly is useful when creating a customized template
250
+ that wants to take advantage of code re-use. However, most users who want
251
+ to customize YARD templates will want to override existing behaviour without
252
+ creating a template from scratch.
253
+
254
+ YARD solves this problem by allowing other template paths to be registered.
255
+ Because template modules are represented by a relative path such as 'default/class',
256
+ they can be found within any of the registered template paths. A new template
257
+ path is registered as:
258
+
259
+ YARD::Templates::Engine.register_template_path '/path/to/mytemplates'
260
+
261
+ At this point, any time the 'default/class' template is loaded, the template
262
+ will first be looked for inside the newly registered template path. If found,
263
+ it will be used as the template module, with the modules from the other
264
+ template paths implicitly mixed in.
265
+
266
+ Therefore, by using the same directory structure as a builtin YARD template,
267
+ a user can customize or override individual templates as if the old ones were
268
+ inherited. A real world example would further modify the 'default/class' template
269
+ seen above by creating such a path in our '/path/to/mytemplates' custom template
270
+ path:
271
+
272
+ /path/to/mytemplates/:
273
+ |-- class
274
+ | |-- html
275
+ | | |-- customsection.erb
276
+ | |-- setup.rb
277
+
278
+ The `setup.rb` file would look like:
279
+
280
+ def init
281
+ super
282
+ sections.push :customsection
283
+ end
284
+
285
+ Now, when a class object is formatted as HTML, our customsection.erb will be
286
+ appended to the rendered data.
@@ -1,5 +1,85 @@
1
- YARD: What's New in 0.2.3?
2
- ==========================
1
+ What's New in 0.4.x?
2
+ ====================
3
+
4
+ 1. **New templating engine and templates**
5
+ 2. **yardoc `--query` argument**
6
+ 3. **Greatly expanded API documentation**
7
+ 4. **New plugin support**
8
+ 5. **New tags (@abstract, @private)**
9
+ 6. **Default rake task is now `rake yard`**
10
+
11
+ New templating engine and templates
12
+ -----------------------------------
13
+
14
+ The templates were redesigned, most notably removing the ugly frameset, adding
15
+ search to the class/method lists, simplifying the layout and making things
16
+ generally prettier. You should also notice that more tags are now visible in
17
+ the templates such as @todo, the new @abstract and @note tags and some others
18
+ that existed but were previously omitted from the generated documentation.
19
+
20
+ There is also a new templating engine (based on the tadpole templating library)
21
+ to allow for much more user customization. You can read about it in
22
+ {file:Templates.md}.
23
+
24
+ yardoc `--query` argument
25
+ -------------------------
26
+
27
+ The yardoc command-line tool now supports queries to select which classes,
28
+ modules or methods to include in documentation based on their data or meta-data.
29
+ For instance, you can now generate documentation for your "public" API only by
30
+ adding "@api public" to each of your public API methods/classes and using
31
+ the following argument:
32
+
33
+ --query '@api.text == "public"'
34
+
35
+ More information on queries is in the {file:README.md}.
36
+
37
+ Greatly expanded API documentation
38
+ ----------------------------------
39
+
40
+ Last release focused on many how-to and architecture documents to explain
41
+ the design of YARD, but many of the actual API classes/methods were still
42
+ left undocumented. This release marks a focus on getting YARD's own documentation
43
+ up to par so that it can serve as an official reference on the recommended
44
+ conventions to use when documenting code.
45
+
46
+ New plugin support
47
+ ------------------
48
+
49
+ YARD now supports loading of plugins via RubyGems. Any gem named `yard-*` or
50
+ `yard_*` will now be loaded when YARD starts up. Note that the '-' separator
51
+ is the recommended naming scheme.
52
+
53
+ To ignore plugins, add the gem names to `~/.yard/ignored_plugins` on separate
54
+ lines (or separated by whitespace).
55
+
56
+ New tags (@abstract, @private)
57
+ ------------------------------
58
+
59
+ Two new tags were added to the list of builtin meta-tags in YARD. `@abstract`
60
+ marks a class/module/method as abstract while `@private` marks an object
61
+ as "private". The latter tag is unsed in situations where an object is public
62
+ due to Ruby's own visibility limitations (constants, classes and modules
63
+ can never be private) but not actually part of your public API. You should
64
+ use this tag sparingly, as it is not meant to be an equivalent to RDoc's
65
+ `:nodoc:` tag. Remember, YARD recommends documenting private objects too.
66
+ This tag exists so that you can create a query (`--query !@private`) to
67
+ ignore all of these private objects in your documentation. You can also
68
+ use the new `--no-private` switch, which is a shortcut to the afformentioned
69
+ query. You can read more about the new tags in the {file:GettingStarted.md}
70
+ guide.
71
+
72
+ Default rake task is now `rake yard`
73
+ ------------------------------------
74
+
75
+ Not a big change, but anyone using the default "rake yardoc" task should
76
+ update their scripts:
77
+
78
+ [http://github.com/lsegal/yard/commit/ad38a68dd73898b06bd5d0a1912b7d815878fae0](http://github.com/lsegal/yard/commit/ad38a68dd73898b06bd5d0a1912b7d815878fae0)
79
+
80
+
81
+ What's New in 0.2.3.x?
82
+ ======================
3
83
 
4
84
  1. **Full Ruby 1.9 support**
5
85
  2. **New parser code and handler API for 1.9**