diff options
author | Stan Lo <[email protected]> | 2024-12-05 19:36:28 +0800 |
---|---|---|
committer | git <[email protected]> | 2024-12-05 11:36:34 +0000 |
commit | 2ecd2fe0ed251f9946d5322d96cbfaf61ccbdd65 (patch) | |
tree | 031e8efe7795cb645b95abd2dc6730733c07c8c0 /lib/rdoc/parser | |
parent | 866f1a1f2d6f0425b1535fb5697a30404e83e7c2 (diff) |
[ruby/rdoc] Deprecate `main` and `title` directives
(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
Diffstat (limited to 'lib/rdoc/parser')
-rw-r--r-- | lib/rdoc/parser/c.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb index 4050d7aa49..8a1bf821ce 100644 --- a/lib/rdoc/parser/c.rb +++ b/lib/rdoc/parser/c.rb @@ -1097,15 +1097,34 @@ class RDoc::Parser::C < RDoc::Parser # */ # # This method modifies the +comment+ + # Both :main: and :title: directives are deprecated and will be removed in RDoc 7. def look_for_directives_in context, comment @preprocess.handle comment, context do |directive, param| case directive when 'main' then @options.main_page = param + + warn <<~MSG + The :main: directive is deprecated and will be removed in RDoc 7. + + You can use these options to specify the initial page displayed instead: + - `--main=#{param}` via the command line + - `rdoc.main = "#{param}"` if you use `RDoc::Task` + - `main_page: #{param}` in your `.rdoc_options` file + MSG '' when 'title' then @options.default_title = param if @options.respond_to? :default_title= + + warn <<~MSG + The :title: directive is deprecated and will be removed in RDoc 7. + + You can use these options to specify the title displayed instead: + - `--title=#{param}` via the command line + - `rdoc.title = "#{param}"` if you use `RDoc::Task` + - `title: #{param}` in your `.rdoc_options` file + MSG '' end end |