I've been using this for years https://github.com/zackad/offmar
It's a userscript for browser, so you need script manager such as Tampermonkey or similar add-on to make it works.
If what you want is to generate pdf you might want to use https://github.com/fmd-project-team/FMD
it's support other...