Previously, I shared what I felt when writing on WordPress here. I shared that WordPress is no longer the best place for blogging. The reason is, it's just too much. Too much information, too many features I don't need, and most importantly, too much crapware.

For the time being, I am searching for the best platform for blogging/writing. I tried Google Blogger again, Ghost blog, and ClassicPress.

They are all good and feel like just enough. But again, when it comes to customization, it doesn't feel simple. It's way too hard and complex.

You might ask, what do I want to build?

I want a good writing experience. Think of it like having good control, where I can watch what I write being rendered in real-time. 

Why not just WYSIWYG?

I tried to use WYSIWYG editors, but I never found the perfect one for my needs. From TinyMCE to Trix Editor, they are all good, but when it comes to rendering, something is always off. So, in the end, I need to review the raw text again.

Meet Marked

Then I found a simple Markdown previewer from Marked.

Wow, this is what I need. I just need two panels, where one panel is an editor to type in Markdown, and the other panel provides a live render.

From this simple idea, I built activeadmin_mitosis_editor. In the era of AI, it's not hard to pull an idea from my head.

ActiveAdmin is just great; the DSL feels right. I just needed to integrate the idea into ActiveAdmin as a custom input. And there it is, the gem itself is ready to add.

form do |f|
  f.inputs do
    f.input :title
    f.input :slug
    f.input :body, as: :mitosis_editor
    f.input :published
    f.input :published_at, as: :datetime_picker
  end
  f.actions
end

But..

It is just for writing. To render it to the view, I am using another gem, gitlab-glfm-markdown.

div class: "post-content" do
  GLFMMarkdown.to_html(post.body, options: { unsafe: true }).html_safe
end

The experience

With this, it fulfills my own needs. A simple Markdown editor that plugs into ActiveAdmin.

I also added some typing shortcuts:

  1. CTRL + b bold
  2. CTRL + i italic
  3. CTRL + k insert url
  4. CTRL + m insert image

As it lives on Rails, I can also take it much further. Like installing an LLM to correct my typos, etc.