diff --git a/README.md b/README.md index 6ef1fff..c101fba 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/js.gmi b/docs/js.gmi index dde96b0..dd50db6 100644 --- a/docs/js.gmi +++ b/docs/js.gmi @@ -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? diff --git a/docs/web.gmi b/docs/web.gmi new file mode 100644 index 0000000..efa38c9 --- /dev/null +++ b/docs/web.gmi @@ -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 ↔
+BLOCKQUOTE ↔

+UL ↔

  • +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