From e60ea3500eab27b2e5f887514fdfcb5882dfb15e Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 19 Aug 2024 13:20:16 +0100 Subject: [PATCH 1/2] Align behaviour between `bundle exec rdoc` and `rake rdoc` By using `.rdoc_options` to specify the RDoc options, we can make most of the rake task options the in-repo defaults. This allows us to use the same options for both `bundle exec rdoc` and `rake rdoc` and get a consistent experience. --- .document | 4 ++-- .rdoc_options | 8 ++++++++ Rakefile | 6 ++---- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .rdoc_options diff --git a/.document b/.document index d892ce9cf8..03c06a1ce0 100644 --- a/.document +++ b/.document @@ -1,7 +1,7 @@ History.txt LICENSE.txt README.txt -RI.txt -RI.md +*.md +*.rdoc lib doc diff --git a/.rdoc_options b/.rdoc_options new file mode 100644 index 0000000000..54d977f238 --- /dev/null +++ b/.rdoc_options @@ -0,0 +1,8 @@ +exclude: + - lib/rdoc/rd/block_parser.ry + - lib/rdoc/rd/inline_parser.ry + - lib/rdoc/markdown.kpeg + - lib/rdoc/markdown/literals.kpeg +op_dir: _site # for GH pages and should match the config of RDoc task in Rakefile +title: rdoc Documentation +main_page: README.rdoc diff --git a/Rakefile b/Rakefile index 6f1e3d1b4e..1de46fe359 100644 --- a/Rakefile +++ b/Rakefile @@ -21,10 +21,8 @@ task :default => :test task rdoc: :generate RDoc::Task.new do |doc| - doc.main = 'README.rdoc' - doc.title = "rdoc #{RDoc::VERSION} Documentation" - doc.rdoc_dir = '_site' # for github pages - doc.rdoc_files = FileList.new %w[lib/**/*.rb *.rdoc *.md doc/rdoc/markup_reference.rb] - PARSER_FILES + # RDoc task defaults to /html and overrides the op_dir option in .rdoc_options + doc.rdoc_dir = "_site" # for github pages end task "coverage" do From c5bff8706408d5e11d0eb9dfbe9230d20a940a13 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Wed, 21 Aug 2024 15:40:51 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Olle Jonsson --- .rdoc_options | 2 +- Rakefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rdoc_options b/.rdoc_options index 54d977f238..2826c2d5e8 100644 --- a/.rdoc_options +++ b/.rdoc_options @@ -3,6 +3,6 @@ exclude: - lib/rdoc/rd/inline_parser.ry - lib/rdoc/markdown.kpeg - lib/rdoc/markdown/literals.kpeg -op_dir: _site # for GH pages and should match the config of RDoc task in Rakefile +op_dir: _site # for GitHub Pages and should match the config of RDoc task in Rakefile title: rdoc Documentation main_page: README.rdoc diff --git a/Rakefile b/Rakefile index 1de46fe359..7680c2867f 100644 --- a/Rakefile +++ b/Rakefile @@ -22,7 +22,7 @@ task :default => :test task rdoc: :generate RDoc::Task.new do |doc| # RDoc task defaults to /html and overrides the op_dir option in .rdoc_options - doc.rdoc_dir = "_site" # for github pages + doc.rdoc_dir = "_site" # for GitHub Pages end task "coverage" do