3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/fastlane/documentation/docs_generator.rb', line 3
def self.run(ff, output_path = nil)
output_path ||= File.join(Fastlane::FastlaneFolder.path || '.', 'README.md')
output = ["fastlane documentation"]
output << "================"
output << "# Installation"
output << "```"
output << "sudo gem install fastlane"
output << "```"
output << "# Available Actions"
all_keys = ff.runner.lanes.keys.reject(&:nil?)
all_keys.unshift(nil)
all_keys.each do |platform|
lanes = ff.runner.lanes[platform]
if lanes.nil? || lanes.empty? || lanes.all? { |_, lane| lane.is_private }
next
end
output << "## #{formatted_platform(platform)}" if platform
lanes.each do |lane_name, lane|
next if lane.is_private
output << render(platform, lane_name, lane.description.join("\n\n"))
end
output << ""
output << "----"
output << ""
end
output << "This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run."
output << "More information about fastlane can be found on [https://fastlane.tools](https://fastlane.tools)."
output << "The documentation of fastlane can be found on [GitHub](https://github.com/fastlane/fastlane/tree/master/fastlane)."
output << ""
File.write(output_path, output.join("\n"))
UI.success "Successfully generated documentation at path '#{File.expand_path(output_path)}'" if $verbose
end
|