[PR #761] [MERGED] Improve export consistency between HTML and PDF types #882

Closed
opened 2026-03-03 00:23:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/761
Author: @Komediruzecki
Created: 1/9/2021
Status: Merged
Merged: 3/20/2021
Merged by: @Rokt33r

Base: masterHead: feature/improve-export-consistency


📝 Commits (1)

  • 9254c9a Improve export consistency between HTML and PDF types

📊 Changes

5 files changed (+540 additions, -304 deletions)

View changed files

📝 src/components/organisms/NoteContextView.tsx (+35 -22)
📝 src/components/organisms/NotePageToolbar.tsx (+24 -26)
📝 src/lib/db/utils.ts (+4 -0)
📝 src/lib/exports.ts (+473 -256)
📝 webpack.config.ts (+4 -0)

📄 Description

Improve export consistency between HTML and PDF types (#754)

  • Add remark-admonitions for html generation
  • Update metadata for html generation
  • Refactor HTML export to use custom HTML generated previously for PDF only
  • Refactor export functions
  • Replace preferences object with actual needed preferences
  • Update conversion functions for saving note document with shortcut
  • Export css attachments for HTML
  • Export css stylesheets
  • Link css stylesheets in HTML string for HTML export
  • Refactor PDF links update in markdown (remove HTML handling)
  • Refactor shortcut saving HTML and Markdown
    • Add saveFolder and saveName
  • Update logic for production paths (use API and dev variable)
  • Add katex fonts exporting and katex.min.css instead of jsdeliver link

Error handling:

  • When writing note attachment or asset fails, it is skipped
  • User is notified of missing assets in console (consider pushMessage?)

Preview:
The export structure as described in #754
ExportsWithKatexFonts

HTML rendering of admonitions:
HTML_RenderingAdmonitions

Exported HTML and then printed PDF in Firefox (emojis work):
MarkdownFunctionalityFirefoxRendering.pdf
HTML & Assets:
Markdown Functionality Test.zip

Tests:

  • Tried exporting with shortcut ctrl+s with type Markdown, PDF and HTML

  • Tried exporting with export buttons with type Markdown, PDF, and HTML

    • HTML is exported with assets (CSS files, CSS fonts, and attachments if any)
    • Markdown is exported only with attachments (no need for CSS)
    • PDF is exported as one file (embedded with attachments, stylesheets are rendered)
  • In electron Linux App (dev)

  • In electron Linux App production version (appImage)


🔄 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/BoostIO/BoostNote-App/pull/761 **Author:** [@Komediruzecki](https://github.com/Komediruzecki) **Created:** 1/9/2021 **Status:** ✅ Merged **Merged:** 3/20/2021 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `feature/improve-export-consistency` --- ### 📝 Commits (1) - [`9254c9a`](https://github.com/BoostIO/BoostNote-App/commit/9254c9a083716d1bac8327cf2582e1e391963a63) Improve export consistency between HTML and PDF types ### 📊 Changes **5 files changed** (+540 additions, -304 deletions) <details> <summary>View changed files</summary> 📝 `src/components/organisms/NoteContextView.tsx` (+35 -22) 📝 `src/components/organisms/NotePageToolbar.tsx` (+24 -26) 📝 `src/lib/db/utils.ts` (+4 -0) 📝 `src/lib/exports.ts` (+473 -256) 📝 `webpack.config.ts` (+4 -0) </details> ### 📄 Description **Improve export consistency between HTML and PDF types** (#754) - Add remark-admonitions for html generation - Update metadata for html generation - Refactor HTML export to use custom HTML generated previously for PDF only - Refactor export functions - Replace preferences object with actual needed preferences - Update conversion functions for saving note document with shortcut - Export css attachments for HTML - Export css stylesheets - Link css stylesheets in HTML string for HTML export - Refactor PDF links update in markdown (remove HTML handling) - Refactor shortcut saving HTML and Markdown - Add saveFolder and saveName - Update logic for production paths (use API and dev variable) - Add katex fonts exporting and katex.min.css instead of jsdeliver link **Error handling:** - When writing note attachment or asset fails, it is skipped - User is notified of missing assets in console (consider pushMessage?) Preview: The export structure as described in #754 ![ExportsWithKatexFonts](https://user-images.githubusercontent.com/18196945/104093172-1dddbb80-5289-11eb-8c64-59be2a0eba18.png) HTML rendering of admonitions: ![HTML_RenderingAdmonitions](https://user-images.githubusercontent.com/18196945/104093180-2df59b00-5289-11eb-8613-377a34c7a06a.png) **Exported HTML and then printed PDF in Firefox (emojis work):** [MarkdownFunctionalityFirefoxRendering.pdf](https://github.com/BoostIO/BoostNote.next/files/5791194/MarkdownFunctionalityFirefoxRendering.pdf) **HTML & Assets:** [Markdown Functionality Test.zip](https://github.com/BoostIO/BoostNote.next/files/5791196/Markdown.Functionality.Test.zip) Tests: - Tried exporting with shortcut `ctrl+s` with type Markdown, PDF and HTML - Tried exporting with export buttons with type Markdown, PDF, and HTML - HTML is exported with assets (CSS files, CSS fonts, and attachments if any) - Markdown is exported only with attachments (no need for CSS) - PDF is exported as one file (embedded with attachments, stylesheets are rendered) - In electron Linux App (dev) - In electron Linux App production version (appImage) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:23:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/BoostNote-App#882
No description provided.