+
+ return $this->download()->directly($chapterText, $chapterSlug . '.txt');
+ }
+
+ /**
+ * Export a chapter to a simple markdown file.
+ *
+ * @throws NotFoundException
+ */
+ public function markdown(string $bookSlug, string $chapterSlug)
+ {
+ $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug);
+ $chapterText = $this->exportFormatter->chapterToMarkdown($chapter);
+
+ return $this->download()->directly($chapterText, $chapterSlug . '.md');