This is a technical description of a new server bridge between two apps, PagePark and Little Outliner. It's now possible to view user-editable files through PagePark as long as they've been made public. This is how the pieces fit together. #
PagePark is a Node-based HTTP server that has special understanding of two kinds of files -- Markdown and OPML. #
For Markdown files, it renders them in a template. So you don't have to repeat the envelope for each bit of text, and it's easy to modify, for all pages. So it's a bit of a CMS for Markdown files. It also can connect directly to GitHub repos, so it can serve from them, which is nice because Markdown is a default format on GitHub. #
PagePark also has a special ability to render OPML files. I use this feature for my this.how site which I've been using to accumulate documents that I want to revise over time. Unlike blog posts, they are not ephemeral. Examples include my Trolling howto and the Google and HTTP doc. #
So to sum up, what's special about PagePark, for this situation, is that it's really good at rendering OPML documents.#
Every file you edit with LO2 is either public or private. #
I have a copy of PagePark running on the same machine as the server that runs Little Outliner. I created a bridge between the two apps, on the server, that allows PagePark to serve from each users' public folder. When you access the page, you'll see a beautifully rendered version, like my this.how documents. Here's an example.#
This might sound complicated, because you've probably never thought of the software that runs these apps. But conceptually it's simple. There's a new bridge between LO2 and PagePark. That bridge is a PagePark plug-in.#
I've been talking about the new plug-in ability for PagePark. I needed that to create this connection. I've designed a lot of plug-in architectures over many years, and this is a good one. All web servers running in JavaScript should consider doing it this way. The plug-in I use for this bridge, is a bit of logic that translates a URL from the outside, to a file in the user's public folder. I've published the source. As you can see, there's not much there. #
To really nail it, it turns this source file into this rendering. That's it. The next step, soon, will be to present a document that explains how to edit and view these files through the new bridge. If you have questions, post a comment here. #
You know those obnoxious sites that pop up dialogs when they think you're about to leave, asking you to subscribe to their email newsletter? Well that won't do for Scripting News readers who are a discerning lot, very loyal, but that wouldn't last long if I did rude stuff like that. So here I am at the bottom of the page quietly encouraging you to sign up for the nightly email. It's got everything from the previous day on Scripting, plus the contents of the linkblog and who knows what else we'll get in there. People really love it. I wish I had done it sooner. And every email has an unsub link so if you want to get out, you can, easily -- no questions asked, and no follow-ups. Go ahead and do it, you won't be sorry! :-)