-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export: uses markdown preview dom. Supports diagrams #3317
Conversation
Just wondering if this helps with issue #3202 as well? |
I tried the following: $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$ Neither one turned out well. |
@Flexo013 I've added a new commit to allow for properly showing Latex. Sample PDF from branch |
@Flexo013 Does this need any more changes before review? |
This one looks ok to me. Will test this when I get home. |
@ZeroX-DG, did you encounter any issues? |
Somehow when I export to pdf the latex text still disappear. I'm on Linux Mint. |
That's strange, I tried to include the latex font (it was missing when exported) then the pdf export start working again. Then I remove the font completely and it still work. Does it related to cache or something? |
Possibly. I'll setup a Linux VM, and test it out |
Confirm it's a cache issue. When I tried to clear all application data, the bug appears again. Solution for this is to include the katex font when we export the pdf. |
Sorry for the delay. Been racking my brain trying to think of a simpler solution but I think the real solution for the Katex font requires some significant code. Issue layout:
All normal. All CSS references are properly exported, including the /* stylelint-disable font-family-no-missing-generic-family-keyword */
@font-face {
font-family: 'KaTeX_AMS';
src: url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'), url(fonts/KaTeX_AMS-Regular.woff) format('woff'), url(fonts/KaTeX_AMS-Regular.ttf) format('truetype');
font-weight: normal;
font-style: normal;
} Other exporters, like the PDF, locally render the HTML, will pull any sub-referenced assets like the font files. Solution: I think a new ticket should be created to parse through all sub-references to load the assets for the export. I don't know how/which node modules might carry a CSS file that's importing another CSS file, that may be importing yet another CSS file. And I can't seem to get webcontents' handleSaveAsHtml () {
this.exportAsDocument('html', (noteContent, exportTasks, targetDir) => {
const browser = new remote.BrowserWindow({show: false, webPreferences: {webSecurity: false, javascript: false}})
browser.loadURL('data:text/html;charset=UTF-8,' + this.htmlContentFormatter(noteContent, exportTasks, targetDir))
browser.webContents.on('did-finish-load', () => {
browser.webContents.savePage(targetDir, 'HTMLComplete', () => {
browser.destroy()
})
})
})
} |
I propose removing the Katex issues from the |
@shmolf I agree to separate the katex problem into a separate PR. I think the fix is just exporting the fonts to |
Where can I find the fonts dir? |
@Imperator26 When exporting a note, Boostnote will export CSS to a folder called |
Where can I find the fonts folder? |
@Imperator26 you should support Boostnote to create it, because Boostnote currently doesn't export it automatically. |
Description
Changed from re-rendering the Markdown (which doesn't render the SVGs from Mermaid), to referencing the Preview DOM that's already rendered, thereby incorporating the already produced SVGs.
Issue fixed
TestText.txt
TestPDF.pdf
HTML and MD files are not supported by Github, so am not able to attach.
Type of changes
Checklist:
IssueHunt Summary
Referenced issues
This pull request has been submitted to: