Skip to content

Commit 586813d

Browse files
committed
RDoc::Task can now set the comment markup through #markup
1 parent 7e014b5 commit 586813d

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

History.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
it is used as the default for the entire file. For other comments it
2323
overrides the default markup format.
2424

25+
The markup format can be set for rake tasks using RDoc::Task#markup
26+
2527
* Minor enhancements
2628
* HTML headings now have ids matching their titles.
2729

TODO.rdoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Some file contains some things that might happen in RDoc, or might not
44

55
* Copy static files into doc dir for HTML
66
* Add sections to the ToC
7-
* Add a markup option to RDoc::Task
87

98
=== RDoc 3.11
109

lib/rdoc/task.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ class RDoc::Task < Rake::TaskLib
100100

101101
attr_accessor :name
102102

103+
##
104+
# Comment markup format. rdoc, rd and tomdoc are supported. (default is
105+
# 'rdoc')
106+
107+
attr_accessor :markup
108+
103109
##
104110
# Name of directory to receive the html output files. (default is "html")
105111

@@ -249,11 +255,12 @@ def define
249255

250256
def option_list
251257
result = @options.dup
252-
result << "-o" << @rdoc_dir
253-
result << "--main" << main if main
254-
result << "--title" << title if title
255-
result << "-T" << template if template
256-
result << '-f' << generator if generator
258+
result << "-o" << @rdoc_dir
259+
result << "--main" << main if main
260+
result << "--markup" << markup if markup
261+
result << "--title" << title if title
262+
result << "-T" << template if template
263+
result << '-f' << generator if generator
257264
result
258265
end
259266

test/test_rdoc_task.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ def test_inline_source
3333
end
3434
end
3535

36+
def test_markup_option
37+
rdoc_task = RDoc::Task.new do |rd|
38+
rd.markup = "tomdoc"
39+
end
40+
41+
assert_equal %w[-o html --markup tomdoc], rdoc_task.option_list
42+
end
43+
3644
def test_tasks_creation
3745
RDoc::Task.new
3846
assert Rake::Task[:rdoc]

0 commit comments

Comments
 (0)