Class: Legion::Docs::SiteGenerator
- Inherits:
-
Object
- Object
- Legion::Docs::SiteGenerator
- Defined in:
- lib/legion/docs/site_generator.rb
Constant Summary collapse
- GUIDE_SOURCES =
[ { source: 'docs/getting-started.md', title: 'Getting Started', section: 'guides' }, { source: 'docs/overview.md', title: 'Architecture', section: 'guides' }, { source: 'docs/extension-development.md', title: 'Extension Development', section: 'guides' }, { source: 'docs/best-practices.md', title: 'Best Practices', section: 'guides' }, { source: 'docs/protocol/LEGION_WIRE_PROTOCOL.md', title: 'Wire Protocol', section: 'protocol' } ].freeze
- SECTIONS =
Legacy constant — preserved so existing code that references SECTIONS still works.
GUIDE_SOURCES.freeze
Instance Method Summary collapse
-
#generate ⇒ Object
Generate the full static site.
-
#initialize(output_dir: 'docs/site') ⇒ SiteGenerator
constructor
A new instance of SiteGenerator.
Constructor Details
#initialize(output_dir: 'docs/site') ⇒ SiteGenerator
Returns a new instance of SiteGenerator.
31 32 33 34 |
# File 'lib/legion/docs/site_generator.rb', line 31 def initialize(output_dir: 'docs/site') @output_dir = output_dir @pages = [] end |
Instance Method Details
#generate ⇒ Object
Generate the full static site.
Returns a hash with :output, :sections, :pages, and :files keys.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/legion/docs/site_generator.rb', line 39 def generate FileUtils.mkdir_p(@output_dir) generate_guides generate_cli_reference generate_extension_reference generate_index { output: @output_dir, sections: GUIDE_SOURCES.size, pages: @pages.size, files: @pages.map { |p| p[:file] } } end |