obsidian-execute-code
obsidian-execute-code copied to clipboard
[FR] Render executed code in PDF
Obsidian ignores the output blocks that contain the results of the execution. Is there some way to show them in the PDF?
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!
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.