I’ve published an entirely reworked version of my Markdown Lorem Ipsum API. It’s a fix, but also a major improvement.

The md-lipsum API gives you Lorem Ipsum in Markdown format, ready for use in testing and tools. The original version of it used an external API to generate the Lipsum, but that API has disappeared (as APIs are wont to do). I decided to just build my own. The API I built generates valid HTML markup, and then md-lipsum converts it into nicely-formatted Markdown. Given I was building it myself, I added additional markup and more capabilities.

API v3

The v2 API still works — but redirects to v3 — if you had implemented that anywhere. The v3 API is at https://brettterpstra.com/md-lipsum/api/3/. It takes most of the same path parameters, but adds a new one for mark (to add ==highlights==, separate from emphasis) and removes the prude option. Much like most of my other APIs, the landing page for md-lipsum now has an interactive query builder — just check the boxes you want and you’ll get a URL you can copy. Every time that URL loads, it will be different random content, but with the same elements included. The builder even has a cool but stupid feature where editing the url in the field causes the checkboxes to update based on your changes.

Check out the landing page, set some options, and hit Try to see how it works.

Want HTML Lipsum?

Since I was also building an HTML backend for this, I went ahead and exposed that functionality as well. Rather than using path elements, these options use query parameters, so adding ?html=true to any md-lipsum URL will output raw HTML, adding ?complete=true will output the HTML as a complete document (with <head> and <body>), and adding ?preview=true will display the result as a web page. The latter is handy when you want to quickly test basic DOM operations in your browser’s web inspector, but not much else. But I already had it built, so why not make it available?

Roadmap

This API functions on a relatively small amount of source Lorem Ipsum text. I’d like to increase that a little bit, but I may also make it work with other sources of text. I have an outdated script that makes Lorem Ipsum out of books like Alice in Wonderland and 1984, based on something read about Raingrams many years ago. I think it was Dr. Drang who wrote about that. And there was a great Bacon lipsum generator, among other novelty APIs. I’d like to carry on this tradition with some more interesting sources of text. The issue is that the current version uses large sentence fragments, rather than intelligently restructuring the text to create actual random sentences. That may change as I play more with other text sources.