Sharing what I make & use: Code that runs this web site
Why did I write the code just to run this web site? Let me explain.
I have three activities that I do daily. Reading, doing (or making), and documenting. I read to acquire knowledge necessary for my projects. I quickly prototype my idea. And I write or take pictures or record videos to share what I learned from the projects. I want to be efficient in them.
I've already written about the tools I use to record what I read and share 5, so this post is about the tool to write (document) and share: This web site. I wrote some code on top of Django 6 platform so that I can easily achieve these three goals:
- Write with my favorite editor instead of having to open a web browser and connect to the server.
- Use simple text instead of cumbersome HTML.
- Yet, I want to be expressive in presenting the works and thoughts.
The first two goals are very important in order to focus on what I am writing. If I have to wait for the browser to load the blog editor, my thought process is disrupted. Worse yet, I'd have to rewrite everything if something goes wrong in posting the draft. Thinking of the layout of the page is also a distraction when I write the body of the text. If I have to keep inserting HTML tags as I write, I cannot focus on the body of the text I am writing. But I do not want to come back to the draft just to edit the heading and so on.
The third goal is also very important to me. I like using photographs and even video sometimes to explain what I do, and express my thoughts and feelings. When I have a beautiful picture, I want to present it effectively. The layout of the page should optimize for what I write.
The code is written to achieve those three goals, and here are the features I created:
Write in your favorite editor.
Create and edit posts with your favorite text editor, and post them with a single command, rather than opening a web browser:
python post.py some-article.txt
Use markdown 1 instead of cumbersome HTML.
Draft written in Markdown is more legible than HTML, and produces cleaner HTMLs than wysiwyg HTML editors 2.
Beafutiful preset layouts are just one keyword away.
Although the code is still primitive, and certainly not for a scaling web service, I am happy with what I've achieved so far. The program can be deployed at free of cost hosted at Heroku. The installation is probably nothing for a programmer, but it's probably too much for everybody else. So, the target audience is a little on tech people side. 7
I am thinking to make this website or my other project website 8 a hub for my personal data stock and flow. Posting the blog (or data about my thoughts) is already done through Application Programming Interface. I want to push out more data around my life automatically by extending this API. But the details on the plan is saved for more blog posts in the future.
I realized it when I took time to write a README file for the github repository. I wrote a bare minimum instruction, and realized how many steps one has to take to make the web site up and running. Writing an introduction also made me re-organize the thought behind the reason I coded from the first place. The goals and benefits I described in this post weren't that clear when I coded the first line. Any researches and projects evolve like this no matter how organized the final presentations are. ↩
Original post: April 20, 2014 | Last updated: Nov. 25, 2014