1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +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

@ -63,4 +63,15 @@ class PageExportController extends Controller
$pageText = $this->exportService->pageToPlainText($page);
return $this->downloadResponse($pageText, $pageSlug . '.txt');
}
/**
* Export a page to a simple markdown .md file.
* @throws NotFoundException
*/
public function markdown(string $bookSlug, string $pageSlug)
{
$page = $this->pageRepo->getBySlug($bookSlug, $pageSlug);
$pageText = $this->exportService->pageToMarkdown($page);
return $this->downloadResponse($pageText, $pageSlug . '.md');
}
}