# Here's the whole RenderToMarkdown class inlined into the RenderToHTML.book method: def self.book [ title, css, BOOK.sections.map do |section| [ "## Part #{section.number}. #{section.name}", section.chapters.map do |chapter| [ "### #{chapter.number}. #{chapter.title}", RenderExternalFormats.erb(chapter.content), ] end, ] end.flatten.map do |markdown| RenderExternalFormats.markdown(markdown) end ].flatten.join("\n") end