1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Merge branch 'markdown-export' of https://github.com/nikhiljha/BookStack-1 into nikhiljha-markdown-export

This commit is contained in:
Dan Brown
2021-06-22 19:12:24 +01:00
9 changed files with 124 additions and 4 deletions

View File

@ -60,4 +60,15 @@ class PageExportController extends Controller
$pageText = $this->exportFormatter->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');
}
}