Skip to content

Commit de28ca3

Browse files
committed
Lookup for doc/index.md as main file
1 parent c549b84 commit de28ca3

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lib/rorvswild_theme_rdoc/site.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,19 @@ def initialize(project, version)
145145
end
146146

147147
def build(src_dir, doc_dir)
148-
versionned_dir = File.join(doc_dir, @url)
149-
title = "#{@project.url} #{@version.number} documentation"
150-
options = ["--root=#{src_dir}", "--include=#{src_dir}/doc", "--title=#{title}", "--main=#{main_file(src_dir)}", "--output=#{versionned_dir}", "--template=rorvswild"]
148+
options = {
149+
root: src_dir,
150+
template: "rorvswild",
151+
main: main_file(src_dir),
152+
output: File.join(doc_dir, @url),
153+
include: File.join(src_dir, "doc"),
154+
title: "#{@project.url} #{@version.number} documentation",
155+
}.map { |(key,val)| "--#{key}=#{val}" }
151156
RDoc::RDoc.new.document(options)
152157
end
153158

154159
def main_file(src_dir)
155-
["README.md", "README.rdoc", "README"].find { |file| File.exist?(File.join(src_dir, file)) }
160+
["doc/index.md", "README.md", "README.rdoc", "README"].find { |file| File.exist?(File.join(src_dir, file)) }
156161
end
157162
end
158163

0 commit comments

Comments
 (0)