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:
Oliver Jakoubek 2026-01-30 09:52:10 +01:00
commit f2747adcaf
5 changed files with 99 additions and 5 deletions

View file

@ -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))
}