gmi.js

A bridge between the DOM and Gemini


gmi.js is made up of lines!

const line = Gemini.line("manipulate the dom\nbut like in a Gemini way\ntry it!")
document.body.prepend(line.dom)
now try changing the type and content and observing the effects.
line.type = "UL"
line.content = "now\nit's\na\nlist"


A document provides a way to handle many lines together:

window.gmi = new Gemini(document.body)
window.gmi.lines = [
  Gemini.line("interesting", "H1"),
  Gemini.line("that's convenient"),
  Gemini.line("http://talon.computer/js/ now... take me back please", "A"),
]
window.gmi.lines[0].type = "H3"
the gemtext source is available via .source
window.gmi.source
or maybe a .gmi file would be easier?
window.gmi.download()


All the gmi.css variables are also available as properties.

let foreground = window.gmi.foreground
let background = window.gmi.background
window.gmi.foreground = background
window.gmi.background = foreground
learn more about gmi.css


gmi.js is licensed under CC0 and available on sourcehut as apart of gmi-web


[WIP] editing!


talon.computer