Method: Documented::Renderer#render
- Defined in:
- lib/renderer.rb
#render(file_path) ⇒ Object
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 |
# File 'lib/renderer.rb', line 8 def render(file_path) # file_names = [ # "README.md", # ] # file_names.each do |file_name| # file = File.read(File.join(@gem_path, "output", file_name)) # File.open(File.join(@output_path, file_name), 'w+') do |f| # f.write file # end # end Documented.sequences.each do |sequence| file_name = File.basename(file_path, File.extname(file_path)) + '.md' directory = File.join(@output_path, file_name) output = <<~TEXT ```mermaid sequenceDiagram; #{sequence.map { |step| " #{step}" }.join("\n")} ```` TEXT File.write(directory, output) end end |