debian-mirror-gitlab/lib/tasks/gitlab/graphql.rake

27 lines
611 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
return if Rails.env.production?
namespace :gitlab do
2019-12-04 20:38:33 +05:30
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference")
TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/'
2019-09-30 21:07:59 +05:30
namespace :graphql do
desc 'GitLab | Generate GraphQL docs'
task compile_docs: :environment do
renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options)
renderer.render
puts "Documentation compiled."
end
end
end
def render_options
{
output_dir: OUTPUT_DIR,
template: Rails.root.join(TEMPLATES_DIR, 'default.md.haml')
}
end