Skip to content

Commit 76d2202

Browse files
committed
Deprecate :main: directive
1 parent ac2a151 commit 76d2202

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

lib/rdoc/markup/pre_process.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ def handle_directive prefix, directive, param, code_object = nil,
187187
include_file filename, prefix, encoding
188188
when 'main' then
189189
@options.main_page = param if @options.respond_to? :main_page
190+
warn <<~MSG
191+
The :main: directive is deprecated and will be removed in RDoc 7.
192+
193+
Use `--main=#{param}` to specify the initial page displayed.
194+
If you use `RDoc::Task`, use `rdoc.main = "#{param}"` instead.
195+
MSG
190196

191197
blankline
192198
when 'nodoc' then

lib/rdoc/parser/c.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,13 @@ def look_for_directives_in context, comment
11031103
case directive
11041104
when 'main' then
11051105
@options.main_page = param
1106+
1107+
warn <<~MSG
1108+
The :main: directive is deprecated and will be removed in RDoc 7.
1109+
1110+
Use `--main=#{param}` to specify the initial page displayed.
1111+
If you use `RDoc::Task`, use `rdoc.main = "#{param}"` instead.
1112+
MSG
11061113
''
11071114
when 'title' then
11081115
@options.default_title = param if @options.respond_to? :default_title=

lib/rdoc/rdoc.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ def parse_files files
407407

408408
return [] if file_list.empty?
409409

410+
# This workaround can be removed after the :main: directive is removed
410411
original_options = @options.dup
411412
@stats.begin_adding
412413

0 commit comments

Comments
 (0)