obsidian-execute-code icon indicating copy to clipboard operation
obsidian-execute-code copied to clipboard

[FR] Render executed code in PDF

Open twibiral opened this issue 3 years ago • 2 comments

Obsidian ignores the output blocks that contain the results of the execution. Is there some way to show them in the PDF?

twibiral avatar Sep 16 '22 16:09 twibiral

I stepped through the exporting with the debugger, and it seems like Obsidian re-renders the source markdown document for the PDF export. It calls the post-processing functions from registerMarkdownPostProcessor, though, so there's a possibility for showing output. Sorry!

chlohal avatar Oct 03 '22 20:10 chlohal

I've seen one plugin use this to style pdf exports inside a markdown post processor:

const view = plugin.app.workspace.getActiveViewOfType(MarkdownView);
if (view && view.editor) {
    ...
} else {
    //PDF Export 
    ...
}

Not sure at all whether this is best practice though.

mayurankv avatar Jun 05 '23 20:06 mayurankv