hyper-pro-gem 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. checksums.yaml +7 -0
  2. data/hyper-pro-gem.gemspec +12 -0
  3. data/yard-0.9.44/CHANGELOG.md +983 -0
  4. data/yard-0.9.44/LEGAL +94 -0
  5. data/yard-0.9.44/LICENSE +22 -0
  6. data/yard-0.9.44/README.md +329 -0
  7. data/yard-0.9.44/bin/yard +13 -0
  8. data/yard-0.9.44/bin/yardoc +13 -0
  9. data/yard-0.9.44/bin/yri +13 -0
  10. data/yard-0.9.44/docs/CodeObjects.md +115 -0
  11. data/yard-0.9.44/docs/GettingStarted.md +705 -0
  12. data/yard-0.9.44/docs/Handlers.md +152 -0
  13. data/yard-0.9.44/docs/Overview.md +61 -0
  14. data/yard-0.9.44/docs/Parser.md +166 -0
  15. data/yard-0.9.44/docs/Tags.md +304 -0
  16. data/yard-0.9.44/docs/TagsArch.md +123 -0
  17. data/yard-0.9.44/docs/Templates.md +497 -0
  18. data/yard-0.9.44/docs/WhatsNew.md +1297 -0
  19. data/yard-0.9.44/docs/images/code-objects-class-diagram.png +0 -0
  20. data/yard-0.9.44/docs/images/handlers-class-diagram.png +0 -0
  21. data/yard-0.9.44/docs/images/overview-class-diagram.png +0 -0
  22. data/yard-0.9.44/docs/images/parser-class-diagram.png +0 -0
  23. data/yard-0.9.44/docs/images/tags-class-diagram.png +0 -0
  24. data/yard-0.9.44/docs/templates/default/fulldoc/html/full_list_tag.erb +9 -0
  25. data/yard-0.9.44/docs/templates/default/fulldoc/html/setup.rb +6 -0
  26. data/yard-0.9.44/docs/templates/default/layout/html/setup.rb +9 -0
  27. data/yard-0.9.44/docs/templates/default/layout/html/tag_list.erb +11 -0
  28. data/yard-0.9.44/docs/templates/default/yard_tags/html/list.erb +18 -0
  29. data/yard-0.9.44/docs/templates/default/yard_tags/html/setup.rb +26 -0
  30. data/yard-0.9.44/docs/templates/plugin.rb +70 -0
  31. data/yard-0.9.44/lib/rubygems_plugin.rb +9 -0
  32. data/yard-0.9.44/lib/yard/autoload.rb +328 -0
  33. data/yard-0.9.44/lib/yard/cli/command.rb +85 -0
  34. data/yard-0.9.44/lib/yard/cli/command_parser.rb +93 -0
  35. data/yard-0.9.44/lib/yard/cli/config.rb +198 -0
  36. data/yard-0.9.44/lib/yard/cli/diff.rb +278 -0
  37. data/yard-0.9.44/lib/yard/cli/display.rb +69 -0
  38. data/yard-0.9.44/lib/yard/cli/gems.rb +84 -0
  39. data/yard-0.9.44/lib/yard/cli/graph.rb +125 -0
  40. data/yard-0.9.44/lib/yard/cli/help.rb +20 -0
  41. data/yard-0.9.44/lib/yard/cli/i18n.rb +70 -0
  42. data/yard-0.9.44/lib/yard/cli/list.rb +23 -0
  43. data/yard-0.9.44/lib/yard/cli/markup_types.rb +32 -0
  44. data/yard-0.9.44/lib/yard/cli/server.rb +266 -0
  45. data/yard-0.9.44/lib/yard/cli/stats.rb +234 -0
  46. data/yard-0.9.44/lib/yard/cli/yardoc.rb +791 -0
  47. data/yard-0.9.44/lib/yard/cli/yardopts_command.rb +110 -0
  48. data/yard-0.9.44/lib/yard/cli/yri.rb +215 -0
  49. data/yard-0.9.44/lib/yard/code_objects/base.rb +626 -0
  50. data/yard-0.9.44/lib/yard/code_objects/class_object.rb +146 -0
  51. data/yard-0.9.44/lib/yard/code_objects/class_variable_object.rb +11 -0
  52. data/yard-0.9.44/lib/yard/code_objects/constant_object.rb +16 -0
  53. data/yard-0.9.44/lib/yard/code_objects/extended_method_object.rb +24 -0
  54. data/yard-0.9.44/lib/yard/code_objects/extra_file_object.rb +135 -0
  55. data/yard-0.9.44/lib/yard/code_objects/macro_object.rb +171 -0
  56. data/yard-0.9.44/lib/yard/code_objects/method_object.rb +196 -0
  57. data/yard-0.9.44/lib/yard/code_objects/module_object.rb +21 -0
  58. data/yard-0.9.44/lib/yard/code_objects/namespace_mapper.rb +141 -0
  59. data/yard-0.9.44/lib/yard/code_objects/namespace_object.rb +200 -0
  60. data/yard-0.9.44/lib/yard/code_objects/proxy.rb +245 -0
  61. data/yard-0.9.44/lib/yard/code_objects/root_object.rb +19 -0
  62. data/yard-0.9.44/lib/yard/config.rb +274 -0
  63. data/yard-0.9.44/lib/yard/core_ext/array.rb +16 -0
  64. data/yard-0.9.44/lib/yard/core_ext/file.rb +69 -0
  65. data/yard-0.9.44/lib/yard/core_ext/hash.rb +16 -0
  66. data/yard-0.9.44/lib/yard/core_ext/insertion.rb +63 -0
  67. data/yard-0.9.44/lib/yard/core_ext/module.rb +11 -0
  68. data/yard-0.9.44/lib/yard/core_ext/string.rb +68 -0
  69. data/yard-0.9.44/lib/yard/core_ext/symbol_hash.rb +75 -0
  70. data/yard-0.9.44/lib/yard/docstring.rb +386 -0
  71. data/yard-0.9.44/lib/yard/docstring_parser.rb +344 -0
  72. data/yard-0.9.44/lib/yard/gem_index.rb +29 -0
  73. data/yard-0.9.44/lib/yard/globals.rb +22 -0
  74. data/yard-0.9.44/lib/yard/handlers/base.rb +617 -0
  75. data/yard-0.9.44/lib/yard/handlers/c/alias_handler.rb +16 -0
  76. data/yard-0.9.44/lib/yard/handlers/c/attribute_handler.rb +13 -0
  77. data/yard-0.9.44/lib/yard/handlers/c/base.rb +164 -0
  78. data/yard-0.9.44/lib/yard/handlers/c/class_handler.rb +27 -0
  79. data/yard-0.9.44/lib/yard/handlers/c/constant_handler.rb +13 -0
  80. data/yard-0.9.44/lib/yard/handlers/c/handler_methods.rb +212 -0
  81. data/yard-0.9.44/lib/yard/handlers/c/init_handler.rb +20 -0
  82. data/yard-0.9.44/lib/yard/handlers/c/method_handler.rb +45 -0
  83. data/yard-0.9.44/lib/yard/handlers/c/mixin_handler.rb +21 -0
  84. data/yard-0.9.44/lib/yard/handlers/c/module_handler.rb +17 -0
  85. data/yard-0.9.44/lib/yard/handlers/c/override_comment_handler.rb +31 -0
  86. data/yard-0.9.44/lib/yard/handlers/c/path_handler.rb +11 -0
  87. data/yard-0.9.44/lib/yard/handlers/c/struct_handler.rb +13 -0
  88. data/yard-0.9.44/lib/yard/handlers/c/symbol_handler.rb +8 -0
  89. data/yard-0.9.44/lib/yard/handlers/common/method_handler.rb +19 -0
  90. data/yard-0.9.44/lib/yard/handlers/processor.rb +200 -0
  91. data/yard-0.9.44/lib/yard/handlers/rbs/attribute_handler.rb +79 -0
  92. data/yard-0.9.44/lib/yard/handlers/rbs/base.rb +38 -0
  93. data/yard-0.9.44/lib/yard/handlers/rbs/constant_handler.rb +18 -0
  94. data/yard-0.9.44/lib/yard/handlers/rbs/method_handler.rb +327 -0
  95. data/yard-0.9.44/lib/yard/handlers/rbs/mixin_handler.rb +20 -0
  96. data/yard-0.9.44/lib/yard/handlers/rbs/namespace_handler.rb +26 -0
  97. data/yard-0.9.44/lib/yard/handlers/ruby/alias_handler.rb +45 -0
  98. data/yard-0.9.44/lib/yard/handlers/ruby/attribute_handler.rb +90 -0
  99. data/yard-0.9.44/lib/yard/handlers/ruby/base.rb +165 -0
  100. data/yard-0.9.44/lib/yard/handlers/ruby/class_condition_handler.rb +92 -0
  101. data/yard-0.9.44/lib/yard/handlers/ruby/class_handler.rb +119 -0
  102. data/yard-0.9.44/lib/yard/handlers/ruby/class_variable_handler.rb +17 -0
  103. data/yard-0.9.44/lib/yard/handlers/ruby/comment_handler.rb +10 -0
  104. data/yard-0.9.44/lib/yard/handlers/ruby/constant_handler.rb +73 -0
  105. data/yard-0.9.44/lib/yard/handlers/ruby/decorator_handler_methods.rb +123 -0
  106. data/yard-0.9.44/lib/yard/handlers/ruby/dsl_handler.rb +15 -0
  107. data/yard-0.9.44/lib/yard/handlers/ruby/dsl_handler_methods.rb +96 -0
  108. data/yard-0.9.44/lib/yard/handlers/ruby/exception_handler.rb +27 -0
  109. data/yard-0.9.44/lib/yard/handlers/ruby/extend_handler.rb +22 -0
  110. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/alias_handler.rb +37 -0
  111. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/attribute_handler.rb +65 -0
  112. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/base.rb +245 -0
  113. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +83 -0
  114. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_handler.rb +113 -0
  115. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +15 -0
  116. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/comment_handler.rb +10 -0
  117. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/constant_handler.rb +29 -0
  118. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/dsl_handler.rb +17 -0
  119. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/exception_handler.rb +13 -0
  120. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/extend_handler.rb +21 -0
  121. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/method_handler.rb +90 -0
  122. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/mixin_handler.rb +39 -0
  123. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/module_function_handler.rb +19 -0
  124. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/module_handler.rb +12 -0
  125. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/private_class_method_handler.rb +22 -0
  126. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/private_constant_handler.rb +22 -0
  127. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/visibility_handler.rb +18 -0
  128. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/yield_handler.rb +29 -0
  129. data/yard-0.9.44/lib/yard/handlers/ruby/method_condition_handler.rb +9 -0
  130. data/yard-0.9.44/lib/yard/handlers/ruby/method_handler.rb +104 -0
  131. data/yard-0.9.44/lib/yard/handlers/ruby/mixin_handler.rb +61 -0
  132. data/yard-0.9.44/lib/yard/handlers/ruby/module_function_handler.rb +39 -0
  133. data/yard-0.9.44/lib/yard/handlers/ruby/module_handler.rb +12 -0
  134. data/yard-0.9.44/lib/yard/handlers/ruby/private_class_method_handler.rb +14 -0
  135. data/yard-0.9.44/lib/yard/handlers/ruby/private_constant_handler.rb +43 -0
  136. data/yard-0.9.44/lib/yard/handlers/ruby/public_class_method_handler.rb +14 -0
  137. data/yard-0.9.44/lib/yard/handlers/ruby/struct_handler_methods.rb +143 -0
  138. data/yard-0.9.44/lib/yard/handlers/ruby/visibility_handler.rb +35 -0
  139. data/yard-0.9.44/lib/yard/handlers/ruby/yield_handler.rb +31 -0
  140. data/yard-0.9.44/lib/yard/i18n/locale.rb +67 -0
  141. data/yard-0.9.44/lib/yard/i18n/message.rb +57 -0
  142. data/yard-0.9.44/lib/yard/i18n/messages.rb +56 -0
  143. data/yard-0.9.44/lib/yard/i18n/po_parser.rb +61 -0
  144. data/yard-0.9.44/lib/yard/i18n/pot_generator.rb +290 -0
  145. data/yard-0.9.44/lib/yard/i18n/text.rb +173 -0
  146. data/yard-0.9.44/lib/yard/logging.rb +260 -0
  147. data/yard-0.9.44/lib/yard/open_struct.rb +67 -0
  148. data/yard-0.9.44/lib/yard/options.rb +217 -0
  149. data/yard-0.9.44/lib/yard/parser/base.rb +57 -0
  150. data/yard-0.9.44/lib/yard/parser/c/c_parser.rb +235 -0
  151. data/yard-0.9.44/lib/yard/parser/c/comment_parser.rb +134 -0
  152. data/yard-0.9.44/lib/yard/parser/c/statement.rb +66 -0
  153. data/yard-0.9.44/lib/yard/parser/rbs/rbs_parser.rb +325 -0
  154. data/yard-0.9.44/lib/yard/parser/rbs/statement.rb +75 -0
  155. data/yard-0.9.44/lib/yard/parser/ruby/ast_node.rb +559 -0
  156. data/yard-0.9.44/lib/yard/parser/ruby/legacy/irb/slex.rb +294 -0
  157. data/yard-0.9.44/lib/yard/parser/ruby/legacy/ruby_lex.rb +1360 -0
  158. data/yard-0.9.44/lib/yard/parser/ruby/legacy/ruby_parser.rb +32 -0
  159. data/yard-0.9.44/lib/yard/parser/ruby/legacy/statement.rb +68 -0
  160. data/yard-0.9.44/lib/yard/parser/ruby/legacy/statement_list.rb +394 -0
  161. data/yard-0.9.44/lib/yard/parser/ruby/legacy/token_list.rb +74 -0
  162. data/yard-0.9.44/lib/yard/parser/ruby/ruby_parser.rb +792 -0
  163. data/yard-0.9.44/lib/yard/parser/ruby/token_resolver.rb +158 -0
  164. data/yard-0.9.44/lib/yard/parser/source_parser.rb +526 -0
  165. data/yard-0.9.44/lib/yard/rake/yardoc_task.rb +81 -0
  166. data/yard-0.9.44/lib/yard/registry.rb +439 -0
  167. data/yard-0.9.44/lib/yard/registry_resolver.rb +225 -0
  168. data/yard-0.9.44/lib/yard/registry_store.rb +342 -0
  169. data/yard-0.9.44/lib/yard/rubygems/backports/LICENSE.txt +57 -0
  170. data/yard-0.9.44/lib/yard/rubygems/backports/MIT.txt +20 -0
  171. data/yard-0.9.44/lib/yard/rubygems/backports/gem.rb +10 -0
  172. data/yard-0.9.44/lib/yard/rubygems/backports/source_index.rb +365 -0
  173. data/yard-0.9.44/lib/yard/rubygems/backports.rb +10 -0
  174. data/yard-0.9.44/lib/yard/rubygems/doc_manager.rb +90 -0
  175. data/yard-0.9.44/lib/yard/rubygems/hook.rb +197 -0
  176. data/yard-0.9.44/lib/yard/rubygems/specification.rb +50 -0
  177. data/yard-0.9.44/lib/yard/serializers/base.rb +83 -0
  178. data/yard-0.9.44/lib/yard/serializers/file_system_serializer.rb +123 -0
  179. data/yard-0.9.44/lib/yard/serializers/process_serializer.rb +24 -0
  180. data/yard-0.9.44/lib/yard/serializers/stdout_serializer.rb +34 -0
  181. data/yard-0.9.44/lib/yard/serializers/yardoc_serializer.rb +152 -0
  182. data/yard-0.9.44/lib/yard/server/adapter.rb +100 -0
  183. data/yard-0.9.44/lib/yard/server/commands/base.rb +203 -0
  184. data/yard-0.9.44/lib/yard/server/commands/display_file_command.rb +29 -0
  185. data/yard-0.9.44/lib/yard/server/commands/display_object_command.rb +65 -0
  186. data/yard-0.9.44/lib/yard/server/commands/frames_command.rb +16 -0
  187. data/yard-0.9.44/lib/yard/server/commands/library_command.rb +187 -0
  188. data/yard-0.9.44/lib/yard/server/commands/library_index_command.rb +28 -0
  189. data/yard-0.9.44/lib/yard/server/commands/list_command.rb +25 -0
  190. data/yard-0.9.44/lib/yard/server/commands/root_request_command.rb +15 -0
  191. data/yard-0.9.44/lib/yard/server/commands/search_command.rb +79 -0
  192. data/yard-0.9.44/lib/yard/server/commands/static_file_command.rb +23 -0
  193. data/yard-0.9.44/lib/yard/server/commands/static_file_helpers.rb +60 -0
  194. data/yard-0.9.44/lib/yard/server/doc_server_helper.rb +91 -0
  195. data/yard-0.9.44/lib/yard/server/doc_server_serializer.rb +39 -0
  196. data/yard-0.9.44/lib/yard/server/http_utils.rb +512 -0
  197. data/yard-0.9.44/lib/yard/server/library_version.rb +277 -0
  198. data/yard-0.9.44/lib/yard/server/rack_adapter.rb +97 -0
  199. data/yard-0.9.44/lib/yard/server/router.rb +187 -0
  200. data/yard-0.9.44/lib/yard/server/static_caching.rb +77 -0
  201. data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/css/custom.css +207 -0
  202. data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
  203. data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +203 -0
  204. data/yard-0.9.44/lib/yard/server/templates/default/layout/html/breadcrumb.erb +21 -0
  205. data/yard-0.9.44/lib/yard/server/templates/default/layout/html/script_setup.erb +7 -0
  206. data/yard-0.9.44/lib/yard/server/templates/default/layout/html/setup.rb +8 -0
  207. data/yard-0.9.44/lib/yard/server/templates/default/method_details/html/permalink.erb +6 -0
  208. data/yard-0.9.44/lib/yard/server/templates/default/method_details/html/setup.rb +5 -0
  209. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/headers.erb +8 -0
  210. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +13 -0
  211. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/listing.erb +13 -0
  212. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/setup.rb +6 -0
  213. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/title.erb +2 -0
  214. data/yard-0.9.44/lib/yard/server/templates/doc_server/processing/html/processing.erb +58 -0
  215. data/yard-0.9.44/lib/yard/server/templates/doc_server/processing/html/setup.rb +4 -0
  216. data/yard-0.9.44/lib/yard/server/templates/doc_server/search/html/search.erb +18 -0
  217. data/yard-0.9.44/lib/yard/server/templates/doc_server/search/html/setup.rb +9 -0
  218. data/yard-0.9.44/lib/yard/server/webrick_adapter.rb +45 -0
  219. data/yard-0.9.44/lib/yard/server.rb +13 -0
  220. data/yard-0.9.44/lib/yard/tags/default_factory.rb +192 -0
  221. data/yard-0.9.44/lib/yard/tags/default_tag.rb +13 -0
  222. data/yard-0.9.44/lib/yard/tags/directives.rb +631 -0
  223. data/yard-0.9.44/lib/yard/tags/library.rb +633 -0
  224. data/yard-0.9.44/lib/yard/tags/option_tag.rb +13 -0
  225. data/yard-0.9.44/lib/yard/tags/overload_tag.rb +72 -0
  226. data/yard-0.9.44/lib/yard/tags/ref_tag.rb +8 -0
  227. data/yard-0.9.44/lib/yard/tags/ref_tag_list.rb +28 -0
  228. data/yard-0.9.44/lib/yard/tags/tag.rb +72 -0
  229. data/yard-0.9.44/lib/yard/tags/tag_format_error.rb +7 -0
  230. data/yard-0.9.44/lib/yard/tags/types_explainer.rb +288 -0
  231. data/yard-0.9.44/lib/yard/templates/engine.rb +185 -0
  232. data/yard-0.9.44/lib/yard/templates/erb_cache.rb +23 -0
  233. data/yard-0.9.44/lib/yard/templates/helpers/base_helper.rb +215 -0
  234. data/yard-0.9.44/lib/yard/templates/helpers/filter_helper.rb +27 -0
  235. data/yard-0.9.44/lib/yard/templates/helpers/html_helper.rb +688 -0
  236. data/yard-0.9.44/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +83 -0
  237. data/yard-0.9.44/lib/yard/templates/helpers/markup/html_entities.rb +2140 -0
  238. data/yard-0.9.44/lib/yard/templates/helpers/markup/hybrid_markdown.rb +2131 -0
  239. data/yard-0.9.44/lib/yard/templates/helpers/markup/rdoc_markdown.rb +23 -0
  240. data/yard-0.9.44/lib/yard/templates/helpers/markup/rdoc_markup.rb +112 -0
  241. data/yard-0.9.44/lib/yard/templates/helpers/markup_helper.rb +175 -0
  242. data/yard-0.9.44/lib/yard/templates/helpers/method_helper.rb +77 -0
  243. data/yard-0.9.44/lib/yard/templates/helpers/module_helper.rb +21 -0
  244. data/yard-0.9.44/lib/yard/templates/helpers/text_helper.rb +112 -0
  245. data/yard-0.9.44/lib/yard/templates/helpers/uml_helper.rb +47 -0
  246. data/yard-0.9.44/lib/yard/templates/section.rb +103 -0
  247. data/yard-0.9.44/lib/yard/templates/template.rb +420 -0
  248. data/yard-0.9.44/lib/yard/templates/template_options.rb +91 -0
  249. data/yard-0.9.44/lib/yard/verifier.rb +151 -0
  250. data/yard-0.9.44/lib/yard/version.rb +6 -0
  251. data/yard-0.9.44/lib/yard.rb +75 -0
  252. data/yard-0.9.44/po/ja.po +31108 -0
  253. data/yard-0.9.44/templates/default/class/dot/setup.rb +7 -0
  254. data/yard-0.9.44/templates/default/class/dot/superklass.erb +3 -0
  255. data/yard-0.9.44/templates/default/class/html/constructor_details.erb +8 -0
  256. data/yard-0.9.44/templates/default/class/html/setup.rb +2 -0
  257. data/yard-0.9.44/templates/default/class/html/subclasses.erb +4 -0
  258. data/yard-0.9.44/templates/default/class/setup.rb +36 -0
  259. data/yard-0.9.44/templates/default/class/text/setup.rb +12 -0
  260. data/yard-0.9.44/templates/default/class/text/subclasses.erb +5 -0
  261. data/yard-0.9.44/templates/default/constant/text/header.erb +11 -0
  262. data/yard-0.9.44/templates/default/constant/text/setup.rb +4 -0
  263. data/yard-0.9.44/templates/default/docstring/html/abstract.erb +4 -0
  264. data/yard-0.9.44/templates/default/docstring/html/deprecated.erb +1 -0
  265. data/yard-0.9.44/templates/default/docstring/html/index.erb +5 -0
  266. data/yard-0.9.44/templates/default/docstring/html/note.erb +6 -0
  267. data/yard-0.9.44/templates/default/docstring/html/private.erb +4 -0
  268. data/yard-0.9.44/templates/default/docstring/html/returns_void.erb +1 -0
  269. data/yard-0.9.44/templates/default/docstring/html/text.erb +1 -0
  270. data/yard-0.9.44/templates/default/docstring/html/todo.erb +6 -0
  271. data/yard-0.9.44/templates/default/docstring/setup.rb +52 -0
  272. data/yard-0.9.44/templates/default/docstring/text/abstract.erb +2 -0
  273. data/yard-0.9.44/templates/default/docstring/text/deprecated.erb +2 -0
  274. data/yard-0.9.44/templates/default/docstring/text/index.erb +2 -0
  275. data/yard-0.9.44/templates/default/docstring/text/note.erb +4 -0
  276. data/yard-0.9.44/templates/default/docstring/text/private.erb +2 -0
  277. data/yard-0.9.44/templates/default/docstring/text/returns_void.erb +1 -0
  278. data/yard-0.9.44/templates/default/docstring/text/text.erb +1 -0
  279. data/yard-0.9.44/templates/default/docstring/text/todo.erb +4 -0
  280. data/yard-0.9.44/templates/default/fulldoc/html/css/common.css +1 -0
  281. data/yard-0.9.44/templates/default/fulldoc/html/css/full_list.css +206 -0
  282. data/yard-0.9.44/templates/default/fulldoc/html/css/style.css +1089 -0
  283. data/yard-0.9.44/templates/default/fulldoc/html/frames.erb +22 -0
  284. data/yard-0.9.44/templates/default/fulldoc/html/full_list.erb +40 -0
  285. data/yard-0.9.44/templates/default/fulldoc/html/full_list_class.erb +2 -0
  286. data/yard-0.9.44/templates/default/fulldoc/html/full_list_file.erb +7 -0
  287. data/yard-0.9.44/templates/default/fulldoc/html/full_list_method.erb +10 -0
  288. data/yard-0.9.44/templates/default/fulldoc/html/js/app.js +801 -0
  289. data/yard-0.9.44/templates/default/fulldoc/html/js/full_list.js +334 -0
  290. data/yard-0.9.44/templates/default/fulldoc/html/js/jquery.js +4 -0
  291. data/yard-0.9.44/templates/default/fulldoc/html/setup.rb +249 -0
  292. data/yard-0.9.44/templates/default/layout/dot/header.erb +6 -0
  293. data/yard-0.9.44/templates/default/layout/dot/setup.rb +15 -0
  294. data/yard-0.9.44/templates/default/layout/html/breadcrumb.erb +11 -0
  295. data/yard-0.9.44/templates/default/layout/html/files.erb +11 -0
  296. data/yard-0.9.44/templates/default/layout/html/footer.erb +5 -0
  297. data/yard-0.9.44/templates/default/layout/html/headers.erb +15 -0
  298. data/yard-0.9.44/templates/default/layout/html/index.erb +2 -0
  299. data/yard-0.9.44/templates/default/layout/html/layout.erb +26 -0
  300. data/yard-0.9.44/templates/default/layout/html/listing.erb +4 -0
  301. data/yard-0.9.44/templates/default/layout/html/objects.erb +32 -0
  302. data/yard-0.9.44/templates/default/layout/html/script_setup.erb +4 -0
  303. data/yard-0.9.44/templates/default/layout/html/search.erb +13 -0
  304. data/yard-0.9.44/templates/default/layout/html/setup.rb +89 -0
  305. data/yard-0.9.44/templates/default/method/html/header.erb +17 -0
  306. data/yard-0.9.44/templates/default/method/setup.rb +4 -0
  307. data/yard-0.9.44/templates/default/method/text/header.erb +1 -0
  308. data/yard-0.9.44/templates/default/method_details/html/header.erb +3 -0
  309. data/yard-0.9.44/templates/default/method_details/html/method_signature.erb +25 -0
  310. data/yard-0.9.44/templates/default/method_details/html/source.erb +10 -0
  311. data/yard-0.9.44/templates/default/method_details/setup.rb +11 -0
  312. data/yard-0.9.44/templates/default/method_details/text/header.erb +10 -0
  313. data/yard-0.9.44/templates/default/method_details/text/method_signature.erb +12 -0
  314. data/yard-0.9.44/templates/default/method_details/text/setup.rb +11 -0
  315. data/yard-0.9.44/templates/default/module/dot/child.erb +1 -0
  316. data/yard-0.9.44/templates/default/module/dot/dependencies.erb +3 -0
  317. data/yard-0.9.44/templates/default/module/dot/header.erb +6 -0
  318. data/yard-0.9.44/templates/default/module/dot/info.erb +14 -0
  319. data/yard-0.9.44/templates/default/module/dot/setup.rb +15 -0
  320. data/yard-0.9.44/templates/default/module/html/attribute_details.erb +10 -0
  321. data/yard-0.9.44/templates/default/module/html/attribute_summary.erb +8 -0
  322. data/yard-0.9.44/templates/default/module/html/box_info.erb +43 -0
  323. data/yard-0.9.44/templates/default/module/html/children.erb +8 -0
  324. data/yard-0.9.44/templates/default/module/html/constant_summary.erb +17 -0
  325. data/yard-0.9.44/templates/default/module/html/defines.erb +3 -0
  326. data/yard-0.9.44/templates/default/module/html/header.erb +5 -0
  327. data/yard-0.9.44/templates/default/module/html/inherited_attributes.erb +14 -0
  328. data/yard-0.9.44/templates/default/module/html/inherited_constants.erb +8 -0
  329. data/yard-0.9.44/templates/default/module/html/inherited_methods.erb +20 -0
  330. data/yard-0.9.44/templates/default/module/html/item_summary.erb +40 -0
  331. data/yard-0.9.44/templates/default/module/html/method_details_list.erb +9 -0
  332. data/yard-0.9.44/templates/default/module/html/method_summary.erb +22 -0
  333. data/yard-0.9.44/templates/default/module/html/methodmissing.erb +12 -0
  334. data/yard-0.9.44/templates/default/module/html/pre_docstring.erb +1 -0
  335. data/yard-0.9.44/templates/default/module/setup.rb +187 -0
  336. data/yard-0.9.44/templates/default/module/text/children.erb +10 -0
  337. data/yard-0.9.44/templates/default/module/text/class_meths_list.erb +8 -0
  338. data/yard-0.9.44/templates/default/module/text/extends.erb +8 -0
  339. data/yard-0.9.44/templates/default/module/text/header.erb +7 -0
  340. data/yard-0.9.44/templates/default/module/text/includes.erb +8 -0
  341. data/yard-0.9.44/templates/default/module/text/instance_meths_list.erb +8 -0
  342. data/yard-0.9.44/templates/default/module/text/setup.rb +13 -0
  343. data/yard-0.9.44/templates/default/onefile/html/files.erb +5 -0
  344. data/yard-0.9.44/templates/default/onefile/html/headers.erb +8 -0
  345. data/yard-0.9.44/templates/default/onefile/html/layout.erb +16 -0
  346. data/yard-0.9.44/templates/default/onefile/html/readme.erb +3 -0
  347. data/yard-0.9.44/templates/default/onefile/html/setup.rb +62 -0
  348. data/yard-0.9.44/templates/default/root/dot/child.erb +3 -0
  349. data/yard-0.9.44/templates/default/root/dot/setup.rb +6 -0
  350. data/yard-0.9.44/templates/default/root/html/setup.rb +2 -0
  351. data/yard-0.9.44/templates/default/tags/html/example.erb +11 -0
  352. data/yard-0.9.44/templates/default/tags/html/index.erb +3 -0
  353. data/yard-0.9.44/templates/default/tags/html/option.erb +24 -0
  354. data/yard-0.9.44/templates/default/tags/html/overload.erb +14 -0
  355. data/yard-0.9.44/templates/default/tags/html/see.erb +8 -0
  356. data/yard-0.9.44/templates/default/tags/html/tag.erb +20 -0
  357. data/yard-0.9.44/templates/default/tags/setup.rb +57 -0
  358. data/yard-0.9.44/templates/default/tags/text/example.erb +12 -0
  359. data/yard-0.9.44/templates/default/tags/text/index.erb +1 -0
  360. data/yard-0.9.44/templates/default/tags/text/option.erb +20 -0
  361. data/yard-0.9.44/templates/default/tags/text/overload.erb +19 -0
  362. data/yard-0.9.44/templates/default/tags/text/see.erb +11 -0
  363. data/yard-0.9.44/templates/default/tags/text/tag.erb +13 -0
  364. data/yard-0.9.44/templates/guide/class/html/setup.rb +2 -0
  365. data/yard-0.9.44/templates/guide/docstring/html/setup.rb +2 -0
  366. data/yard-0.9.44/templates/guide/fulldoc/html/css/style.css +358 -0
  367. data/yard-0.9.44/templates/guide/fulldoc/html/js/app.js +61 -0
  368. data/yard-0.9.44/templates/guide/fulldoc/html/setup.rb +74 -0
  369. data/yard-0.9.44/templates/guide/layout/html/layout.erb +78 -0
  370. data/yard-0.9.44/templates/guide/layout/html/setup.rb +25 -0
  371. data/yard-0.9.44/templates/guide/method/html/header.erb +18 -0
  372. data/yard-0.9.44/templates/guide/method/html/setup.rb +22 -0
  373. data/yard-0.9.44/templates/guide/module/html/header.erb +7 -0
  374. data/yard-0.9.44/templates/guide/module/html/method_list.erb +5 -0
  375. data/yard-0.9.44/templates/guide/module/html/setup.rb +27 -0
  376. data/yard-0.9.44/templates/guide/onefile/html/files.erb +4 -0
  377. data/yard-0.9.44/templates/guide/onefile/html/setup.rb +6 -0
  378. data/yard-0.9.44/templates/guide/onefile/html/toc.erb +3 -0
  379. data/yard-0.9.44/templates/guide/tags/html/setup.rb +9 -0
  380. metadata +419 -0
@@ -0,0 +1,705 @@
1
+ # @title Getting Started Guide
2
+
3
+ # Getting Started with YARD
4
+
5
+ There are a few ways which YARD can be of use to you or your project. This
6
+ document will cover the most common ways to use YARD:
7
+
8
+ * [Documenting Code with YARD](#docing)
9
+ * [Using YARD to Generate Documentation](#using)
10
+ * [Configuring YARD](#config)
11
+ * [Extending YARD](#extending)
12
+ * [Templating YARD](#templating)
13
+ * [Plugin Support](#plugins)
14
+
15
+ <a name="docing"></a>
16
+
17
+ ## Documenting Code with YARD
18
+
19
+ By default, YARD is compatible with the same RDoc syntax most Ruby developers
20
+ are already familiar with. However, one of the biggest advantages of YARD is
21
+ the extended meta-data syntax, commonly known as "tags", that you can use
22
+ to express small bits of information in a structured and formal manner. While
23
+ RDoc syntax expects you to describe your method in a completely free-form
24
+ manner, YARD recommends declaring your parameters, return types, etc. with
25
+ the `@tag` syntax, which makes outputting the documentation more consistent
26
+ and easier to read. Consider the RDoc documentation for a method to_format:
27
+
28
+ # Converts the object into textual markup given a specific `format`
29
+ # (defaults to `:html`)
30
+ #
31
+ # == Parameters:
32
+ # format::
33
+ # A Symbol declaring the format to convert the object to. This
34
+ # can be `:text` or `:html`.
35
+ #
36
+ # == Returns:
37
+ # A string representing the object in a specified
38
+ # format.
39
+ #
40
+ def to_format(format = :html)
41
+ # format the object
42
+ end
43
+
44
+ While this may seem easy enough to read and understand, it's hard for a machine
45
+ to properly pull this data back out of our documentation. Also we've tied our
46
+ markup to our content, and now our documentation becomes hard to maintain if
47
+ we decide later to change our markup style (maybe we don't want the ":" suffix
48
+ on our headers anymore).
49
+
50
+ In YARD, we would simply define our method as:
51
+
52
+ # Converts the object into textual markup given a specific format.
53
+ #
54
+ # @param format [Symbol] the format type, `:text` or `:html`
55
+ # @return [String] the object converted into the expected format.
56
+ def to_format(format = :html)
57
+ # format the object
58
+ end
59
+
60
+ Using tags we can add semantic metadata to our code without worrying about
61
+ presentation. YARD will handle presentation for us when we decide to generate
62
+ documentation later.
63
+
64
+ ### Disconnecting Comment Blocks
65
+
66
+ YARD attaches a comment block to the next relevant object by default. That is
67
+ usually what you want, but file headers are a common exception. If you keep a
68
+ copyright notice, license note or general file-level description at the top of
69
+ the file, it can accidentally become the docstring for the first class or
70
+ module unless you explicitly break the block.
71
+
72
+ To disconnect the block, end the header with an attached `#-` line:
73
+
74
+ # Copyright (c) Example Corp
75
+ # Shared support code for the client layer.
76
+ #-
77
+
78
+ class Client
79
+ end
80
+
81
+ In this example, the header comment is not attached to `Client`.
82
+
83
+ This only works with `#-`. If you write `# -` with a space before the hyphen,
84
+ YARD treats it as a normal comment line and it remains part of the docstring.
85
+
86
+ ## Which Markup Format?
87
+
88
+ YARD does not impose a specific markup format. YARD ships with a builtin
89
+ renderer that supports both RDoc and Markdown out of the box—no external gem
90
+ required. You can use either format (or switch between them) without installing
91
+ anything extra. YARD also supports textile, asciidoc, and other formats via
92
+ optional gems.
93
+
94
+ To select a markup format, use the command-line switch `-m FORMAT` or add
95
+ `--markup FORMAT` to your `.yardopts` file. This guide is written in Markdown.
96
+ YARD adds a few important syntaxes that are processed regardless of which
97
+ markup format you choose, such as tag support and inter-document linking.
98
+ These syntaxes are discussed below.
99
+
100
+ ## Adding Tags to Documentation
101
+
102
+ The tag syntax that YARD uses is the same @tag-style syntax you may have seen
103
+ if you've ever coded in Java, Python, PHP, Objective-C or a myriad of other
104
+ languages. The following tag adds an author tag to your class:
105
+
106
+ # @author Loren Segal
107
+ class MyClass
108
+ end
109
+
110
+ To allow for large amounts of text, the @tag syntax will recognize any indented
111
+ lines following a tag as part of the tag data. For example:
112
+
113
+ # @deprecated Use {#my_new_method} instead of this method because
114
+ # it uses a library that is no longer supported in Ruby 1.9.
115
+ # The new method accepts the same parameters.
116
+ def mymethod
117
+ end
118
+
119
+ ### List of Tags
120
+
121
+ A list of tags can be found in {file:docs/Tags.md#taglist}
122
+
123
+ ### Reference Tags
124
+
125
+ To reduce the amount of duplication in writing documentation for repetitive
126
+ code, YARD introduces "reference tags", which are not quite tags, but not
127
+ quite docstrings either. In a sense, they are tag (and docstring) modifiers.
128
+ Basically, any docstring (or tag) that begins with "(see OTHEROBJECT)" will
129
+ implicitly link the docstring or tag to the "OTHEROBJECT", copying any data
130
+ from that docstring/tag into your current object. Consider the example:
131
+
132
+ class MyWebServer
133
+ # Handles a request
134
+ # @param request [Request] the request object
135
+ # @return [String] the resulting webpage
136
+ def get(request) "hello" end
137
+
138
+ # (see #get)
139
+ def post(request) "hello" end
140
+ end
141
+
142
+ The above `#post` method takes the docstring and all tags (`param` and `return`)
143
+ of the `#get` method. When you generate HTML documentation, you will see this
144
+ duplication automatically, so you don't have to manually type it out. We can
145
+ also add our own custom docstring information below the "see" reference, and
146
+ whatever we write will be appended to the docstring:
147
+
148
+ # (see #get)
149
+ # @note This method may modify our application state!
150
+ def post(request) self.state += 1; "hello" end
151
+
152
+ Here we added another tag, but we could have also added plain text. The
153
+ text must be appended *after* the `(see ...)` statement, preferably on
154
+ a separate line.
155
+
156
+ Note that we don't have to "refer" the whole docstring. We can also link
157
+ individual tags instead. Since "get" and "post" actually have different
158
+ descriptions, a more accurate example would be to only refer our parameter
159
+ and return tags:
160
+
161
+ class MyWebServer
162
+ # Handles a GET request
163
+ # @param request [Request] the request object
164
+ # @return [String] the resulting webpage
165
+ def get(request) "hello" end
166
+
167
+ # Handles a POST request
168
+ # @note This method may modify our application state!
169
+ # @param (see #get)
170
+ # @return (see #get)
171
+ def post(request) self.state += 1; "hello" end
172
+ end
173
+
174
+ The above copies all of the param and return tags from `#get`. Note that you
175
+ cannot copy individual tags of a specific type with this syntax.
176
+
177
+ ## Declaring Types
178
+
179
+ Some tags also have an optional "types" field which let us declare a list of
180
+ types associated with the tag. For instance, a return tag can be declared
181
+ with or without a types field.
182
+
183
+ # @return [String, nil] the contents of our object or nil
184
+ # if the object has not been filled with data.
185
+ def validate; end
186
+
187
+ # We don't care about the "type" here:
188
+ # @return the object
189
+ def to_obj; end
190
+
191
+ The list of types is in the form `[type1, type2, ...]` and is mostly free-form,
192
+ so we can also specify duck-types or constant values. For example:
193
+
194
+ # @param argname [#to_s] any object that responds to `#to_s`
195
+ # @param argname [true, false] only true or false
196
+
197
+ Note the latter example can be replaced by the meta-type "Boolean".
198
+ Another meta-type is "void", which stands for "no meaningful value"
199
+ and is used for return values. These meta-types are by convention
200
+ only, but are recommended.
201
+
202
+ List types can be specified in the form `CollectionClass<ElementType, ...>`.
203
+ For instance, consider the following Array that holds a set of Strings and
204
+ Symbols:
205
+
206
+ # @param list [Array<String, Symbol>] the list of strings and symbols.
207
+
208
+ We mentioned that these type fields are "mostly" free-form. In truth, they
209
+ are defined "by convention". To view samples of common type specifications
210
+ and recommended conventions for writing type specifications, see
211
+ [https://yardoc.org/types.html](https://yardoc.org/types.html). Note that these
212
+ conventions may change every now and then, although we are working on a more
213
+ "formal" type specification proposal.
214
+
215
+ ## Documenting Attributes
216
+
217
+ To document a Ruby attribute, add documentation text above the attribute
218
+ definition.
219
+
220
+ # Controls the amplitude of the waveform.
221
+ # @return [Numeric] the amplitude of the waveform
222
+ attr_accessor :amplitude
223
+
224
+ As a short-hand syntax for declaring reader and writer attribute pairs,
225
+ YARD will automatically wire up the correct method types and information
226
+ by simply defining documentation in the `@return` tag. For example,
227
+ the following declaration will show the correct information for the
228
+ `waveform` attribute, both for the getter's return type and the
229
+ setter's value parameter type:
230
+
231
+ # @return [Numeric] the amplitude of the waveform
232
+ attr_accessor :amplitude
233
+
234
+ In this case, the most important details for the attribute are the
235
+ object type declaration and its descriptive text.
236
+
237
+ ### Documentation for a Separate Attribute Writer
238
+
239
+ Usually an attribute will get and set a value using the same syntax,
240
+ so there is no reason to have separate documentation for an attribute
241
+ writer. In the above `amplitude` case, the `Numeric` type is both used
242
+ for the getter and setter types.
243
+
244
+ Sometimes, however, you might want to have separate documentation
245
+ for the getter and setter. In this case, you would still add
246
+ the documentation text to the getter declaration (or `attr_accessor`)
247
+ and use `@overload` tags to declare the separate docstrings. For example:
248
+
249
+ # @overload amplitude
250
+ # Gets the current waveform amplitude.
251
+ # @return [Numeric] the amplitude of the waveform
252
+ # @overload amplitude=(value)
253
+ # Sets the new amplitude.
254
+ # @param value [Numeric] the new amplitude value
255
+ # @note The new amplitude will only take effect if {#restart}
256
+ # is called on the stream.
257
+
258
+ Note that by default, YARD exposes the reader portion of the attribute
259
+ in HTML output. If you have separate `attr_reader` and `attr_writer`
260
+ declarations, make sure to put your documentation (for both reader
261
+ and writer methods) on the reader declaration using `@overload`
262
+ tags as described above. For example:
263
+
264
+ # @overload ...documentation here...
265
+ attr_reader :amplitude
266
+
267
+ # This documentation will be ignored by YARD.
268
+ attr_writer :amplitude
269
+
270
+ ## Documenting Custom DSL Methods
271
+
272
+ Application code in Ruby often makes use of DSL style metaprogrammed methods.
273
+ The most common is the `attr_accessor` method, which of course has built-in
274
+ support in YARD. However, frameworks and libraries often expose custom
275
+ methods that perform similar metaprogramming tasks, and it is often useful
276
+ to document their functionality in your application. Consider the `property`
277
+ method in a project like [DataMapper](https://datamapper.org), which creates
278
+ a typed attribute for a database model. The code might look like:
279
+
280
+ class Post
281
+ include DataMapper::Resource
282
+
283
+ property :title, String
284
+ end
285
+
286
+ As of version 0.7.0, YARD will automatically pick up on these basic methods if
287
+ you document them with a docstring. Therefore, simply adding some comments to
288
+ the code will cause it to generate documentation:
289
+
290
+ class Post
291
+ include DataMapper::Resource
292
+
293
+ # @return [String] the title property of the post
294
+ property :title, String
295
+ end
296
+
297
+ Note that YARD uses the first argument in the method call to determine the
298
+ method name. In some cases, this would not be the method name, and you would
299
+ need to declare it manually. You can do so with the `@!method` directive:
300
+
301
+ # @!method foo
302
+ create_a_foo_method
303
+
304
+ The @!method directive can also accept a full method signature with parameters:
305
+
306
+ # @!method foo(name, opts = {})
307
+ create_a_foo_method
308
+
309
+ You can also set visibility and scope, or modify the method signature with
310
+ extra tags. The following adds documentation for a private class method:
311
+
312
+ # @!method foo(opts = {})
313
+ # The foo method!
314
+ # @!scope class
315
+ # @!visibility private
316
+ create_a_private_foo_class_method
317
+
318
+ Finally, you can tag a method as an attribute by replacing the @!method
319
+ tag with @!attribute. The @!attribute directive allows for the flags [r], [w],
320
+ or [rw] to declare a readonly, writeonly, or readwrite attribute, respectively.
321
+
322
+ # @!attribute [w]
323
+ # The writeonly foo attribute!
324
+ a_writeonly_attribute :foo
325
+
326
+ (Note that if the name can be automatically detected, you do not need to
327
+ specify it in the @!method or @!attribute directives)
328
+
329
+ However, you will notice a few drawbacks with this basic support:
330
+
331
+ 1. There is a fair bit of duplication in such documentation. Specifically, we
332
+ repeat the term String and title twice in the property example.
333
+ 2. We must write a code comment for this property to show up in the documentation.
334
+ If we do not write a comment, it is ignored.
335
+
336
+ ### Macros
337
+
338
+ Fortunately YARD 0.7.0 also adds macros, a powerful way to add support for
339
+ these DSL methods on the fly without writing extra plugins. Macros allow
340
+ you to interpolate arguments from the method call inside the docstring,
341
+ reducing duplication. If we re-wrote the `property` example from above
342
+ using a macro, it might look like:
343
+
344
+ class Post
345
+ include DataMapper::Resource
346
+
347
+ # @!macro dm.property
348
+ # @return [$2] the $1 $0 of the post
349
+ property :title, String
350
+ end
351
+
352
+ (Note that $0 represents the method call, in this case `property`. The rest
353
+ are arguments in the method call.)
354
+
355
+ The above example is equivalent to the first version shown in the previous
356
+ section. There is also some extra benefit to using this macro, in that we
357
+ can re-apply it to any other property in our class by simply calling on
358
+ the macro. The following:
359
+
360
+ # @!macro dm.property
361
+ property :view_count, Integer
362
+
363
+ Would be equivalent to:
364
+
365
+ # @return [Integer] the view_count property of the post
366
+ property :view_count, Integer
367
+
368
+ Finally, macros can be "attached" to method calls, allowing them to be implicitly
369
+ activated every time the method call is seen in the source code of the class,
370
+ or an inheriting class. By simply adding the `[attach]` flag, the macro
371
+ becomes implicit on future calls. All of the properties below get documented
372
+ by using this snippet:
373
+
374
+ class Post
375
+ include DataMapper::Resource
376
+
377
+ # @!macro [attach] dm.property
378
+ # @return [$2] the $1 $0 of the post
379
+ property :title, String
380
+ property :view_count, Integer
381
+ property :email, String
382
+ end
383
+
384
+ You can read more about macros in the {file:docs/Tags.md Tags Overview} document.
385
+
386
+ ## Customized YARD Markup
387
+
388
+ YARD supports a special syntax to link to other code objects, URLs, files,
389
+ or embed docstrings between documents. This syntax has the general form
390
+ of `{Name OptionalTitle}` (where `OptionalTitle` can have spaces, but `Name`
391
+ cannot).
392
+
393
+ ### Linking Objects `{...}`
394
+
395
+ To link another "object" (class, method, module, etc.), use the format:
396
+
397
+ {ObjectName#method OPTIONAL_TITLE}
398
+ {Class::CONSTANT My constant's title}
399
+ {#method_inside_current_namespace}
400
+
401
+ Without an explicit title, YARD will use the relative path to the object as
402
+ the link name. Note that you can also use relative paths inside the object
403
+ path to refer to an object inside the same namespace as your current docstring.
404
+
405
+ Note that the `@see` tag automatically links its data. You should not use
406
+ the link syntax in this tag:
407
+
408
+ # @see #methodname <- Correct.
409
+ # @see {#methodname} <- Incorrect.
410
+
411
+ If you want to use a Hash, prefix the first { with "!":
412
+
413
+ # !{ :some_key => 'value' }
414
+
415
+ ### Linking URLs `{https://...}`
416
+
417
+ URLs are also linked using this `{...}` syntax:
418
+
419
+ {https://example.com Optional Title}
420
+ {mailto:email@example.com}
421
+
422
+ ### Linking Files `{file:...}`
423
+
424
+ Files can also be linked using this same syntax but by adding the `file:`
425
+ prefix to the object name. Files refer to extra readme files you added
426
+ via the command-line. Consider the following examples:
427
+
428
+ {file:docs/GettingStarted.md Getting Started}
429
+ {file:mypage.html#anchor Name}
430
+
431
+ As shown, you can also add an optional `#anchor` if the page is an HTML link.
432
+
433
+ ### Embedding Docstrings `{include:...}`
434
+
435
+ We saw the `(see ...)` syntax above, which allowed us to link an entire docstring
436
+ with another. Sometimes, however, we just want to copy docstring text without
437
+ tags. Using the same `{...}` syntax, but using the `include:` prefix, we can
438
+ embed a docstring (minus tags) at a specific point in the text.
439
+
440
+ # This class is cool
441
+ # @abstract
442
+ class Foo; end
443
+
444
+ # This is another class. {include:Foo} too!
445
+ class Bar; end
446
+
447
+ The docstring for Bar becomes:
448
+
449
+ "This is another class. This class is cool too!"
450
+
451
+ ### Embedding Files `{include:file:...}`
452
+
453
+ You can embed the contents of files using `{include:file:path/to/file}`,
454
+ similar to the `{include:OBJECT}` tag above. If the file uses a specific markup
455
+ type, it will be applied and embedded as marked up text. The following
456
+ shows how the tag can be used inside of comments:
457
+
458
+ # Here is an example of a highlighted Ruby file:
459
+ #
460
+ # {include:file:examples/test.rb}
461
+
462
+ ### Rendering Objects `{render:...}`
463
+
464
+ Entire objects can also be rendered in place in documentation. This can be
465
+ used for guide-style documentation which does not document the entire source
466
+ tree, but instead selectively renders important classes or methods. Consider
467
+ the following documentation inside of a README file:
468
+
469
+ !!!plain
470
+ = igLatinPay!
471
+
472
+ This library adds pig latin methods to the string class, allowing you
473
+ to transform sentences into pig latin.
474
+
475
+ {render:String#pig_latin}
476
+
477
+ You can also un-pig-latin-ify a word or sentence:
478
+
479
+ {render:String#de_pig_latin}
480
+
481
+ The above would render the methods in place inside the README document,
482
+ allowing you to summarize a small library in a single file.
483
+
484
+ <a name="using"></a>
485
+
486
+ ## Using YARD to Generate Documentation
487
+
488
+ ### `yard` Executable
489
+
490
+ YARD ships with a single executable aptly named `yard`. In addition to
491
+ generating standard documentation for your project, you would use this tool
492
+ if you wanted to:
493
+
494
+ * Document all installed gems
495
+ * Run a local documentation server
496
+ * Generate UML diagrams using [Graphviz][graphviz]
497
+ * View `ri`-style documentation
498
+ * Diff your documentation
499
+ * Analyze documentation statistics.
500
+
501
+ The following commands are available in YARD 0.6.x (see `yard help` for a
502
+ full list):
503
+
504
+ Usage: yard <command> [options]
505
+
506
+ Commands:
507
+ config Views or edits current global configuration
508
+ diff Returns the object diff of two gems or .yardoc files
509
+ doc Generates documentation
510
+ gems Builds YARD index for gems
511
+ graph Graphs class diagram using Graphviz
512
+ help Retrieves help for a command
513
+ ri A tool to view documentation in the console like `ri`
514
+ server Runs a local documentation server
515
+ stats Prints documentation statistics on a set of files
516
+
517
+ Note that `yardoc` is an alias for `yard doc`, and `yri` is an alias for
518
+ `yard ri`. These commands are maintained for backwards compatibility.
519
+
520
+ ### `.yardopts` Options File
521
+
522
+ Unless your documentation is very small, you'll end up needing to run `yardoc`
523
+ with many options. The `yardoc` tool will use the options found in this file.
524
+ It is recommended to check this in to your repository and distribute it with
525
+ your source. This file is placed at the root of your project (in the directory
526
+ you run `yardoc` from) and contains all of arguments you would otherwise pass
527
+ to the command-line tool. For instance, if you often type:
528
+
529
+ yardoc --no-private --protected app/**/*.rb - README LEGAL COPYING
530
+
531
+ You can place the following into your `.yardopts`:
532
+
533
+ --no-private --protected app/**/*.rb - README LEGAL COPYING
534
+
535
+ This way, you only need to type:
536
+
537
+ yardoc
538
+
539
+ Any extra switches passed to the command-line now will be appended to your
540
+ `.yardopts` options.
541
+
542
+ Note that options for `yardoc` are discussed in the {file:README.md README},
543
+ and a full overview of the `.yardopts` file can be found in {YARD::CLI::Yardoc}.
544
+
545
+ ### Documenting Extra Files
546
+
547
+ "Extra files" are extra guide style documents that help to give a brief overview
548
+ of how to use your library/framework, as well as any extra information that
549
+ might be vital for your users. The most common "extra file" is the README,
550
+ which is automatically detected by YARD if found in the root of your project
551
+ (any file starting with `README*`). You can specify extra files on the command
552
+ line (or in the `.yardopts` file) by listing them after the '-' separator:
553
+
554
+ yardoc lib/**/*.rb ext/**/*.{c,rb} - LICENSE.txt
555
+
556
+ Note that the README will automatically be picked up, so you do not need to
557
+ specify it. If you don't want to modify the default file globs, you can ignore
558
+ the first set of arguments:
559
+
560
+ yardoc - LICENSE.txt
561
+
562
+ Below you can read about how to customize the look of these extra files, both
563
+ with markup and pretty titles.
564
+
565
+ #### Adding Meta-Data to Extra Files
566
+
567
+ You can add YARD-style `@tag` metadata to the top of any extra file if prefixed
568
+ by a `#` hash comment. YARD allows for arbitrary meta-data, but pays special
569
+ attention to the tags `@markup`, `@encoding`, and `@title`. Note that there
570
+ cannot be any whitespace before the tags. Here is an example of some tag data
571
+ in a README:
572
+
573
+ # @markup markdown
574
+ # @title The Best Library in the World!
575
+ # @author The Author Name
576
+
577
+ This is the best library you will ever meet. Lipsum ...
578
+
579
+ The `@markup` tag allows you to specify a markup format to use for the file,
580
+ including "markdown", "textile", "rdoc", "ruby", "text", "html", or "none"
581
+ (no markup). This can be used when the markup cannot be auto-detected using
582
+ the extension of the filename, if the file has no extension, or if you want
583
+ to override the auto-detection.
584
+
585
+ By using `@encoding` you can specify a non-standard encoding. Note that
586
+ `yardoc --charset` sets the global encoding (for all comments / files),
587
+ so if you are using unicode across all your files, you can specify it there.
588
+ Using the `@encoding` tag might be used to override the default global
589
+ charset, say, if you had a localized `README.jp` file with SJIS data.
590
+ Also note that this only affects Ruby 1.9.x, as Ruby 1.8 is not properly
591
+ encoding aware.
592
+
593
+ The `@title` tag allows you to specify a full title name for the document.
594
+ By default, YARD uses the filename as the title of the document and lists
595
+ it in the file list in the index and file menu. In some cases, the file name
596
+ might not be descriptive enough, so YARD allows you to specify a full title:
597
+
598
+ contents of TITLE.txt:
599
+ # @title The Title of The Document
600
+
601
+ Currently all other meta-data is hidden from view, though accessible
602
+ programmatically using the {YARD::CodeObjects::ExtraFileObject} class.
603
+
604
+ You can wrap the meta data section in an HTML comment to prevent it
605
+ from being displayed in rendered markdown on GitHub:
606
+
607
+ <!--
608
+ # @markup markdown
609
+ # @title The Best Library in the World!
610
+ # @author The Author Name
611
+ -->
612
+
613
+ This is the best library you will ever meet. Lipsum ...
614
+
615
+ <a name="config"></a>
616
+
617
+ ## Configuring YARD
618
+
619
+ YARD (0.6.2+) supports a global configuration file stored in `~/.yard/config`.
620
+ This file is stored as a YAML file and can contain arbitrary keys and values
621
+ that can be used by YARD at run-time. YARD defines specific keys that are used
622
+ to control various features, and they are listed in {YARD::Config::DEFAULT_CONFIG_OPTIONS}.
623
+ A sample configuration file might look like:
624
+
625
+ :load_plugins: false
626
+ :ignored_plugins:
627
+ - my_plugin
628
+ - my_other_plugin
629
+ :autoload_plugins:
630
+ - my_autoload_plugin
631
+ :safe_mode: false
632
+
633
+ You can also view and edit these configuration options from the commandline
634
+ using the `yard config` command. To list your configuration, use `yard config --list`.
635
+ To view a key, use `yard config ITEM`, and to set it, use `yard config ITEM VALUE`.
636
+
637
+ <a name="extending"></a>
638
+
639
+ ## Extending YARD
640
+
641
+ There are many ways to extend YARD to support non-standard Ruby syntax (DSLs),
642
+ add new meta-data tags or programmatically access the intermediate metadata
643
+ and documentation from code. An overview of YARD's full architecture can be
644
+ found in the {file:docs/Overview.md} document.
645
+
646
+ For information on adding support for Ruby DSLs, see the {file:docs/Handlers.md}
647
+ and {file:docs/Parser.md} architecture documents.
648
+
649
+ For information on adding extra tags, see {file:docs/Tags.md}.
650
+
651
+ For information on accessing the data YARD stores about your documentation,
652
+ look at the {file:docs/CodeObjects.md} architecture document.
653
+
654
+ <a name="templating"></a>
655
+
656
+ ## Templating YARD
657
+
658
+ In many cases you may want to change the style of YARD's templates or add extra
659
+ information after extending it. The {file:docs/Templates.md} architecture
660
+ document covers the basics of how YARD's templating system works.
661
+
662
+ <a name="plugins"></a>
663
+
664
+ ## Plugin Support
665
+
666
+ YARD will allow any RubyGem installed on your system (or in your Gemfile)
667
+ to be loaded as a plugin provided it has a name with the prefix of
668
+ `yard-` or `yard_`. In order to load a plugin, use the `--plugin`
669
+ switch with the short-name (name minus the `yard-` prefix) or full-name
670
+ of the gem:
671
+
672
+ $ gem install yard-custom-plugin
673
+ ...
674
+ $ yard doc --plugin custom-plugin
675
+ or
676
+ $ yard doc --plugin yard-custom-plugin
677
+
678
+ Note: you can also put this switch in your `.yardopts` file. See the
679
+ `.yardopts` section above for more information.
680
+
681
+ You can use this functionality to load a custom plugin that
682
+ [extend](#extending) YARD's functionality. A good example of this
683
+ is the [yard-rspec][yard-rspec] plugin, which adds [RSpec][rspec] specifications
684
+ to your documentation (`yardoc` and `yri`). You can try it out by installing
685
+ the gem or cloning the project and trying the example:
686
+
687
+ $ gem install yard-rspec
688
+
689
+ You can then load the plugin with:
690
+
691
+ $ yard doc --plugin rspec
692
+
693
+ YARD also provides a way to temporarily disable plugins on a per-user basis.
694
+ To disable a plugin create the file `~/.yard/ignored_plugins` with a list
695
+ of plugin names separated by newlines. Note that the `.yard` directory might
696
+ not exist, so you may need to create it.
697
+
698
+ You may find some useful YARD plugins on [RubyGems][RubyGemsQuery] or with
699
+ a [Google advanced query][GoogleAdvancedQuery].
700
+
701
+ [graphviz]:https://www.graphviz.org
702
+ [yard-rspec]:https://github.com/lsegal/yard-spec-plugin
703
+ [rspec]:https://rspec.info
704
+ [GoogleAdvancedQuery]:https://www.google.com/search?q=site%3Arubygems.org+intitle%3A%22yard-%22+OR+intitle%3A%22yard_%22
705
+ [RubyGemsQuery]:https://rubygems.org/search?utf8=%E2%9C%93&query=name%3A+yard