Method: RDoc::Parser::C#look_for_directives_in

Defined in:
lib/rdoc/parser/c.rb

#look_for_directives_in(context, comment) ⇒ Object

Look for directives in a normal comment block:

/*
 * :title: My Awesome Project
 */

This method modifies the comment Both :main: and :title: directives are deprecated and will be removed in RDoc 7.



1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
# File 'lib/rdoc/parser/c.rb', line 1107

def look_for_directives_in context, comment
  @preprocess.handle comment, context do |directive, param|
    case directive
    when 'main' then
      @options.main_page = param

      warn "        The :main: directive is deprecated and will be removed in RDoc 7.\n\n        You can use these options to specify the initial page displayed instead:\n        - `--main=\#{param}` via the command line\n        - `rdoc.main = \"\#{param}\"` if you use `RDoc::Task`\n        - `main_page: \#{param}` in your `.rdoc_options` file\n      MSG\n      ''\n    when 'title' then\n      @options.default_title = param if @options.respond_to? :default_title=\n\n      warn <<~MSG\n        The :title: directive is deprecated and will be removed in RDoc 7.\n\n        You can use these options to specify the title displayed instead:\n        - `--title=\#{param}` via the command line\n        - `rdoc.title = \"\#{param}\"` if you use `RDoc::Task`\n        - `title: \#{param}` in your `.rdoc_options` file\n      MSG\n      ''\n    end\n  end\n\n  comment\nend\n"