[PR #2524] [CLOSED] Add Pandoc to API #6018

Closed
opened 2026-02-05 10:22:44 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/2524
Author: @maggie44
Created: 2/1/2021
Status: Closed

Base: masterHead: html-export-package


📝 Commits (1)

📊 Changes

5 files changed (+84 additions, -0 deletions)

View changed files

📝 app/Entities/Tools/ExportFormatter.php (+48 -0)
📝 app/Http/Controllers/Api/BookExportApiController.php (+11 -0)
📝 app/Http/Controllers/Api/ChapterExportApiController.php (+11 -0)
📝 app/Http/Controllers/Api/PageExportApiController.php (+11 -0)
📝 routes/api.php (+3 -0)

📄 Description

This is a proposed endpoint to resolve: https://github.com/BookStackApp/BookStack/issues/2491

As can be seen from the conversation in that thread, adding more complex means of exporting HTML (i.e. via Pandoc or other third party means) may be complex to integrate and to maintain.

Instead, this API endpoint provides the HTML file with its original HREFs that point back to the server hosting BookStack. It provides a much lighter weight file due to images not being encoded into the file, and provides users more options to build on BookStack with their own third party solutions to processing exported content than can be achieved with contained HTML.

My personal use case, as an example, will be to then process this output via Pandoc or WGET to generate an offline version which I have more control over the formats/content/sizes. It will also allow me greater control over extracting embedded videos.

Note: This is for discussion over whether it would be merged. The following further commits are required at a minimum before ready:

  • Integrate the new endpoint in to the API docs (appears to auto generate them, haven't identified how yet).
  • Consider the endpoint names. My suggestion would be to rename the current exportHtml (which is the original contained HTML endpoint) to exportContainedHtml and then have this new endpoint as exportHtml.

Would be helpful hear whether this is within the scope of the project before putting in these other changes.

I would welcome edits from maintainers directly into the repo if you so desire.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/2524 **Author:** [@maggie44](https://github.com/maggie44) **Created:** 2/1/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `html-export-package` --- ### 📝 Commits (1) - [`1999ff4`](https://github.com/BookStackApp/BookStack/commit/1999ff4b3801b05d271e01a87ea6f541d113ccde) Add plainHtml API ### 📊 Changes **5 files changed** (+84 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `app/Entities/Tools/ExportFormatter.php` (+48 -0) 📝 `app/Http/Controllers/Api/BookExportApiController.php` (+11 -0) 📝 `app/Http/Controllers/Api/ChapterExportApiController.php` (+11 -0) 📝 `app/Http/Controllers/Api/PageExportApiController.php` (+11 -0) 📝 `routes/api.php` (+3 -0) </details> ### 📄 Description This is a proposed endpoint to resolve: https://github.com/BookStackApp/BookStack/issues/2491 As can be seen from the conversation in that thread, adding more complex means of exporting HTML (i.e. via Pandoc or other third party means) may be complex to integrate and to maintain. Instead, this API endpoint provides the HTML file with its original HREFs that point back to the server hosting BookStack. It provides a much lighter weight file due to images not being encoded into the file, and provides users more options to build on BookStack with their own third party solutions to processing exported content than can be achieved with contained HTML. My personal use case, as an example, will be to then process this output via Pandoc or WGET to generate an offline version which I have more control over the formats/content/sizes. It will also allow me greater control over extracting embedded videos. Note: This is for discussion over whether it would be merged. The following further commits are required at a minimum before ready: - [x] Integrate the new endpoint in to the API docs (appears to auto generate them, haven't identified how yet). - [ ] Consider the endpoint names. My suggestion would be to rename the current exportHtml (which is the original contained HTML endpoint) to `exportContainedHtml` and then have this new endpoint as `exportHtml`. Would be helpful hear whether this is within the scope of the project before putting in these other changes. I would welcome edits from maintainers directly into the repo if you so desire. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:22:44 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6018