summaryrefslogtreecommitdiff
path: root/lib/rdoc
AgeCommit message (Collapse)Author
2025-01-15Migrate rdoc as bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12577
2025-01-08[ruby/rdoc] Finalize RDoc::Options before callingKazuki Yamaguchi
RDoc::RDoc#parse_files (https://github.com/ruby/rdoc/pull/1274) Commit https://github.com/ruby/rdoc/commit/6cf6e1647b97, which went to v6.5.0, changed `RDoc::Options#parse` to not call `#finish` in it. While the commit adjusted other call sites, it missed `lib/rdoc/rubygems_hook.rb`. `RDoc::Options#finish` prepares the include paths for `:include:` directives. This has to be done before starting to parse sources. I think this should fix https://github.com/ruby/net-http/issues/193 + https://github.com/ruby/net-http/pull/194. https://github.com/ruby/rdoc/commit/d62da8ca09
2025-01-07[ruby/rdoc] Add missing `RDoc::RubygemsHook` API for `gem server`mterada1228
(https://github.com/ruby/rdoc/pull/1270) This PR fixes https://github.com/ruby/rdoc/pull/1269. ## Expected Behavior `gem server` command is successful. ```console $ gem server Server started at http://[::]:8808 Server started at http://0.0.0.0:8808 ``` http://127.0.0.1:8808/ works. ## Actual Behavior `gem server` command doesn't work because `Gem::RDoc.load_rdoc` raises `NoMethodError`. ```console $ gem server ERROR: While executing gem ... (NoMethodError) undefined method 'load_rdoc' for class RDoc::RubygemsHook Gem::RDoc.load_rdoc ^^^^^^^^^^ /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:437:in 'Gem::Server#initialize' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:426:in 'Class#new' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:426:in 'Gem::Server.run' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/commands/server_command.rb:83:in 'Gem::Commands::ServerCommand#execute' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command.rb:326:in 'Gem::Command#invoke_with_build_args' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:253:in 'Gem::CommandManager#invoke_command' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:194:in 'Gem::CommandManager#process_args' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:152:in 'Gem::CommandManager#run' /Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/gem_runner.rb:57:in 'Gem::GemRunner#run' /Users/mterada/.rbenv/versions/3.4.1/bin/gem:12:in '<main>' ``` ## Versions ```console $ rdoc -v 6.10.0 ``` --------- https://github.com/ruby/rdoc/commit/b6a82244a2 Co-authored-by: Sutou Kouhei <[email protected]>
2025-01-03[ruby/rdoc] Fix prism_ruby superclass resolve ordertomoya ishida
(https://github.com/ruby/rdoc/pull/1267) RDoc::Parser::PrismRuby wrongly resolves superclass of `class Cipher < Cipher; end` that exist in openssl. Superclass resolve should be done before adding class. https://github.com/ruby/rdoc/commit/57a4615a92
2025-01-02[DOC] .document under lib/rdoc is split nowNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12495
2025-01-02[ruby/rdoc] [DOC] Ignore racc-generated filesNobuyoshi Nakada
(https://github.com/ruby/rdoc/pull/1265) * [DOC] Ignore racc-generated files Not only `.ry` sources, generated `.rb` files seem duplicate and unnecessary. * [DOC] Select files by .document files for syncing https://github.com/ruby/rdoc/commit/fb7041ec98
2024-12-31[ruby/rdoc] Add autolink_excluded_words option to ignoreStan Lo
cross-references (https://github.com/ruby/rdoc/pull/1259) This config will be handy when the project name is the same as a class or module name, which is often the case for most of the projects. https://github.com/ruby/rdoc/commit/ce77f51f63
2024-12-25[ruby/rdoc] Separate patterns by `--exclude` option from defaultsNobuyoshi Nakada
(https://github.com/ruby/rdoc/pull/1251) https://github.com/ruby/rdoc/commit/a7fdc730f3
2024-12-25[DOC] Fix duplicate entriesNobuyoshi Nakada
A tentative workaround for duplicate entries in "Class and Module Index". Notes: Merged: https://github.com/ruby/ruby/pull/12463
2024-12-19[ruby/rdoc] Bump version to v6.10.0Stan Lo
https://github.com/ruby/rdoc/commit/2b79892ab4 Notes: Merged: https://github.com/ruby/ruby/pull/12394
2024-12-19[ruby/rdoc] Auto-hide navigation on link clickJames Reid-Smith
(https://github.com/ruby/rdoc/pull/1238) Hide navigation sidebar when clicking anchor links on mobile devices. Previously, anchor links would change the page but the navigation sidebar would block the view. https://github.com/ruby/rdoc/commit/f12a96b7fa Notes: Merged: https://github.com/ruby/ruby/pull/12394
2024-12-17[ruby/rdoc] Enable cross reference in codeNobuyoshi Nakada
(https://github.com/ruby/rdoc/pull/1240) Some people like to mark up method names in MarkDown style block quotes, like this: ruby/ruby#12333. Currently, no links are created in the code in the RDoc, but such words most likely refer to methods. This PR makes a word a code cross-reference if the whole word can be resolved as a reference. https://github.com/ruby/rdoc/commit/7d7efb0709
2024-12-17[ruby/rdoc] `aligns` may include `:center`Soutaro Matsumoto
(https://github.com/ruby/rdoc/pull/1247) https://github.com/ruby/rdoc/commit/cbbf04d6f8
2024-12-16[ruby/rdoc] Print warnings for rdoc-ref links that can't be resolvedStan Lo
(https://github.com/ruby/rdoc/pull/1241) https://github.com/ruby/rdoc/commit/4a5206ae56
2024-12-16[ruby/rdoc] Fix to parse `rb_define_global_const`Nobuyoshi Nakada
https://github.com/ruby/ruby/pull/12357 https://github.com/ruby/rdoc/commit/458ecbb7f7
2024-12-16[ruby/rdoc] Bump version to v6.9.1Stan Lo
https://github.com/ruby/rdoc/commit/7cd125e2f0
2024-12-16[ruby/rdoc] Add attribute :force to RDoc::RubygemsHook just liketomoya ishida
RDoc::RubyGemsHook (https://github.com/ruby/rdoc/pull/1244) Rubygems creates an instance of RDoc::RubygemsHook, sets `doc.force = overwrite`, then calls `doc.generate` the document. RDoc::RubygemsHook needs attribute `:force` just like RDoc::RubyGemsHook. https://github.com/ruby/rdoc/commit/01bdbcdd4d
2024-12-15[ruby/rdoc] Hide hamburger on desktopJames Reid-Smith
(https://github.com/ruby/rdoc/pull/1237) * Clean up the duplicate definitions and unnecessary print styling * Hides the navigation toggle when there's enough room to always display the navigation * Update lib/rdoc/generator/template/darkfish/css/rdoc.css --------- https://github.com/ruby/rdoc/commit/c6193bf1e2 Co-authored-by: Stan Lo <[email protected]>
2024-12-15[ruby/rdoc] Fix iPad Pro navigation not shownJames Reid-Smith
(https://github.com/ruby/rdoc/pull/1236) Found this issue when I was debugging the navigation toggle. I noticed it first in the chrome dev tools, but it was also reproducible on an iPad Pro. Symptom: - On iPad Pro, the navigation section is hidden but there's enough space to show it. Making the user have to click the hamburger button to show it but it's not necessary to hide the navigation section. - On desktop, the navigation section is shown. - On mobile, the navigation section is hidden until the hamburger button is clicked. Fix: - The javascript code was matching 1024px instead of 1023px. The media sections of the css was altering the layout on 1024px. So ipad got the full desktop layout but the navigation section was hidden. https://github.com/ruby/rdoc/commit/1794e59755
2024-12-13[ruby/rdoc] Bump version to v6.9.0Stan Lo
https://github.com/ruby/rdoc/commit/dba9474732
2024-12-13Fixed compatibility error with setup command and rdoc plugin on rubygemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12330
2024-12-13Make it loose coupling between RubyGems and RDoc (#1171)mterada1228
* Make it loose coupling between RubyGems and RDoc \### Problems There are following problems because of tight coupling between RubyGems and RDoc. 1. If there are braking changes in RDoc, RubyGems is also broken. 2. When we maintain RDoc, we have to change RubyGems. The reason why they are happened is that RubyGems creates documents about a gem with installing it. Note that RubyGems uses functions of RDoc to create documents. Specifically, - Creating documents is executed by `rubygems/lib/rubygems/rdoc.rb`. - `::RDoc::RubygemsHook` which is defined by RDoc is called by the file. \### Solution RubyGems has the plugin system. If a gem includes `rubygems_plugin.rb`, RubyGems loads it. RubyGems executes a process defined in it while installing gems, uninstalling gems or other events. We can use the system to solve the problems. The root cause is RubyGems directly references the class of RDoc. We can remove the root cause by making RDoc RubyGems plugin. Alternatively `rubygems_plugin.rb` creates documents about gems. \### FAQ Q1. Do we need to change codes of RubyGems? A. No, we don't. This change keeps compatibility of API used from RubyGems. Q2. Is it better to delete existing codes related to RDoc in RubyGems? No, it isn't. If we change codes of RubyGems, we can't keep a compatibility. Example: If we delete codes that uses `RDoc::RubygemsHook` in `rubygems/lib/rubygems/rdoc.rb`, documentations are not created with old RDoc. Q3. When can we delete `rubygems/lib/rubygems/rdoc.rb`? A. We can delete it when all users use RDoc including `rubygems_plugin`. Next ruby version is 3.4. If it includes the RDoc including `rubygems_plugin`, we can delete `rubygems/lib/rubygems/rdoc.rb` after ruby 3.3 is EOL. Q4. Is it a breaking change that Rubygems creates documents with rubygems_plugin not RDoc::RubygemsHook? A. No, it isn't. If we simply implement this approach, we move the implementation from `rdoc/lib/rdoc/rubygems_hook.rb` to `rubygems_plugin.rb`. This way can be breaking change. It seems to be fine that we just need to delete `rdoc/rubygems_hook.rb` but it doesn't work. It generates multiple documents. `rubygems/lib/rubygems/rdoc.rb` has the following code. ``` begin require "rdoc/rubygems_hook" # ... rescue LoadError end ``` This code ignores RDoc related processes when `rdoc/rubygems_hook` can't be required. But, this 'require' is not failed. This is because Ruby installs Rdoc as a default gem. So, Rdoc installed as a default gem generates documents and one installed as a normal gem does it too. If you think that this behavior is accectable, we can just delete `rdoc/rubygems_hook.rb`. What do you think about this approach? In this change, we take another approach to solve the problem that creates multiple documents. If `Gem.done_installing(&Gem::RDoc.method(:generation_hook))` in `rubygems/rdoc.rb` doesn't create documents, we can solve the problem. We have some options. * We change `rubygems/rdoc.rb` and then don't execute `Gem.done_installing`. (This is a change for RubyGems.) * We change `rdoc/rubygems_hook.rb` and then make `generation_hook` a no-op method. (This is a change for RDoc.) We choose the latter to avoid changing for RubyGems. \### Test \#### Preparation Install Rdoc which including our changes by executing `rake install`. ❯ rake install We confirmed that Rdoc which including our changes was installed. ❯ gem list | grep rdoc rdoc (6.6.0, default: 6.4.0) \#### Check point We tested to check compatibility. How to chack the compatibility? We tested creating same documents by our RDoc and old RDoc with latest RubyGems. We used following versions to test. ``` ❯ ruby -v ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin22] ❯ gem list | grep rdoc rdoc (default: 6.4.0) ❯ ruby -I rubygems/lib rubygems/exe/gem --version 3.5.14 ``` Here is a result of test with old RDoc. We can see that the document is created correctlly with `Parsing...` and `Done installing...`. ``` ❯ ruby -I rubygems/lib rubygems/exe/gem install pkg-config Successfully installed pkg-config-1.5.6 Parsing documentation for pkg-config-1.5.6 Done installing documentation for pkg-config after 0 seconds 1 gem installed ``` Here is a result of test with our RDoc. We can see that the document is created correctlly with `Parsing...` and `Done installing...`. ``` ❯ ruby -I rubygems/lib rubygems/exe/gem install pkg-config Successfully installed pkg-config-1.5.6 Parsing documentation for pkg-config-1.5.6 Done installing documentation for pkg-config after 0 seconds 1 gem installed ``` As you can see we got the same results, our RDoc keeps compatibility. * rename a test file * Revert "rename a test file" This reverts commit 70a144bf3fb8f2cc653972e858b5fed3747765d7. * revert a test class name * exclude `TestRDocRubyGemsHook` at job of ruby-core * When `rubygems_plugin.rb` is not found, `test_rdoc_rubygems_hook.rb` is skipped. * remove unnecessary whitespace * add comment * Add support for the case that RDoc is installed as a default gem * Fix problems Co-authored-by: mterada1228 <[email protected]> * Simplify * removed unused blank lines and revert test * for rerun tests * add comment for rubygems_plugin.rb --------- Co-authored-by: Sutou Kouhei <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]>
2024-12-09[ruby/rdoc] Expand rdoc-ref targets at the end of ri outputStan Lo
(https://github.com/ruby/rdoc/pull/1141) There have been several document refactors in ruby/ruby that extract individual methods/classes' documentation into separate files, like ruby/ruby#6567 Because RI is not capable of rendering those references, RI users are left with dramatically fewer documentation on those methods/classes. This commit adds a new option `--expand-ref` (default: true) to expand all the rdoc-ref targets at the end of the output. https://github.com/ruby/rdoc/commit/9e2b28c6e3
2024-12-08[ruby/rdoc] lint: Remove unreachable codeOKURA Masafumi
(https://github.com/ruby/rdoc/pull/1137) This is an attempt to utilize RuboCop further. RuboCop was added in https://github.com/ruby/rdoc/commit/9262fdd43a3a but only a few rules have been enabled. I believe we can utilize RuboCop more for better code quality, especially with Lint cops. This is the first step to enable other Lint cops. This commit also exclude some auto generated files. https://github.com/ruby/rdoc/commit/a53287fce0
2024-12-08[ruby/rdoc] Use distinct styles for note lists and label listsnicholas a. evans
(https://github.com/ruby/rdoc/pull/1209) * Use the original `label` description list style As a default for all description lists, the original "label" style is more readable. This is slightly different from the original `label` dl though: * slightly increased left margin for `dd` (to 1em) * removed right margin on `dd` * removed `dt` bottom margin and `dd` top margin, to reduce the gap between the term and its description (to only the standard line-height gap). * Add closing tags for description list terms Without the closing tags, the dt elements contain whitespace after the text. This normally isn't a big deal, but does mess some things up, e.g: using `::after` with `content: ", "` in stylesheets. * Restore float:left style for note lists Unlike the original note list styles, this version sets the line-height for all `dt` elements to be the same as the `p` elements contained inside the `dd`, so that the second line has the same indentation as all subsequent lines. * Add commas between note list terms https://github.com/ruby/rdoc/commit/9e69ea6d75
2024-12-05[ruby/rdoc] Deprecate `main` and `title` directivesStan Lo
(https://github.com/ruby/rdoc/pull/1218) * Deprecate :main: directive * Deprecate :title: direcive * Update documentation * Remove :main: directive's usage * Update test cases * Add '.rdoc_options' to suggested alternatives https://github.com/ruby/rdoc/commit/e2d4ac9dad
2024-12-03Reapply "[ruby/rdoc] fix: C variables should never show up in Ancestors tree"Hiroshi SHIBATA
This reverts commit 0fe82ae087130d7f360cc0607be93995cedbdb16. Notes: Merged: https://github.com/ruby/ruby/pull/12233
2024-12-02[ruby/rdoc] Prefer String#ord to #codepoints[0]Mike Dalessio
(https://github.com/ruby/rdoc/pull/1220) https://github.com/ruby/rdoc/commit/09d7f35420 Co-authored-by: Nobuyoshi Nakada <[email protected]>
2024-12-02[ruby/rdoc] ClassModule#superclass= accepts a ClassModule as anMike Dalessio
argument (https://github.com/ruby/rdoc/pull/1222) It is necessary for ClassModule's instance variable @superclass to always be a String (or nil) so that the class can be saved with `#marshal_dump` and loaded with `#marshal_load`. However, there's no type checking being done, which allows a bug like the one reported in #1221 (which was introduced in #1217) that sets superclass to a ClassModule. That bug requires: - setting a superclass to a NormalClass - marshal_save - marshal_load (which raises an exception) With this change, passing a ClassModule to ClassModule#superclass= is explicitly allowed by saving the full name of the ClassModule in the @superclass instance variable. https://github.com/ruby/rdoc/commit/9ced6d534c
2024-12-02Revert "[ruby/rdoc] fix: C variables should never show up in Ancestors tree"Hiroshi SHIBATA
This reverts commit 2923f42ed7622f6310c63aab4c0abf05402f9a04. https://github.com/ruby/actions/actions/runs/12108034481/job/33755653615#step:23:1031 ``` /home/runner/work/actions/actions/snapshot-master/lib/rdoc/code_object.rb:322:in 'RDoc::CodeObject#parent': undefined method 'find_class_or_module' for nil (NoMethodError) from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/code_object/class_module.rb:342:in 'RDoc::ClassModule#marshal_dump' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:878:in 'Marshal.dump' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:878:in 'block in RDoc::Store#save_class' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:877:in 'IO.open' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:877:in 'RDoc::Store#save_class' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:763:in 'block in RDoc::Store#save' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:762:in 'Array#each' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:762:in 'RDoc::Store#save' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/generator/ri.rb:27:in 'RDoc::Generator::RI#generate' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:528:in 'block in RDoc::RDoc#generate' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:522:in 'Dir.chdir' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:522:in 'RDoc::RDoc#generate' from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:501:in 'RDoc::RDoc#document' from ./tool/rdoc-srcdir:27:in '<main>' ```
2024-11-30[ruby/rdoc] Methods are sorted symbols-firstMike Dalessio
(https://github.com/ruby/rdoc/pull/1219) There are three distinct ranges of symbols in ASCII: - the range below "A", 0..64 in decimal - the range between "Z" and "a", 91..96 in decimal - the range above "z", 123..127 in decimal With this change, any method starting with a character in these "symbol ranges" will be sorted before a method starting with an alpha ASCII character. The remaining methods, all starting with alpha or 8-bit characters, will be sorted against each other exactly as before. Specifically this addresses the issue from #1204 which is that `#[]` and `#^` were previously sorted _after_ the alpha methods. These methods will now be sorted before alpha methods. Fixes https://github.com/ruby/rdoc/pull/1204 https://github.com/ruby/rdoc/commit/a4f13d242b
2024-11-30[ruby/rdoc] fix: C variables should never show up in Ancestors treeMike Dalessio
(https://github.com/ruby/rdoc/pull/1217) If a NormalClass's superclass is a C enclosure, then update the superclass to point to the RDoc::NormalClass. This is done in a single pass after all files have been parsed. Fixes https://github.com/ruby/rdoc/pull/1205. https://github.com/ruby/rdoc/commit/1ecd9581b1
2024-11-28[ruby/rdoc] Improve how gemspec's files are definedStan Lo
(https://github.com/ruby/rdoc/pull/1212) Currently, the gemspec's files are defined by hand, which is error-prone. For example: https://github.com/ruby/rdoc/pull/1211 This commit uses `Dir.glob` where possible to reduce the risk of that happening again. - Additional files added with this approach: ``` # This should have been added by only captured by this commit lib/rdoc/parser/prism_ruby.rb # These are folders and can be included/ignored either way lib/rdoc/generator/template/darkfish lib/rdoc/generator/template/darkfish/css lib/rdoc/generator/template/darkfish/fonts lib/rdoc/generator/template/darkfish/images lib/rdoc/generator/template/darkfish/js lib/rdoc/generator/template/json_index lib/rdoc/generator/template/json_index/js ``` - Files that are ignored after this change: ``` # They make no difference on documentation generation # Probably can be removed lib/rdoc/generator/template/darkfish/.document lib/rdoc/generator/template/json_index/.document ``` https://github.com/ruby/rdoc/commit/ac2a151f10
2024-11-19[ruby/rdoc] Bump version to v6.8.1Stan Lo
https://github.com/ruby/rdoc/commit/9a7ab17f40
2024-11-19[ruby/rdoc] Update rdoc.gemspecIhor Shevkun
(https://github.com/ruby/rdoc/pull/1211) https://github.com/ruby/rdoc/commit/10596827f0
2024-11-19[ruby/rdoc] Bump up v6.8.0Hiroshi SHIBATA
https://github.com/ruby/rdoc/commit/cf09b2ebb8
2024-11-18[ruby/rdoc] Extract excerpt from raw pages correctlyStan Lo
(https://github.com/ruby/rdoc/pull/1200) Fixes https://bugs.ruby-lang.org/issues/20862 https://github.com/ruby/rdoc/commit/3c678249e2
2024-11-13[ruby/rdoc] Split list of class and instance methods in twoAlexis Bernard
(https://github.com/ruby/rdoc/pull/1206) Looking for a method is easier because eyes don't have to skip dashes or double colon. https://github.com/ruby/rdoc/commit/6852567640
2024-11-04[ruby/rdoc] Display class ancestors in the sidebar #1183Alexis Bernard
https://github.com/ruby/rdoc/commit/50dda13426
2024-10-31[ruby/rdoc] Use thicker fonts with high contrast to improveStan Lo
readability (https://github.com/ruby/rdoc/pull/1197) https://github.com/ruby/rdoc/commit/7fb0e509ec
2024-10-25[ruby/rdoc] Remove details markers in HTML documentsNobuyoshi Nakada
`summary {list-style: none;}` still does not work in Safari 18. https://github.com/ruby/rdoc/commit/c6a0a6a0d5
2024-10-23[ruby/rdoc] Red-based darkfish color schemeStan Lo
(https://github.com/ruby/rdoc/pull/1191) * Cleanup rdoc.css * Use red as the highlight color * Use the same red as ruby-lang.org * Make main section links stand out more * Remove scrollbar styling https://github.com/ruby/rdoc/commit/f69dc470ac
2024-10-17[ruby/rdoc] feature: Render mixed-in methods and constants withMike Dalessio
`--embed-mixins` (https://github.com/ruby/rdoc/pull/842) * Embed mixed-in methods and constants with `--embed-mixins` When `--embed-mixins` option is set: - methods from an `extend`ed module are documented as singleton methods - attrs from an `extend`ed module are documented as class attributes - methods from an `include`ed module are documented as instance methods - attrs from an `include`ed module are documented as instance attributes - constants from an `include`ed module are documented Sections are created when needed, and Darkfish's template annotates each of these mixed-in CodeObjects. We also respect the mixin methods' visibility. This feature is inspired by Yard's option of the same name. * Add comment to document why we set object visibility Co-authored-by: Stan Lo <[email protected]> * Add the mixin_from attribute to CodeObject's initializer * Add test coverage for private mixed-in attributes. --------- https://github.com/ruby/rdoc/commit/481c2ce660 Co-authored-by: Stan Lo <[email protected]>
2024-10-17[ruby/rdoc] Use scroll-margin-top on anchor targetsStan Lo
(https://github.com/ruby/rdoc/pull/1190) This will make the anchor target easier to read. https://github.com/ruby/rdoc/commit/e2fe4882f4
2024-10-17[ruby/rdoc] Add scroll-margin-top on all :target elementsMads Ohm Larsen
(https://github.com/ruby/rdoc/pull/1174) https://github.com/ruby/rdoc/commit/7398e5b0ad Co-authored-by: Stan Lo <[email protected]>
2024-10-15[ruby/rdoc] Generate meta tags based on page's contentVinicius Stock
(https://github.com/ruby/rdoc/pull/1091) https://github.com/ruby/rdoc/commit/716bc16a7d
2024-10-10[ruby/rdoc] Make methods and attributes linkableStan Lo
(https://github.com/ruby/rdoc/pull/1189) * Use the same color for both class/module and method highlight * Make methods and attributes linkable https://github.com/ruby/rdoc/commit/7757fd9fe4
2024-10-10[ruby/rdoc] Improve method source togglingStan Lo
(https://github.com/ruby/rdoc/pull/1176) * Move method source block to the top Currently, if a method description is long (e.g. `Array.new`), users need to click the method toggle button next to the method title, and then scroll down to the source code expanded below the description. This commit changes the behavior so that the source code is expanded immediately below the method title. * Update method toggle's interface 1. Display the method toggle button by default instead of displaying on hover 2. Only toggle the source code when clicking the method toggle button, not when clicking the entire method title section. This will allow us to display an anchor link next to the method title 3. Simplify the toggle source button's appearance * Use details tag for method toggling * Rename method-click-advice to method-source-toggle * Improve method controls' display on mobile By moving the method controls out of the method header, we can display them to the right of the method name on desktop, and below the method name on mobile. * Add "Example" label to example code blocks The label should help users distinguish example code blocks from other code blocks, such as method source code. It's only applied to Ruby code examples. * Revert "Add "Example" label to example code blocks" This reverts commit https://github.com/ruby/rdoc/commit/69fc9ce6a379. * Give source code blocks a different background color * Change targeted method's highlighting color to work better with the new method source https://github.com/ruby/rdoc/commit/e608a84af3
2024-10-07[ruby/rdoc] Use normal `font-weight` for linksSam Bostock
(https://github.com/ruby/rdoc/pull/1188) https://github.com/ruby/rdoc/commit/b53f0cb2ed
2024-10-03[ruby/rdoc] Fix ToRdoc#accept_tabletomoya ishida
(https://github.com/ruby/rdoc/pull/1184) https://github.com/ruby/rdoc/commit/7b68545094