# gmi.js
## A bridge between the DOM and Gemini
gmi.js is made up of lines!
```js
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.
```js
line.type = "UL"
line.content = "now\nit's\na\nlist"
```
A document provides a way to handle many lines together:
```js
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
```js
window.gmi.source
```
> or maybe a .gmi file would be easier?
```js
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
```
=> /css/ learn more about gmi.css
=> https://git.sr.ht/~talon/gmi-web/tree gmi.js is licensed under CC0 and available on sourcehut as apart of gmi-web
### [WIP] editing!
* enter creates new P
* shift + enter creates newline
* backspace at beginning of line doesn't remove DOM (+ delete on empty lines)
* cross-platform action for changing line type?
* cross-platform action for toggling editable?