Whinis' Webpage
About Me
Hobbies
Projects
Random Pictures

ReText Project Editor Post


Created :04-13-2021
Last Updated:04-15-2021 20:12
Why I modified ReText to use Databases rather than files

My Quest for a Sane Markdown Editor

Reasons For Doing This

I thought that this would be easier than it was. I am getting towards the end of the graduate degree and decided to bring my website out of disrepair to increase my chances of getting a job. One of such things was adding in a projects blog to cover what I have done at work as well as at home. So I figured I would make a simple blog to do such, I didn't want a bloated CMS software with tons of security holes however for a simple project blog.

Issues With Making A Blog

So the first issue that comes to mind is that I needed some sort of editor for the projects and the post associated with the post. I had a simple set of requirements

  • Can create projects
  • Each project can have post
  • Each project and post can have a short description
  • Each project and post can have preview image
  • Projects or Post can be hidden from the public page
  • Each post should be easily edited and not need a ton of custom HTML
  • Should link to my gitlab for most projects

The last one was a part of an issue that I thought would be easy to solve. I have worked on a few projects with markdown and there are many markdown parsers that make post editing a sort of wysiwyg editor. So I searched for PHP and JavaScript markdown editors and found largely complicated projects with multiple libraries and difficult to edit source codes. Maybe that work for integration easily into CMS systems or something else but their user interface was lacking and more importantly integration would be near impossible. Being that I already had a PHP website even if simple I had no interest in making things more complicated than they needed to be, I also already had content hosting and a database. Then I found ReText

Modifying ReText For The Worse

So ReText obviously lacks all of the above requirements namely it works with files and not a database. I could have decided to just upload the markdown files I make and have some sort of indexing system however ReText has a nice interface and is easily modifiable. It took me just a few minutes to make a dialog and connect to to a local database to create posts and then not much longer for projects. Even better since its not hosted on my website I need not worry as strongly about securing the interface, it lives as a exe on my computer that I can move around with.

As such I added in a config for mysql connection information and then added in SSH tunnel config as all of my databases are not open to the internet and need a tunnel. Finally I ripped out most of the file handling and just had it display dialogs with the required options. A few days of debugging and I can make post, edit post, delete post, and the same for projects. This post was typed on ReText

Links to the PHP code and modified python below

RetextQL

RetextQL Viewer