Go to file
2023-05-25 10:01:13 -07:00
cmd Block-level image support. 2023-05-09 14:16:22 -07:00
lib Add a "block-level link" type. Might change this to a "=>" notation and use the current notation for a "list-item link" type later, TBH. 2023-05-25 10:01:13 -07:00
.gitignore Initial commit 2023-05-08 17:47:08 -07:00
go.mod Initial commit 2023-05-08 17:47:08 -07:00
go.sum Initial commit 2023-05-08 17:47:08 -07:00
LICENSE MIT license 2023-05-11 14:05:10 -07:00
main.go Initial commit 2023-05-08 17:47:08 -07:00
README.md Add a Markdown renderer. 2023-05-11 13:20:43 -07:00

Lykso's Markup Language

This is a first attempt at creating a markup language capable of producing natural-looking output for both Gemini and the World Wide Web.

Also renders to Markdown.

Supports all the stuff gemtext does, plus inline links, block-level images, and emphasized text when rendered to HTML.

Example

# Header level 1
## Header level 2
### Header level 3

An {inline link}1 which will render as expected in HTML and on its own line further down in gemtext.

1: gemini://lyk.so My homepage, which will render as a Gemini link here when rendering to gemtext

` ` `
Some preformatted text. (Pretend there aren't any spaces between the backticks.)
` ` `

Something *with emphasis* added.

- Supports *lists!*
- But uses dashes
- Because it saves me a keypress

> A blockquote.

!image.png A block-level image, with a required description

N.B.: The HTML renderer uses image descriptions for the image's aria-label attribute, and the gemtext renderer uses it for the link text.

Usage

lml [command]

Available Commands:
  ast         Show the parser's raw output.
  build       Renders the input file to the specified format and writes the result to the output file.
  completion  Generate the autocompletion script for the specified shell
  ebnf        Output the Extended Backus-Naur Form representation of LML's grammar.
  help        Help about any command

Adding a renderer

  1. Implement the Renderer interface in lib/renderer.go
  2. Add an entry for a constructor function to the KnownRenderers map in lib/renderer.go

See lib/geminiRenderer.go and lib/htmlRenderer.go for examples.