Gemtext or Gemini syntax with its HTML equivalents
Here is a Gemtext cheatsheet, a summary of the syntax used to build sites for the Gemini protocol. You can take it as a quick guide for people who know HTML and want to learn Gemtext.
If you do not know the protocol, you can read a brief introduction to Gemini.
Important notes
- Files must have a
.gmiextension and the index must be namedindex.gmi. - Do not break paragraphs with manual line breaks, the browser will take care of wrapping them to the screen width. Each line is considered a paragraph.
- Blank lines are respected.
Paragraphs
Each line is a paragraph.
Hello Gemini!
Hyperlinks
Equivalent to <a>. It starts with => followed by the URL and the text that represents the hyperlink.
=> domain.com Text that represents the hyperlink
Images
There is no equivalent to <img>. However, any hyperlink pointing to an image can be displayed inline when clicked. You must start the line with => followed by the image URL and the text that represents the image.
=> image.jpg Click to view
Some browsers display the image inline, others open it on a separate page and others download it.
Headers
Same as working with Markdown.
# Main header, similar to <h1>
## Sub-header, similar to <h2>
### Sub-subheader, similar to <h3>
Lists
It would be equivalent to <ul> with its <li>. The syntax is the same as Markdown.
* Mercury
* Gemini
* Apollo
Quote
It could be similar to <q> or <blockquote>, except that it would not have line breaks. It starts with >.
> I contend that text-based websites should not exceed in size the major works of Russian literature.
Preformatted
Equivalent to <pre>. It must be between an opening and closing ```. Widely used for ASCII art or to display code.
++#+%%@%===+ *#@@@@@@@@@@%@@@#* #@@@@@@@@@@@@@@@@@@@%#*+ +@@@@@@@@@@@@@@@@@@@@@@@%+ =#@@@@@@@@@@@@@@@@@@@@@@@@%# +@@@@@@@@@%%%%@@@@@@@@@@@@%%+ #@@@**==++====*##%@@@@@@@@%#+ =%@*..........:==+**#%@@@@%%+ =%@* . .......:--==+#@@@@## *@*:-::......:--==--*@@@%#+ #+++#%#-..-#%%%%%*.-@@%#*+ +-.-=++- .=##*%%#+: #*=++- - .... .-==---==..*===- : :=+=:::-: :-=:: - ....:===::--....::- : :*%%%%@%*#==- ..- +:%*-:-=##%@%++: . *%-::-=+*#@@%#- *%*#%%%%%@@@#- : :-%%%%%%@@@@#--.: :.=#%@@%%#+++
And that is all. With these elements you can build a website on Gemini. If you want to learn more, you can read the Gemini specification.
Keep reading about Gemini
- Important notes
- Paragraphs
- Hyperlinks
- Images
- Headers
- Lists
- Quote
- Preformatted
- Keep reading about Gemini
This work is under a Attribution-NonCommercial-NoDerivatives 4.0 International license.
Support me on Ko-fi
Comments
There are no comments yet.