Text, Markdown, PDF & HTML
Published 08/21/2024
When designing this platform, I had written on my personal todo list to include Text, Markdown, PDF and HTML rendering for each post. This feature was on the stretch goals for this project. Since it’s nearing completion I figured it was an okay time to indulge and work on something fun.
Markdownpages are essentially just reading the files directly. The metadata from markdown-script needs to be removed, but other than that it was easy.HTMLpages are just re-using the template rending system we have, this was also easy.PDFpages are painless to implement thanks to the markdown library flexmark-java.Textpages I ended up hacking together as quick as possible, I’m certain there is an official flexmark-java renderer I can use. I’ll switch to that whenever I bother to find it.
Implementing these extra pages meant figuring out the URL paths. My initial thought was to keep it /raw, /text, /pdf, /html. But once I had markdown and html pages finished, it felt better to keep the URLs post.md, post.txt, post.pdf, & post.html.