Skip to content

Html Export Facilities, part 1#4582

Closed
dbolack-ab wants to merge 7 commits intonaturalcrit:masterfrom
dbolack-ab:HTMLDownload
Closed

Html Export Facilities, part 1#4582
dbolack-ab wants to merge 7 commits intonaturalcrit:masterfrom
dbolack-ab:HTMLDownload

Conversation

@dbolack-ab
Copy link
Copy Markdown
Collaborator

@dbolack-ab dbolack-ab commented Jan 9, 2026

Description

This is the first part of a proposed feature extension that allows for downloading the Brew Render as HTML.

Downloads will be available as

  • HTML - The same output as the brewRender window, with any relative paths altered to be fully expanded
  • Zipped - An archive of the Brew Render with all external files in a tree structure and file references altered to match

This also adds the /embed endpoint, which is a modified version of share without the tool and navbar. This is for external embedding or services like DocRaptor to ingest.

Currently only downloads the HTML from the brewRender window with no URL massaging ( all relative path references are still relative ) and a default filename.

Related Issues or Discussions

To Do

  • HTML
    • Best Effort rewrite local, relative paths
  • Zip
    • Create Zip
    • Rewrite Paths for CSS to local-to-zip path
    • Store CSS in Zip
    • Rewrite image paths
    • Store Images in zip

Adds menu items for "regular", zipped, and inline output.

Currently only displays inline output with *no* URL massaging ( all relative path references are still relative )

Displays, not downloads
Copy link
Copy Markdown
Member

@calculuschild calculuschild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general idea here is OK to me. Personally, I would say the .zip is the most useful, followed by the "slim".

My main feedback is that this added helper simulateRenderPage() is nearly identical to the existing page render function, so there is a lot of duplication and now two places we need to maintain if the rendering sequence changes.

My preferred approach would actually be to just grab the already-generated HTML straight from the DOM, similar to what we do for generating the PDF. Is that possible to reduce the duplication?

@calculuschild calculuschild added the 🔍 R3 - Reviewed - Awaiting Fixes 🔧 PR is okayed but needs fixes before merging label Feb 4, 2026
@dbolack-ab
Copy link
Copy Markdown
Collaborator Author

The general idea here is OK to me. Personally, I would say the .zip is the most useful, followed by the "slim".

Based on the unclear requests and general non-answers to follow-up questions, these three modes all seem to be equally requested. "Slim" is the most obvious as it should be handy for embedding or passing to an external process, like DocRaptor, similar to the way the old print endpoint did.

I can see an argument for dropping inline if we insist that the zipfile adds all remote files to the archive ( probably everyone's assumption? )

My preferred approach would actually be to just grab the already-generated HTML straight from the DOM, similar to what we do for generating the PDF. Is that possible to reduce the duplication?

I don't know that that is a bad idea but in order to work in all the scenarios I am targeting it would mean taking the HTML and posting it to the endpoint. That could be a bit.. large.

At the moment, I don't recall what all I trimmed out/adapted - maybe we could consolidate the duplication even if it means a slightly more challenging to read function/functions.

This duplicates the share endpoint. It uses the Share Page template
with a boolean for share vs embed to toggle displaying the navbar
and toolbar.

Added a showToolbar property to brewRender to toggle... showing
the toolbar.
Still requires path manipulation.

Stubs the same for Zipfiles.
@dbolack-ab dbolack-ab added the 🔍 R_ - Not ready for review 🕑 PR under draft or an experiment label Feb 24, 2026
@calculuschild calculuschild temporarily deployed to homebrewery-pr-4582 February 27, 2026 15:59 Inactive
@dbolack-ab dbolack-ab closed this Feb 27, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in @calculuschild's backlog Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔍 R_ - Not ready for review 🕑 PR under draft or an experiment 🔍 R3 - Reviewed - Awaiting Fixes 🔧 PR is okayed but needs fixes before merging

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants