mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Merge branch 'markdown-export' of https://github.com/nikhiljha/BookStack-1 into nikhiljha-markdown-export
This commit is contained in:
@ -52,4 +52,24 @@ class BookExportController extends Controller
|
||||
$textContent = $this->exportFormatter->bookToPlainText($book);
|
||||
return $this->downloadResponse($textContent, $bookSlug . '.txt');
|
||||
}
|
||||
|
||||
/**
|
||||
* Export a book as a markdown file.
|
||||
*/
|
||||
public function markdown(string $bookSlug)
|
||||
{
|
||||
$book = $this->bookRepo->getBySlug($bookSlug);
|
||||
$textContent = $this->exportService->bookToMarkdown($book);
|
||||
return $this->downloadResponse($textContent, $bookSlug . '.md');
|
||||
}
|
||||
|
||||
/**
|
||||
* Export a book as a zip file, made of markdown files.
|
||||
*/
|
||||
public function zip(string $bookSlug)
|
||||
{
|
||||
$book = $this->bookRepo->getBySlug($bookSlug);
|
||||
$filename = $this->exportService->bookToZip($book);
|
||||
return response()->download($filename);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user