+
+ return $this->download()->directly($textContent, $chapter->slug . '.txt');
+ }
+
+ /**
+ * Export a chapter as a markdown file.
+ */
+ public function exportMarkdown(int $id)
+ {
+ $chapter = Chapter::visible()->findOrFail($id);
+ $markdown = $this->exportFormatter->chapterToMarkdown($chapter);
+
+ return $this->download()->directly($markdown, $chapter->slug . '.md');