Converting Gemtext to HTML with Elixir

April 29, 2023

I spent a few hours this Saturday afternoon writing and releasing gemtext_to_html v0.1.0. I'd like to spend more time browsing and developing for Gemini space, and this is the first step towards making something Elixir-y to that end.

It ships with basic HTML components, but of course you can define your own components using regular old Phoenix Components and HEEx templates.

=> Hex package | Documentation | Source

Example

defmodule MyApp.MyComponents do
  @behaviour GemtextToHTML.Components
  import Phoenix.Component

  def h1(assigns) do
    ~H"""
    

<%= @text %>

""" end # ...and so on... end gemtext = """ # Hello, world * this is a list * indeed pretty neat """ GemtextToHTML.render_to_string(gemtext, components: MyApp.MyComponents) # => "

Hello, world

" <> ...

Navigation

=> Home | Posts | Pursuits | About

=> View on the web

Proxy Information
Original URL
gemini://gmi.schrockwell.com/posts/2023-04-29-gemtext-to-html.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
643.968125 milliseconds
Gemini-to-HTML Time
0.394781 milliseconds

This content has been proxied by September (3851b).