mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-22 15:57:29 +00:00
basic markdown export
This commit is contained in:
parent
9666c8c0f7
commit
a34a07c610
7 changed files with 84 additions and 0 deletions
app/Http/Controllers
|
@ -55,4 +55,16 @@ class ChapterExportController extends Controller
|
|||
$chapterText = $this->exportService->chapterToPlainText($chapter);
|
||||
return $this->downloadResponse($chapterText, $chapterSlug . '.txt');
|
||||
}
|
||||
|
||||
/**
|
||||
* Export a chapter to a simple markdown file.
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
public function markdown(string $bookSlug, string $chapterSlug)
|
||||
{
|
||||
// TODO: This should probably export to a zip file.
|
||||
$chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug);
|
||||
$chapterText = $this->exportService->chapterToMarkdown($chapter);
|
||||
return $this->downloadResponse($chapterText, $chapterSlug . '.md');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue