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

Using Cloudflare’s Browser Rendering APIs for Screenshots

I’ve been a Cloudflare fan for a while now, but have mainly focused on their Workers Serverless platform. I was aware, of course, that they did a lot more, but I just haven’t had the time to really look around and explore. Recently I was doing some investigation into "url to screenshot" services and discovered that Cloudflare had this, and not only that, it’s part of a suite of browser APIs that are really freaking awesome. Cloudflare’s Browser Rendering APIs do things like: Get the HTML of a page, but after JavaScript has executed, allowing it to get dynamic HTML Render a PDF to PDF Scrape HTML via selectors Parse out content via JSON schema (I’m absolutely... more →
Posted in: JavaScript

Adding CORS to Your BoxLang APIs

CORS, or Cross-Origin Resource Sharing, has been the bane of my existence at times. Don’t get me wrong, I get the idea behind it. I get why it’s necessary. That being said, I tend to forget about it until I write some client-side JavaScript code that gets hit by it. With that in mind, I thought I’d quickly demonstrate how to build CORS-enabled APIs with BoxLang. It’s incredibly simple, which is good, but you’ll want to keep it in mind when building out your own APIs. What and Why? I’m not going to repeat the full description of CORS available from MDN, but it basically boils down to a security feature in browsers. When executing code on your domain that makes... 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

Links For You (4/19/25)

Normally I preface these posts with little updates and such, but I’m too busy today and am sitting on what could (possibly) be good news. So, let’s just get right into the links, shall we? Translating Live Streams in Real-Time with On-Device AI Models I’ve been real excited about Chrome’s upcoming AI on device efforts, so when my buddy Todd Sharp wrote up a cool demo of it, I had to share. In his post, Todd describes using on device transcription of a video source that then makes use of Chrome’s new AI feature to perform translation on the viewer’s side. Obviously this only works in Chrome Canary, but as an option in the future when it’s mainline, this... more →
Posted in: JavaScript

Build Your Own Localized Events Calendar using Diffbot’s Knowledge Graph

Finding out what’s going on in your city can be a bit of a chore. For me, I use a combination of Facebook, specifically accounts for local organizations and news channels, and our local Reddit forum. This is… haphazard at best. I’m sure local "city wide" calendars exist, but I’m not aware of any that is used by the majority of folks nor do I trust them to actually cover everything going on. Having played with Diffbot’s Knowledge Graph last month ("Automating and Responding to Sentiment Analysis with Diffbot’s Knowledge Graph"), I thought I’d do some digging to see what would be possible via their API. Here’s what I was able to... more →
Posted in: JavaScript

BoxLang Quick Tips – Working with JSON

Welcome to another BoxLang quick tip – today I’m going to focus on working with JSON in BoxLang. Now, as you can probably guess, JSON is natively supported and supports what you would expect, going to and from JSON, but there’s some particularities of the support that may interest you, so I’ve dug into it. As with my other quick tips, you can skip to the video version at the bottom if you prefer. The Basics Converting data to JSON can be done two ways, either via the built in function (BIF) jsonSerialize or the member function toJSON. There’s no difference here, just use what makes sense for you: name = "Raymond"; age = 52; hobbies = ["beer","books","movies","video... more →
Posted in: JavaScript

My First (and Last) Spotify Web App – Music Snob

I’ve been a happy Spotify user for a few years now (I transitioned from Amazon Music after they cut features and generally ticked me off) and as I listen to music a lot, I’ve built a few integrations with their APIs over the years. Those integrations were simple tools that hit my own personal data and were just for fun, but I thought I’d take a crack at building a simple app with their Web API which would allow Spotify users to authenticate and see their own data. I built the app. But I 100% would not recommend working with the Spotify APIs going further. I’ll explain everything that went wrong, why I recommend this and so forth, but if you just want to see the app, scroll... more →
Posted in: JavaScript
1 2 3 95