mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 06:08:19 -04:00
**Motivation**: We have decided to rewrite the documentation generator to add more features to our documentation and to fix some outstanding bugs. This PR addresses the following problem: - Hard to add new features to the code base. - The code was tied with Logstash. - No easy way to publish the doc for a single plugin - The plugin author was not able to test their documentation changes - The reported errors were hard to understand. - No easy way to automate it. - the minimal requirement on base classes. Fixes #5720
26 lines
802 B
Ruby
26 lines
802 B
Ruby
# encoding: utf-8
|
|
require "fileutils"
|
|
|
|
DEFAULT_DOC_DIRECTORY = ::File.join(::File.dirname(__FILE__), "..", "build", "docs")
|
|
|
|
namespace "docs" do
|
|
desc "Generate documentation for all plugins"
|
|
task "generate" do
|
|
Rake::Task['plugin:install-all'].invoke
|
|
Rake::Task['docs:generate-plugins'].invoke
|
|
end
|
|
|
|
desc "Generate the doc for all the currently installed plugins"
|
|
task "generate-plugins", [:output] do |t, args|
|
|
args.with_defaults(:output => DEFAULT_DOC_DIRECTORY)
|
|
|
|
require "bootstrap/environment"
|
|
require "logstash-core/logstash-core"
|
|
LogStash::Bundler.setup!({:without => [:build]})
|
|
|
|
require "logstash/docgen/logstash_generator"
|
|
|
|
FileUtils.mkdir_p(args[:output])
|
|
exit(LogStash::Docgen::LogStashGenerator.new(args[:output]).generate_plugins_docs)
|
|
end
|
|
end
|