1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

basic markdown export

This commit is contained in:
Nikhil Jha
2020-05-12 21:12:26 -07:00
parent 9666c8c0f7
commit a34a07c610
7 changed files with 84 additions and 0 deletions

View File

@ -53,4 +53,15 @@ class BookExportController extends Controller
$textContent = $this->exportService->bookToPlainText($book);
return $this->downloadResponse($textContent, $bookSlug . '.txt');
}
/**
* Export a book as a markdown file.
*/
public function markdown(string $bookSlug)
{
// TODO: This should probably export to a zip file.
$book = $this->bookRepo->getBySlug($bookSlug);
$textContent = $this->exportService->bookToMarkdown($book);
return $this->downloadResponse($textContent, $bookSlug . '.md');
}
}