documentation

This commit is contained in:
Talon Poole 2020-12-31 19:04:54 +00:00
parent 4bc91e85c3
commit 92b14274c6
3 changed files with 38 additions and 7 deletions

View file

@ -1,6 +1,6 @@
# gmi-web
## A bridge between Gemini and HTML
Start with [gmi.css](https://talon.computer/css/) and if you're feeling adventurous or perhaps naïve checkout [gmi.js](https://talon.computer/js/)
[documentation](https://talon.computer/web/)
![CC0](https://licensebuttons.net/p/zero/1.0/80x15.png)

View file

@ -15,12 +15,12 @@ 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[2].type = "P"
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
@ -40,10 +40,11 @@ window.gmi.background = foreground
```
=> /css/ learn more about gmi.css
=> https://git.sr.ht/~talon/gmi-web/tree gmi.js licensed under CC0 and available on sourcehut as apart of gmi-web
=> 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 from links/headings creates new P
- backspace at beginning of line doesn't remove DOM (+ delete on empty lines)
- cross-platform action for toggling editable?
- cross-platform action for changing line type?
* 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?

30
docs/web.gmi Normal file
View file

@ -0,0 +1,30 @@
# gmi-web
Due to the ambiguity of HTML several translations from Gemini exist in the wild. I propose the following standard:
```
UL ↔ *
BLOCKQUOTE ↔ >
PRE ↔ ```
A ↔ =>
H[1-3] ↔ #[##]
P
```
> P, UL, BLOCKQUOTE, and PRE may also have newlines which should be inserted as innerHTML using the following rules:
```
P ↔ <br>
BLOCKQUOTE ↔ <div><br></div>
UL ↔ <li><br></li>
PRE (\n is implied hence preformatted)
```
If this standard is respected gmi.css will happily tell modern web browsers how to render your text in a predictable and readable way!
=> /css/ read more about gmi.css
### WIP
This also paves the way for setting contenteditable on the root element and enabling the browsers native HTML document editor. Unfortunately it does not handle a few annoying quirks which may only be addressed with custom JavaScript.
gmi.js is currently under active development but already exposes a Gemini.line function which wraps the DOM API in a Gemini way. This should enable addressing the editability quirks and also provide a foundation for future JS/Gemini mashups.
=> /js/ read more about gmi.js
* accessibility
=> https://git.sr.ht/~talon/gmi-web/ gmi-web is licensed under CC0 and available on sourcehut