Is it possible to specify an external program that will preprocess a file before it is displayed in view mode?

What I’m trying to do

Given a markdown file X and a program P that reads text files and returns text output, I would like to configure Obsidian so that it calls P on X and renders the output whenever I switch into view mode.

Is this possible?