Skip to content

Centralize generator setup #1302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions lib/rdoc/generator/darkfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ def get_sorted_module_list classes
# Generate an index page which lists all the classes which are documented.

def generate_index
setup

template_file = @template_dir + 'index.rhtml'
return unless template_file.exist?

Expand Down Expand Up @@ -338,8 +336,6 @@ def generate_index
# Generates a class file for +klass+

def generate_class klass, template_file = nil
setup

current = klass

template_file ||= @template_dir + 'class.rhtml'
Expand Down Expand Up @@ -372,8 +368,6 @@ def generate_class klass, template_file = nil
# Generate a documentation file for each class and module

def generate_class_files
setup

template_file = @template_dir + 'class.rhtml'
template_file = @template_dir + 'classpage.rhtml' unless
template_file.exist?
Expand All @@ -399,8 +393,6 @@ def generate_class_files
# Generate a documentation file for each file

def generate_file_files
setup

page_file = @template_dir + 'page.rhtml'
fileinfo_file = @template_dir + 'fileinfo.rhtml'

Expand Down Expand Up @@ -468,8 +460,6 @@ def generate_file_files
# Generate a page file for +file+

def generate_page file
setup

template_file = @template_dir + 'page.rhtml'

out_file = @outputdir + file.path
Expand Down Expand Up @@ -497,8 +487,6 @@ def generate_page file
# Generates the 404 page for the RDoc servlet

def generate_servlet_not_found message
setup

template_file = @template_dir + 'servlet_not_found.rhtml'
return unless template_file.exist?

Expand Down Expand Up @@ -530,8 +518,6 @@ def generate_servlet_not_found message
# Generates the servlet root page for the RDoc servlet

def generate_servlet_root installed
setup

template_file = @template_dir + 'servlet_root.rhtml'
return unless template_file.exist?

Expand All @@ -557,8 +543,6 @@ def generate_servlet_root installed
# Generate an index page which lists all the classes which are documented.

def generate_table_of_contents
setup

template_file = @template_dir + 'table_of_contents.rhtml'
return unless template_file.exist?

Expand Down
1 change: 1 addition & 0 deletions lib/rdoc/servlet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def generator_for store
generator = RDoc::Generator::Darkfish.new store, @options
generator.file_output = false
generator.asset_rel_path = '..'
generator.setup

rdoc = RDoc::RDoc.new
rdoc.store = store
Expand Down
Loading