A Desktop HTML Page Builder
Saturday, December 7, 2024
Here's an idea I've been kicking around lately. Remember my old website with its built-in page editor? What if I told you that you could use the same editor on your desktop PC to create HTML pages for your NeoCities or NekoWeb site?
It's true! "But how?" I hear you asking.
Easy. If you're a Linux user, you most likely already have PHP installed on your computer. It's easy to install on Windows, Mac, or Linux if you don't already have it. It installs the same way as any other program.
Here's something you may not know about PHP. It's not just for dynamic website backends. It includes a command line interpreter that allows you to run PHP scripts on your desktop computer. Not only that, it has a built-in Web server for developing on your local machine. The server isn't suitable for running a public website, but it's plenty capable of running a private local website. Here's how we can take advantage of those features.
With a simple two-line shell script — or batch script, in Windows jargon — you can start a Web server and open the site in your Web browser. See where I'm going with this? Running a Web application on your desktop is as easy as pie!
You can even do mentions — "@username" links to other people's sites — without backend scripts or a third-party service. Recall what I've said previously about mentions. They do two things:
- Inform the other person that they've been mentioned.
- Link everybody else to the website of the person being mentioned.
It's not necessary for one website to interact with another. Mentions are meant to notify a person, not a website. That's where IndieWeb's WebMentions gets it wrong.
In the case of a desktop editor, the notification would open in an e-mail client, such as Thunderbird or Outlook. It could also work with a webmail client such as Gmail if your browser is configured to use one for e-mail links. You need only click the Send button in your e-mail client to send the notification.1
You can see how that would be simpler than using a third-party hosted service. And it'd be a hell of a lot simpler than implementing WebMentions on your website, right?
The page builder would generate <script> and <style> tags containing all of the JavaScript and CSS needed — and none of the code that isn't needed — for each page to work.
If you have FTP access to your website, the editor would automagically publish your page. If not, you'd have to use the host's Web-based uploader. Nothing would change about the way you currently publish your pages.
You'd still have to use third-party widgets for guestbooks, hit counters, and so forth. Some things just aren't possible on a static website unless you resort to dodgy Google Office workarounds.
Nevertheless, you'd have a lot of tools for creating feature-rich dynamic pages at your disposal. And I wouldn't have to spend money on domain names and hosting to provide the functionality. It'd be a self-contained app running on your computer. Everybody wins!
My preliminary feasibility studies show that this has a good chance of working as envisioned. I'll flesh the app out some more, and let you know how it goes.
In other nudes, readers have asked about the articles on my old website. Rest assured nothing is lost. I have a full database backup, as well as static HTML versions of all of my old pages. I'll eventually clean them up and offer them here in a zip file for download. If you need certain articles quick for research purposes or whatever, use the pink e-mail button on my front page to request them, and I'll zip them up and send them to you. If you don't remember the page title, just describe what the article was about. I'll probably remember which articles you're talking about.
Update
Sunday, December 15, 2024
I've designed the SQL schema for this app and successfully built a SQLite database from it. The GUI front end for SQLite, called SQLiteStudio, doesn't provide a means for importing a database directly from a SQL file. It'll execute only one query at a time. Ain't nobody got time for that. Fortunately, there's an easy way to do it from the command line:
cat schema.sql | sqlite3 RainMaker.db
The user won't have to worry about that though, as a pre-built database will ship with the app. I'm just passing that tidbit along for those who may wish to modify the app.
I tested sending an e-mail from PHP via ssmtp and my Web host's mail server to my Proton Mail account. After repeated failures, I found this Stack Exchange answer that showed me what I was doing wrong, and it worked.
The first release will be fully automated with FTP, SMTP, and POP3 or IMAP connectivity because I want to streamline my workflow as much as possible. The workarounds previously discussed, using Thunderbird and the NeoCities or NekoWeb file uploader, will be added later if there's enough interest.
The IMAP extension has been deprecated and unbundled from the latest version of PHP. I'll have to find another way to open a mailbox and fetch new messages.2 The goal here is to enable readers to set their mention notification preferences by e-mail reply.
Update
Tuesday, December 17, 2024
I was nosing around in my hosting account yesterday and discovered that it's paid up until April of next year. I could've sworn it was due to expire by the beginning of January at the latest. I think I'm gonna clone this site there for the next few months. When the hosting does expire, I'll become a NekoWeb donor so I can point my domain name here.
Having a site with FTP, IMAP, and SMTP access will enable me to test the page builder without paying for an upgrade to my free hosting and e-mail accounts.
Update
Sunday, December 21, 2024
Here are some screenshots of the article editor. Click the images for a full size view.
1. After writing this article, I learned that notifications can be fully automated. On Linux, this entails installing a sendmail alternative called ssmtp and configuring it with your Gmail account credentials. ⮥
2. I'll probably steal some code from the now-retired Zend Framework for this. ⮥