[PR #4805] [CLOSED] Enhanced diagrams.net export functionality #6408

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

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/4805
Author: @cody0704
Created: 1/26/2024
Status: Closed

Base: developmentHead: development


📝 Commits (1)

  • 315d2bb Enhanced diagrams.net export functionality in BookStack

📊 Changes

2 files changed (+26 additions, -3 deletions)

View changed files

📝 dev/docs/javascript-public-events.md (+21 -0)
📝 resources/js/services/drawio.js (+5 -3)

📄 Description

Description

This Pull Request introduces the editor-drawio::export event to the BookStack platform, following the discussion in issue #4156. The primary goal of this enhancement is to provide additional flexibility and customization for the export settings of the diagrams.net integration within BookStack.

New Public Event - editor-drawio::export

  • This event allows for dynamic modification of the diagrams.net export parameters. It is triggered during the export action in the diagrams.net editor embedded within BookStack.
  • Users can now customize export settings based on their specific requirements, such as adjusting the scale, format, or any other diagrams.net supported parameters.

Testing and Validation:

  • The functionality has been tested by implementing custom scripts in the 'Custom HTML Head Content' section of BookStack.
  • Specifically, I verified that adjusting the scale parameter of the export configuration through the new event works as expected, without any issues.

How to Test:

To test this feature, you can add the following script to the 'Custom HTML Head Content' section in BookStack:

window.addEventListener('editor-drawio::export', event => {
    const config = event.detail.config;
    config.scale = 2; // Adjust the scale as needed
});

This script will dynamically adjust the export scale of diagrams.net drawings.


🔄 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/4805 **Author:** [@cody0704](https://github.com/cody0704) **Created:** 1/26/2024 **Status:** ❌ Closed **Base:** `development` ← **Head:** `development` --- ### 📝 Commits (1) - [`315d2bb`](https://github.com/BookStackApp/BookStack/commit/315d2bb23b7652466ecf600e3f97ed8d3ae3027b) Enhanced diagrams.net export functionality in BookStack ### 📊 Changes **2 files changed** (+26 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `dev/docs/javascript-public-events.md` (+21 -0) 📝 `resources/js/services/drawio.js` (+5 -3) </details> ### 📄 Description ### Description This Pull Request introduces the editor-drawio::export event to the BookStack platform, following the discussion in issue #4156. The primary goal of this enhancement is to provide additional flexibility and customization for the export settings of the diagrams.net integration within BookStack. ### New Public Event - editor-drawio::export * This event allows for dynamic modification of the diagrams.net export parameters. It is triggered during the export action in the diagrams.net editor embedded within BookStack. * Users can now customize export settings based on their specific requirements, such as adjusting the scale, format, or any other diagrams.net supported parameters. ### Testing and Validation: * The functionality has been tested by implementing custom scripts in the 'Custom HTML Head Content' section of BookStack. * Specifically, I verified that adjusting the scale parameter of the export configuration through the new event works as expected, without any issues. How to Test: To test this feature, you can add the following script to the 'Custom HTML Head Content' section in BookStack: ```script window.addEventListener('editor-drawio::export', event => { const config = event.detail.config; config.scale = 2; // Adjust the scale as needed }); ``` This script will dynamically adjust the export scale of diagrams.net drawings. --- <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:31:30 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6408