Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ruby/rdoc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.7.0
Choose a base ref
...
head repository: ruby/rdoc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.12.0
Choose a head ref
Loading
Showing with 6,630 additions and 1,605 deletions.
  1. +2 −4 .document
  2. +12 −0 .generated_files_rubocop.yml
  3. +16 −0 .github/release.yml
  4. +1 −1 .github/workflows/gh-pages.yml
  5. +27 −0 .github/workflows/lint.yml
  6. +46 −0 .github/workflows/push_gem.yml
  7. +70 −0 .github/workflows/ruby-core.yml
  8. +16 −8 .github/workflows/test.yml
  9. +6 −0 .rdoc_options
  10. +15 −3 .rubocop.yml
  11. +2 −0 ExampleMarkdown.md
  12. +2 −0 ExampleRDoc.rdoc
  13. +1 −0 Gemfile
  14. +64 −62 History.rdoc
  15. +2 −0 LICENSE.rdoc
  16. +13 −0 README.rdoc
  17. +842 −0 RI.md
  18. +0 −57 RI.rdoc
  19. +18 −7 Rakefile
  20. +8 −7 TODO.rdoc
  21. +10 −0 bin/console
  22. +22 −28 doc/rdoc/markup_reference.rb
  23. +22 −24 lib/rdoc.rb
  24. +6 −1 lib/rdoc/code_object.rb
  25. +1 −1 lib/rdoc/{ → code_object}/alias.rb
  26. 0 lib/rdoc/{ → code_object}/anon_class.rb
  27. +3 −3 lib/rdoc/{ → code_object}/any_method.rb
  28. +1 −1 lib/rdoc/{ → code_object}/attr.rb
  29. +82 −12 lib/rdoc/{ → code_object}/class_module.rb
  30. +1 −1 lib/rdoc/{ → code_object}/constant.rb
  31. 0 lib/rdoc/{ → code_object}/context.rb
  32. +10 −68 lib/rdoc/{ → code_object}/context/section.rb
  33. 0 lib/rdoc/{ → code_object}/extend.rb
  34. 0 lib/rdoc/{ → code_object}/ghost_method.rb
  35. 0 lib/rdoc/{ → code_object}/include.rb
  36. 0 lib/rdoc/{ → code_object}/meta_method.rb
  37. +17 −5 lib/rdoc/{ → code_object}/method_attr.rb
  38. 0 lib/rdoc/{ → code_object}/mixin.rb
  39. 0 lib/rdoc/{ → code_object}/normal_class.rb
  40. 0 lib/rdoc/{ → code_object}/normal_module.rb
  41. 0 lib/rdoc/{ → code_object}/require.rb
  42. 0 lib/rdoc/{ → code_object}/single_class.rb
  43. +5 −5 lib/rdoc/{ → code_object}/top_level.rb
  44. +11 −1 lib/rdoc/comment.rb
  45. +41 −3 lib/rdoc/generator/darkfish.rb
  46. +1 −1 lib/rdoc/generator/pot/message_extractor.rb
  47. +1 −1 lib/rdoc/generator/pot/po_entry.rb
  48. +23 −0 lib/rdoc/generator/template/darkfish/_head.rhtml
  49. +1 −0 lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml
  50. +20 −11 lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
  51. +3 −8 lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml
  52. +3 −0 lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml
  53. +69 −43 lib/rdoc/generator/template/darkfish/class.rhtml
  54. +380 −399 lib/rdoc/generator/template/darkfish/css/rdoc.css
  55. +11 −10 lib/rdoc/generator/template/darkfish/index.rhtml
  56. +24 −1 lib/rdoc/generator/template/darkfish/js/darkfish.js
  57. +5 −5 lib/rdoc/generator/template/darkfish/page.rhtml
  58. +10 −8 lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml
  59. +5 −2 lib/rdoc/generator/template/darkfish/servlet_root.rhtml
  60. +11 −0 lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
  61. +1 −1 lib/rdoc/markdown.kpeg
  62. +1 −0 lib/rdoc/markdown/.document
  63. +18 −13 lib/rdoc/markup.rb
  64. +2 −2 lib/rdoc/markup/attribute_manager.rb
  65. +19 −12 lib/rdoc/markup/formatter.rb
  66. +26 −6 lib/rdoc/markup/pre_process.rb
  67. +1 −1 lib/rdoc/markup/to_bs.rb
  68. +1 −1 lib/rdoc/markup/to_html.rb
  69. +63 −12 lib/rdoc/markup/to_html_crossref.rb
  70. +5 −5 lib/rdoc/markup/to_rdoc.rb
  71. +78 −12 lib/rdoc/options.rb
  72. +5 −4 lib/rdoc/parser.rb
  73. +26 −2 lib/rdoc/parser/c.rb
  74. +5 −4 lib/rdoc/parser/changelog.rb
  75. +1,099 −0 lib/rdoc/parser/prism_ruby.rb
  76. +7 −305 lib/rdoc/parser/ripper_state_lex.rb
  77. +16 −7 lib/rdoc/parser/ruby.rb
  78. +1 −1 lib/rdoc/parser/simple.rb
  79. +1 −0 lib/rdoc/rd/.document
  80. +6 −3 lib/rdoc/rdoc.rb
  81. +74 −29 lib/rdoc/ri/driver.rb
  82. +90 −8 lib/rdoc/rubygems_hook.rb
  83. +12 −0 lib/rdoc/store.rb
  84. +2 −3 lib/rdoc/task.rb
  85. +1 −7 lib/rdoc/tom_doc.rb
  86. +1 −1 lib/rdoc/version.rb
  87. +23 −0 lib/rubygems_plugin.rb
  88. +6 −176 rdoc.gemspec
  89. +1 −1 test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text
  90. 0 test/rdoc/MarkdownTest_1.0.3/{Tidyness.text → Tidiness.text}
  91. +17 −0 test/rdoc/support/text_formatter_test_case.rb
  92. +8 −8 test/rdoc/test_rdoc_any_method.rb
  93. +11 −11 test/rdoc/test_rdoc_attr.rb
  94. +175 −13 test/rdoc/test_rdoc_class_module.rb
  95. +3 −4 test/rdoc/test_rdoc_code_object.rb
  96. +10 −5 test/rdoc/test_rdoc_comment.rb
  97. +6 −6 test/rdoc/test_rdoc_constant.rb
  98. +4 −5 test/rdoc/test_rdoc_context_section.rb
  99. +174 −2 test/rdoc/test_rdoc_generator_darkfish.rb
  100. +10 −0 test/rdoc/test_rdoc_generator_json_index.rb
  101. +15 −2 test/rdoc/test_rdoc_markdown.rb
  102. +3 −3 test/rdoc/test_rdoc_markdown_test.rb
  103. +21 −7 test/rdoc/test_rdoc_markup_pre_process.rb
  104. +12 −1 test/rdoc/test_rdoc_markup_to_ansi.rb
  105. +12 −1 test/rdoc/test_rdoc_markup_to_bs.rb
  106. +16 −13 test/rdoc/test_rdoc_markup_to_html.rb
  107. +49 −1 test/rdoc/test_rdoc_markup_to_html_crossref.rb
  108. +12 −1 test/rdoc/test_rdoc_markup_to_markdown.rb
  109. +12 −1 test/rdoc/test_rdoc_markup_to_rdoc.rb
  110. +27 −1 test/rdoc/test_rdoc_method_attr.rb
  111. +61 −20 test/rdoc/test_rdoc_options.rb
  112. +35 −38 test/rdoc/test_rdoc_parser.rb
  113. +49 −2 test/rdoc/test_rdoc_parser_c.rb
  114. +4 −5 test/rdoc/test_rdoc_parser_changelog.rb
  115. +1 −1 test/rdoc/test_rdoc_parser_markdown.rb
  116. +2,165 −0 test/rdoc/test_rdoc_parser_prism_ruby.rb
  117. +1 −1 test/rdoc/test_rdoc_parser_rd.rb
  118. +3 −2 test/rdoc/test_rdoc_parser_ruby.rb
  119. +1 −1 test/rdoc/test_rdoc_parser_simple.rb
  120. +1 −1 test/rdoc/test_rdoc_rdoc.rb
  121. +69 −21 test/rdoc/test_rdoc_ri_driver.rb
  122. +35 −5 test/rdoc/test_rdoc_rubygems_hook.rb
  123. +45 −6 test/rdoc/test_rdoc_store.rb
  124. +8 −8 test/rdoc/test_rdoc_top_level.rb
  125. +1 −0 test/rdoc/xref_data.rb
  126. +1 −2 test/rdoc/xref_test_case.rb
6 changes: 2 additions & 4 deletions .document
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
History.txt
LICENSE.txt
README.txt
RI.txt
*.md
*.rdoc
lib
doc
12 changes: 12 additions & 0 deletions .generated_files_rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This rubocop configuration is ONLY for the generated files (listed in Rakefile). It is not meant to be used for RDoc's
# source code.
# The purpose of this file is to ensure the generated files don't have trailing whitespace or empty lines, which could
# be a problem for ruby/ruby's CI
AllCops:
TargetRubyVersion: 3.3
DisabledByDefault: true

Layout/TrailingWhitespace:
Enabled: true
Layout/TrailingEmptyLines:
Enabled: true
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# release.yml

changelog:
categories:
- title: ✨ Enhancements
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 📚 Documentation
labels:
- documentation
- title: 🛠 Other Changes
labels:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
uses: ruby/setup-ruby@2654679fe7f7c29875c669398a8ec0791b8a64a1 # v1.215.0
with:
ruby-version: '3.2'
bundler-cache: true
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on: [push, pull_request]

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
lint:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v3.3.0
# libyaml-dev is needed for psych, see https://github.com/ruby/setup-ruby/issues/409
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install libyaml-dev
- name: Set up Ruby
uses: ruby/setup-ruby@master
with:
ruby-version: 3.3
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop
- name: Sanity check for the format_generated_files task
run: bundle exec rake generate format_generated_files

46 changes: 46 additions & 0 deletions .github/workflows/push_gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish gem to rubygems.org

on:
push:
tags:
- 'v*'

permissions:
contents: read

jobs:
push:
if: github.repository == 'ruby/rdoc'
runs-on: ubuntu-latest

environment:
name: rubygems.org
url: https://rubygems.org/gems/rdoc

permissions:
contents: write
id-token: write

steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Set up Ruby
uses: ruby/setup-ruby@2654679fe7f7c29875c669398a8ec0791b8a64a1 # v1.215.0
with:
bundler-cache: true
ruby-version: ruby

- name: Publish to RubyGems
uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1

- name: Create GitHub release
run: |
tag_name="$(git describe --tags --abbrev=0)"
gh release create "${tag_name}" --verify-tag --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
70 changes: 70 additions & 0 deletions .github/workflows/ruby-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: ruby-core

on:
pull_request:

push:
branches:
- master

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
ruby_core:
name: Generate ruby/ruby documentation with the current RDoc commit
runs-on: ubuntu-20.04
strategy:
fail-fast: false
timeout-minutes: 30
steps:
- name: Set up latest ruby head
uses: ruby/setup-ruby@2654679fe7f7c29875c669398a8ec0791b8a64a1 # v1.215.0
with:
ruby-version: head
bundler: none
- name: Save latest buildable revision to environment
run: echo "REF=$(ruby -v | cut -d')' -f1 | cut -d' ' -f5)" >> $GITHUB_ENV
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
with:
repository: ruby/ruby
path: ruby/ruby
fetch-depth: 10
- name: Checkout the latest buildable revision
run: git switch -c ${{ env.REF }}
working-directory: ruby/ruby
- name: Install libraries
run: |
set -x
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
- name: Build Ruby
run: |
autoconf
./configure -C --disable-install-doc
working-directory: ruby/ruby
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
with:
path: ruby/rdoc
- name: Build RDoc locally
run: |
bundle install
bundle exec rake build:local_ruby
working-directory: ruby/rdoc
- name: Generate Documentation with RDoc
run: make html
working-directory: ruby/ruby
# We need to clear the generated documentation to generate them again
# with the Prism parser.
- name: Clear Generated Documentation
run: rm -r .ext/html
working-directory: ruby/ruby
- name: Generate Documentation with RDoc (Prism parser)
run: make html
working-directory: ruby/ruby
env:
RDOC_USE_PRISM_PARSER: true

24 changes: 16 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,11 @@ permissions: # added using https://github.com/step-security/secure-workflows
jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
# 2.7 breaks `test_parse_statements_nodoc_identifier_alias_method`
min_version: 3.0
versions: '["mswin"]'
engine: cruby-truffleruby

test:
needs: ruby-versions
@@ -21,10 +26,11 @@ jobs:
ruby: truffleruby
- os: windows-latest
ruby: truffleruby-head
- os: windows-latest
ruby: jruby
- os: windows-latest
ruby: jruby-head
- os: macos-latest
ruby: mswin
- os: ubuntu-latest
ruby: mswin

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4 # v3.3.0
@@ -36,14 +42,16 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # 'bundle install' and cache
# Avoid issues on these platforms
- if: ${{ matrix.ruby == '2.6' }}
run: gem update --system
- name: Run test
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
- name: Run test with Prism parser
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
RDOC_USE_PRISM_PARSER: true
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
run: bundle exec rake rdoc
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
run: bundle exec rake rubocop
run: bundle exec rake install
6 changes: 6 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
op_dir: _site # for GitHub Pages and should match the config of RDoc task in Rakefile
title: rdoc Documentation
main_page: README.rdoc
warn_missing_rdoc_ref: true
autolink_excluded_words:
- RDoc
18 changes: 15 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.0
DisabledByDefault: true
Exclude:
- rdoc.gemspec
SuggestExtensions: false

Layout/TrailingWhitespace:
Enabled: true

Layout/TrailingEmptyLines:
Enabled: true

Layout/SpaceAroundKeyword:
Enabled: true

Layout/SpaceBeforeComma:
Enabled: true

Layout/SpaceAfterComma:
Enabled: true

Lint/UnreachableCode:
Enabled: true
2 changes: 2 additions & 0 deletions ExampleMarkdown.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Example Markdown

This document contains example output to show RDoc styling. This file was
created from a Markdown file.

2 changes: 2 additions & 0 deletions ExampleRDoc.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
= Example \RDoc

This document contains example output to show RDoc styling. This file was
created from a RDoc Markup file.

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -10,4 +10,5 @@ group :development do
gem 'test-unit-ruby-core'
gem 'rubocop', '>= 1.31.0'
gem 'gettext'
gem 'prism', '>= 0.30.0'
end
Loading