feat(bookstack-api-jt9): implement pages export (Markdown, PDF)
Add doRaw() for non-JSON responses. Implement ExportMarkdown() and ExportPDF() on PagesService returning raw bytes. Add tests.
This commit is contained in:
parent
6944d50512
commit
f2747adcaf
5 changed files with 99 additions and 5 deletions
10
pages.go
10
pages.go
|
|
@ -35,3 +35,13 @@ func (s *PagesService) Get(ctx context.Context, id int) (*Page, error) {
|
|||
}
|
||||
return &page, nil
|
||||
}
|
||||
|
||||
// ExportMarkdown exports a page as markdown.
|
||||
func (s *PagesService) ExportMarkdown(ctx context.Context, id int) ([]byte, error) {
|
||||
return s.client.doRaw(ctx, "GET", fmt.Sprintf("/api/pages/%d/export/markdown", id))
|
||||
}
|
||||
|
||||
// ExportPDF exports a page as PDF.
|
||||
func (s *PagesService) ExportPDF(ctx context.Context, id int) ([]byte, error) {
|
||||
return s.client.doRaw(ctx, "GET", fmt.Sprintf("/api/pages/%d/export/pdf", id))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue