💾 Archived View for namno.duckdns.org › blog › 2024-04-19.gmi captured on 2024-09-28 at 23:53:47. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-26)

-=-=-=-=-=-=-

Markup Idea

While gemtext was purposefully created limited, I think that those limitations are too much for sufficient use.

In this document I propose alternative to gemtext that will still be minimal.

General Structure

Document first is divided in block-level elements by block-level tags denoted by a bang staring a line. Opening tag is a bang followed by a single letter, which is followed by optional parameter. Closing tag is either a bang followed by newline or a bang followed by a number of elements to close at the same time.

Then document's text is marked up by inline elements, which follow format of

~<single letter element name>[(<optional parameter>)]{<body of element>}

All inline blocks are closed implicitly when they reach end of block element they reside in.

List of block level elements

List of inline elements

Why?

I thought that making forum on gemini would be neat and then realized that gemtext would be a poor fit for that. One could just serve HTML over gemini protocol, but I liked principle simplicity that gemtext have. Also, it's neat being idea guy.

This is of course Work In Progress, critique is very wellcome. Please send it to wed3009@yandex.ru . I'll try to read it.

Block elements

List of block tags

Header, separator

These blocks serve to divide documents into thematic blocks.

!h[level of header][#<fragment id>] <header text>

Header serves as a title of a segment of document. Fragment id, if present, can allow to link to that specific fragment of document. It is a self-closing tag.

!s[#<fragment id>]

Separator tags introduces thematic breaks. Usually it manifests itself as a horisontal line. It is a self-closing tag.

Preformated, code

These blocks both contain content that is usually displayed as monospaced text, although they are different in their semantics. Please note that bangs at the start lines still need to be escaped.

!p [description of preformated text]
<Lines of preformated text>
!

Preformated text, when displayed, should contain monospaced text and should not contain line or word wraping.

Description can be used for non-visual representation of a block, but also for describing non-obvious blocks.

!c[#<starting line number>] [language]
<Lines of code>
!

This is used for containing computer input and output, particularly computer programs. Language can be used for optional syntax highlighting. Also, clients may number lines of this block starting on supplied.

List

!l[#<starting position>][direction] [type]
<first element>
[!s
<second element>
[...]]
!

This element contains items of ordered or unordered list, separated by separator tag.

Type indicates if it's a ordered or unordered list. If it's type is * then it should be unordered list with unspecified bullets, if it's 1, A, a, I or i then it should be ordered list ordered by arabic numerals, upper and lowercase latin letters, upper and lowercase roman numerals respecivly. Any other value can be set to any representation.

Starting position can be used to indicate first value of ordedred list, First letter of alphabets is assigned number one. This value is implied to be 1 by default if direction is positive and number of items in the list if direction is negative.

Direction can be positive, which is assumed by default can be specified by +, or negative, wich is specified by hyphen-minus. If direction is positive, then number of item increases as list goes along, otherwise it decreases.

(To be quite honest, I am not sure about this, but this seems like a thing *someone* needs)

Quoteblock and box

!q [quote soruce]
<quote>
!

Quote and where (or who) it is from.

!b [Desctiption of contents]
<contents>
!

Contains optional information. May contain spoilers.

Image, audio and video

!i <link to image>
[Description of the image]
!

!i <link to audio>
[Description of the audio]
!

!i <link to video>
[Description of the video]
!

Embeded image, audio and video.

Tables

!t <number of columns>
<cell>
!s
<cell>
!

!t |
<cell> | <cell>
<cell> | <cell>
!

!t 3
!s 2 2
<big cell>
!s
<cell>
!s
<cell>
!s
<bottom row cell>
!s 2
<long bottom cell>
!

Table tags allows you to arrange data in tables. You could either employ simple tables, where collums are separated by symbol specified on opening line and rows by newlines or add number of columns as a parameter to tag and separate cells by using separator tag. In this case you can add either one parameter, to make cell take up several columns or two parameters, to make cell take up several columns and rows.

List, quoteblock, box, table and preformated elements cannot be used inside of a table, although I am not sure about preformated elemement.

I am not sure if there is a need for table headers and footers, but they could probably be realised using header tag or through some other means.

Inline elements

Link

~l(<link URL>){Link text}

Allows you to reffer to other internet resources.

Code

~c{<code>}

This allows you to insert snipets of code and program output into regular lines.

Spoiler

~s[(<context>)]{<spoiler>}

Allows you to hide parts of text. Adding context allows you to inform users on reason for you to hide this text, and optinally for browsers to reveal all spoilers of same type automatically.

Subscript and superscript

~_{<Subscript>}
~^{<Superscript>}

These tags allow to utilize subscript and superscript as part of various notations. If one of these tags follows other without interupption then they should overlap.

Perhaps this is reduncdant with math elements.

Above and below

~a(<abovetext>){<regular text>}
~b(<belowtext>){<regular text>}

This allows you to put text above and below

This is inspiered by ruby text.

Perhaps this is reduncdant with math elements and alt-text.

Emphasis

~e{<text>}
~e(<level of emphasis>){<text>}
~e([i][b][u]){<text>}

Emphasis element allows you to call attention to parts of your text. You could either add emphasis levels or set desiered effect directly, although how it would be presented by non-visual browsers is up to them.

Hover

~h(<alt-text>){<text>)

Allows you add alt-text to text. Perhaps could be called alt-text and take letter a if above and below are taken out.

Spoiler

~s(<context>{<spoiler>}

Allows you add spoilers to inline text.

Striketrough

~-{<text>}

Allows to present outdated or crossed out for other purposes text.

Quote

~q{<quoted text>}

Allows semantcally present quoted text. No more arguments about which quotes to use.

Math

~m{<equasion>}

Allows to present mathimathical equasions. I am not sure which markup to use to represent them.