Sha256: fe23cacf9c9796f13465d4367dd9c69d9ace06b396c1ec2c47afbd7571cc6422
Contents?: true
Size: 1.03 KB
Versions: 17
Compression:
Stored size: 1.03 KB
Contents
require 'pathname' require 'jazzy/jazzy_markdown' require 'jazzy/source_document' module Jazzy module DocumentationGenerator extend Config::Mixin def self.source_docs documentation_entries.map do |file_path| SourceDocument.new.tap do |sd| sd.name = File.basename(file_path, '.md') sd.url = sd.name.downcase.strip .tr(' ', '-').gsub(/[^\w-]/, '') + '.html' sd.type = SourceDeclaration::Type.new 'document.markdown' sd.children = [] sd.overview = overview Pathname(file_path) sd.usr = 'documentation.' + sd.name sd.abstract = '' sd.return = '' sd.parameters = [] end end end def self.overview(file_path) return '' unless file_path && file_path.exist? file_path.read end def self.documentation_entries return [] unless config.documentation_glob_configured && config.documentation_glob config.documentation_glob.select { |e| File.file? e } end end end
Version data entries
17 entries across 17 versions & 1 rubygems