Skip to content

Commit b9fbfed

Browse files
authored
Merge branch 'master' into document_is_not_a_comment
2 parents 4955198 + 75d1511 commit b9fbfed

32 files changed

+210
-55
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Checkout
2323
uses: actions/checkout@v4
2424
- name: Setup Ruby
25-
uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
25+
uses: ruby/setup-ruby@1287d2b408066abada82d5ad1c63652e758428d9 # v1.214.0
2626
with:
2727
ruby-version: '3.2'
2828
bundler-cache: true

.github/workflows/push_gem.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323

2424
steps:
2525
- name: Harden Runner
26-
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
26+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
2727
with:
2828
egress-policy: audit
2929

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

3232
- name: Set up Ruby
33-
uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
33+
uses: ruby/setup-ruby@1287d2b408066abada82d5ad1c63652e758428d9 # v1.214.0
3434
with:
3535
bundler-cache: true
3636
ruby-version: ruby

.github/workflows/ruby-core.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ permissions: # added using https://github.com/step-security/secure-workflows
1515

1616
jobs:
1717
ruby_core:
18-
name: RDoc under a ruby-core setup
18+
name: Generate ruby/ruby documentation with the current RDoc commit
1919
runs-on: ubuntu-20.04
2020
strategy:
2121
fail-fast: false
2222
timeout-minutes: 30
2323
steps:
2424
- name: Set up latest ruby head
25-
uses: ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f # v1.206.0
25+
uses: ruby/setup-ruby@1287d2b408066abada82d5ad1c63652e758428d9 # v1.214.0
2626
with:
2727
ruby-version: head
2828
bundler: none
@@ -45,15 +45,26 @@ jobs:
4545
run: |
4646
autoconf
4747
./configure -C --disable-install-doc
48-
make -j2
4948
working-directory: ruby/ruby
5049
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
5150
with:
5251
path: ruby/rdoc
53-
- name: Sync tools
52+
- name: Build RDoc locally
5453
run: |
55-
ruby tool/sync_default_gems.rb rdoc
54+
bundle install
55+
bundle exec rake build:local_ruby
56+
working-directory: ruby/rdoc
57+
- name: Generate Documentation with RDoc
58+
run: make html
5659
working-directory: ruby/ruby
57-
- name: Test RDoc
58-
run: make -j2 -s test-all TESTS="rdoc --no-retry"
60+
# We need to clear the generated documentation to generate them again
61+
# with the Prism parser.
62+
- name: Clear Generated Documentation
63+
run: rm -r .ext/html
5964
working-directory: ruby/ruby
65+
- name: Generate Documentation with RDoc (Prism parser)
66+
run: make html
67+
working-directory: ruby/ruby
68+
env:
69+
RDOC_USE_PRISM_PARSER: true
70+

.github/workflows/test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
with:
1212
# 2.7 breaks `test_parse_statements_nodoc_identifier_alias_method`
1313
min_version: 3.0
14+
versions: '["mswin"]'
1415
engine: cruby-truffleruby
1516

1617
test:
@@ -25,9 +26,11 @@ jobs:
2526
ruby: truffleruby
2627
- os: windows-latest
2728
ruby: truffleruby-head
28-
# Remove it once https://github.com/ruby/setup-ruby/issues/680 is fixed
29-
- os: windows-latest
30-
ruby: 3.4
29+
- os: macos-latest
30+
ruby: mswin
31+
- os: ubuntu-latest
32+
ruby: mswin
33+
3134
runs-on: ${{ matrix.os }}
3235
steps:
3336
- uses: actions/checkout@v4 # v3.3.0

.rdoc_options

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
exclude:
2-
- lib/rdoc/rd/block_parser.ry
3-
- lib/rdoc/rd/inline_parser.ry
4-
- lib/rdoc/markdown.kpeg
5-
- lib/rdoc/markdown/literals.kpeg
61
op_dir: _site # for GitHub Pages and should match the config of RDoc task in Rakefile
72
title: rdoc Documentation
83
main_page: README.rdoc
94
warn_missing_rdoc_ref: true
5+
autolink_excluded_words:
6+
- RDoc

Rakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,19 @@ task :clean do
9999
end
100100
end
101101

102+
desc "Build #{Bundler::GemHelper.gemspec.full_name} and move it to local ruby/ruby project's bundled gems folder"
103+
namespace :build do
104+
task local_ruby: :build do
105+
target = File.join("..", "ruby", "gems")
106+
107+
unless File.directory?(target)
108+
abort("Expected Ruby to be cloned under the same parent directory as RDoc to use this task")
109+
end
110+
111+
mv("#{path}.gem", target)
112+
end
113+
end
114+
102115
begin
103116
require 'rubocop/rake_task'
104117
rescue LoadError

doc/rdoc/markup_reference.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,7 @@
996996
# and entire <tt>rdoc-ref:</tt> square-bracketed clause is removed
997997
# from the resulting text.
998998
#
999-
# - <tt>Nosuch[rdoc-ref:RDoc::Nosuch]</tt> generates
1000-
# Nosuch[rdoc-ref:RDoc::Nosuch].
999+
# - <tt>Nosuch[rdoc-ref:RDoc::Nosuch]</tt> generates Nosuch.
10011000
#
10021001
#
10031002
# [<tt>rdoc-label</tt> Scheme]

lib/rdoc/generator/darkfish.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,14 @@ def generate_index
316316
asset_rel_prefix = rel_prefix + @asset_rel_path
317317

318318
@title = @options.title
319+
@main_page = @files.find { |f| f.full_name == @options.main_page }
319320

320321
render_template template_file, out_file do |io|
321322
here = binding
322323
# suppress 1.9.3 warning
323324
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
325+
# some partials rely on the presence of current variable to render
326+
here.local_variable_set(:current, @main_page) if @main_page
324327
here
325328
end
326329
rescue => e

lib/rdoc/generator/template/darkfish/index.rhtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
<%= render '_sidebar_search.rhtml' %>
88
</div>
99

10+
<%= render '_sidebar_table_of_contents.rhtml' if defined?(current) %>
1011
<%= render '_sidebar_pages.rhtml' %>
1112
<%= render '_sidebar_classes.rhtml' %>
1213

1314
<%= render '_footer.rhtml' %>
1415
</nav>
1516

1617
<main role="main">
17-
<%- if @options.main_page and
18-
main_page = @files.find { |f| f.full_name == @options.main_page } then %>
19-
<%= main_page.description %>
18+
<%- if @main_page %>
19+
<%= @main_page.description %>
2020
<%- else -%>
21-
<p>This is the API documentation for <%= h @title %>.
21+
<p>This is the API documentation for <%= h @title %>.
2222
<%- end -%>
2323
</main>

lib/rdoc/markdown/.document

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.rb

0 commit comments

Comments
 (0)