Skip to content

Commit

Permalink
Use relative includes of README's in documentation [ci-skip]
Browse files Browse the repository at this point in the history
The Rails documentation uses the `:include:` directive to inline the
README of the framework into the main documentation page. As the
README's aren't in the root directory from where SDoc is run we need to
add the framework path to the include:

    # :include: activesupport/README.md

This results in a warning when installing the gems as generating the rdoc for the gem is run from the gem/framework root:

    Couldn't find file to include 'activesupport/README.rdoc' from lib/active_support.rb

The `:include:` RDoc directive supports includes relative to the current
file as well:

    # :include: ../README.md

This makes sure it works for the Rails API docs and the separate gems.

Co-authored-by: Jonathan Hefner <[email protected]>
  • Loading branch information
2 people authored and viralpraxis committed Mar 24, 2024
1 parent a040d67 commit 7456783
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion actioncable/lib/action_cable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
end.setup

# :markup: markdown
# :include: actioncable/README.md
# :include: ../README.md
module ActionCable
require_relative "action_cable/version"
require_relative "action_cable/deprecator"
Expand Down
2 changes: 1 addition & 1 deletion actionmailbox/lib/action_mailbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
require "action_mailbox/mail_ext"

# :markup: markdown
# :include: actionmailbox/README.md
# :include: ../README.md
module ActionMailbox
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion actionmailer/lib/action_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
require "active_support/core_ext/string/inflections"
require "active_support/lazy_load_hooks"

# :include: actionmailer/README.rdoc
# :include: ../README.rdoc
module ActionMailer
extend ::ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion actiontext/lib/action_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
require "nokogiri"

# :markup: markdown
# :include: actiontext/README.md
# :include: ../README.md
module ActionText
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
require "action_view/version"
require "action_view/deprecator"

# :include: actionview/README.rdoc
# :include: ../README.rdoc
module ActionView
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion activejob/lib/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
require "global_id"

# :markup: markdown
# :include: activejob/README.md
# :include: ../README.md
module ActiveJob
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
require "active_model/version"
require "active_model/deprecator"

# :include: activemodel/README.rdoc
# :include: ../README.rdoc
module ActiveModel
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
require "active_model/attribute_set"
require "active_record/errors"

# :include: activerecord/README.rdoc
# :include: ../README.rdoc
module ActiveRecord
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion activestorage/lib/active_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
require "marcel"

# :markup: markdown
# :include: activestorage/README.md
# :include: ../README.md
module ActiveStorage
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion activesupport/lib/active_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
require "active_support/lazy_load_hooks"
require "active_support/core_ext/date_and_time/compatibility"

# :include: activesupport/README.rdoc
# :include: ../README.rdoc
module ActiveSupport
extend ActiveSupport::Autoload

Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Encoding.default_internal = Encoding::UTF_8
end

# :include: railties/README.rdoc
# :include: ../README.rdoc
module Rails
extend ActiveSupport::Autoload
extend ActiveSupport::Benchmarkable
Expand Down

0 comments on commit 7456783

Please sign in to comment.