Creating a PDF Book from Markdown with BoxLang

Recently I’ve done some blog posts on BoxLang involving Markdown and PDFs, and I was curious if I could put together something that really demonstrated a complete tool of some sort. With that in mind, I built a "book" system where you can author pages in Markdown and use a BoxLang CLI script to generate a resulting PDF. It’s more a POC than a real app, but it was pretty fun to build. Here’s what I did. Functionality At a high level, the book is created from a source of Markdown files. Each Markdown file can use front matter (data on top) to define variables that are evaluated at the time the book is created. You can also use a "global" data file to define... more →
Posted in: JavaScript

Parsing Markdown in BoxLang – Take 2

A long, long time ago, ok, it was last Thursday, I posted about adding Markdown processing to BoxLang via the Flexmark Java library. After posting it, a few folks were curious why I didn’t use the native import process instead of createObject('java', '...') and the answer was simple – I just didn’t think about it! To give you an idea of the difference, let’s first consider the initial version: function markdownToHTML(str) { // .init() is important! ds = createObject("java", "com.vladsch.flexmark.util.data.MutableDataSet","flexmark-all-0.64.8-lib.jar").init(); ps = createObject("java", "com.vladsch.flexmark.parser.Parser","flexmark-all-0.64.8-lib.jar").builder(ds).build();... more →
Posted in: JavaScript

Parsing Markdown in ColdFusion

Welcome to my third, yes, third, ColdFusion post in 2024. Is it a trend? Who knows. That being said, I’m doing some prep work to update my presentation on Google Gemini in preparation for my talk at Adobe’s ColdFusion Summit later this month, I’m updating my Node.js demos to ColdFusion and ran into an interesting issue – converting Markdown responses from Gemini to HTML. Edit: I realized I gave my function at the bottom a dumb name. I updated the code to reflect a better name on 9/18/2024 My first quick Google searches didn’t really mesh well with what I expected, so I asked on the CFML Slack and James Moberg pointed out a few options, but suggested I focus on Flexmark... more →
Posted in: JavaScript