I don't know the answer. I've never done something like this before. But be sure to check the API docs. The function processMarkdown() might do what you want.
I was looking at the GRAV hooks and found onOutputGenerated. It mentions that the output is now html. So how do I gain access to this string?
I have just submitted a new plugin content-edit to the GRAV team.
The aim is to offer frontend editing. With an <iframe> any route can be seen on some servers. I have tried processMarkdown(), but the plain vanilla function doesn't return anything, eg., the html.
The API docs are not that complete or easy to understand unless you already understand them :(
@finanalyst After some digging using the debugger, I found a variable 'output' in the object tree of '$this->grav'. This variable 'output' contains HTML. With some trial and error I finally found it can be accessed using:
PHP
$html=$this->grav['output'];
Somehow this output is already populated in 'onPageInitialized'...
@finanalyst When I edit the page in vscode and refresh the browser, 'output' contains the new HTML. So it probably isn't from cache. Whether cache is enabled/disabled also does not make a difference.
I think I have solved the problem. Not quite the same as you have done (basically because I too don't understand how the final html should be ready so early). Also, I want the html rendering of a route that is not the current route.
@finanalyst Have discovered the same. The redirect jump out immediately.
I also wondered how you would display a page's full HTML inside a <div> without collisions...
Back in the days when I used Joomla, they used an inline editor. A loggedin user get's an extra 'edit' link in the page. On clicking it, an editor was injected.
So, instead of trying to inject the HTML of a page into the 'editor' page, the current page gets the editor injected.