Well I at least figured out what Matlab is doing, to a point. Debug stepping through doc() it eventually gets the html with this command:
html = help2html(topic,'','-doc');
I can simply write this html to a text file, and it displays in Help or a web browser okay but the format is messed up, not pretty like what doc() spits out. If you continue passed this where the html string is created, it goes through a bunch of mumbo jumbo, pre-pending a 'text://' string to the html string, and finally gets to a nested function
doc() >> showHelpwin() >> helpwin() >> displayFile() >> web() >> openMatlabBrowser()
Inside of this function it calls
which is where the magic happens. But you can't step into this function, and you can't get an output from it. I think inside of here the html is being massaged to look nice, but I still don't see a way to capture the result. I can't even right click and "Get Page Source" because the result is blank.