Class: RDoc::Generator::SDoc
- Inherits:
-
Object
- Object
- RDoc::Generator::SDoc
- Includes:
- ERB::Util, SDoc::GitHub, SDoc::Helpers, SDoc::Templatable
- Defined in:
- lib/sdoc/generator.rb
Defined Under Namespace
Classes: FilesTree
Constant Summary collapse
- DESCRIPTION =
'Searchable HTML documentation'- GENERATOR_DIRS =
[File.join('sdoc', 'generator')]
- TREE_FILE =
File.join 'panel', 'tree.js'
- SEARCH_INDEX_FILE =
File.join 'js', 'search_index.js'
- FILE_DIR =
'files'- CLASS_DIR =
'classes'- RESOURCES_DIR =
File.join('resources', '.')
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
readonly
Returns the value of attribute base_dir.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#store ⇒ Object
readonly
The RDoc::Store that is the source of the generated content.
Class Method Summary collapse
Instance Method Summary collapse
- #class_dir ⇒ Object
- #file_dir ⇒ Object
- #generate ⇒ Object
-
#initialize(store, options) ⇒ SDoc
constructor
A new instance of SDoc.
Constructor Details
#initialize(store, options) ⇒ SDoc
Returns a new instance of SDoc.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/sdoc/generator.rb', line 151 def initialize(store, ) @store = store = if .respond_to?('diagram=') .diagram = false end .pipe = true @github_url_cache = {} @template_dir = Pathname.new(.template_dir) @base_dir = Pathname.pwd. @json_index = RDoc::Generator::JsonIndex.new self, end |
Instance Attribute Details
#base_dir ⇒ Object (readonly)
Returns the value of attribute base_dir.
114 115 116 |
# File 'lib/sdoc/generator.rb', line 114 def base_dir @base_dir end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
116 117 118 |
# File 'lib/sdoc/generator.rb', line 116 def end |
#store ⇒ Object (readonly)
The RDoc::Store that is the source of the generated content
121 122 123 |
# File 'lib/sdoc/generator.rb', line 121 def store @store end |
Class Method Details
.setup_options(options) ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/sdoc/generator.rb', line 123 def self.() @github = false .search_index = true opt = .option_parser opt.separator nil opt.separator "SDoc generator options:" opt.separator nil opt.on("--github", "-g", "Generate links to github.") do |value| .github = true end opt.separator nil opt.on("--without-search", "-s", "Do not generate index file for search engines.", "SDoc uses javascript to reference individual documentation pages.", "Search engine crawlers are not smart enough to find all the", "referenced pages.", "To help them SDoc generates a static file with links to every", "documentation page. This file is not shown to the user." ) do .search_index = false end opt.separator nil end |
Instance Method Details
#class_dir ⇒ Object
181 182 183 |
# File 'lib/sdoc/generator.rb', line 181 def class_dir CLASS_DIR end |
#file_dir ⇒ Object
185 186 187 |
# File 'lib/sdoc/generator.rb', line 185 def file_dir FILE_DIR end |
#generate ⇒ Object
166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/sdoc/generator.rb', line 166 def generate @outputdir = Pathname.new(.op_dir).(@base_dir) @files = @store.all_files.sort @classes = @store.all_classes_and_modules.sort # Now actually write the output copy_resources generate_class_tree @json_index.generate generate_file_files generate_class_files generate_index_file generate_search_index if .search_index end |