Pearly
Pearly is an Elixir library for syntax highlighting using Sublime Text syntax definitions.
Install / Use
/learn @mischov/PearlyREADME
Pearly
Pearly Soames wanted gold and silver, but not, in the way of common thieves, for wealth. He wanted them because they shone and were pure. Strange, afflicted, and deformed, he sought a cure in the abstract relation of colors. -- <cite>Mark Helprin, Winter's Tale</cite>
Pearly is an Elixir library for syntax highlighting using Sublime Text syntax definitions.
Pearly.highlight("html", "<h1>Hello, World!</h1>",
format: :html,
theme: "Solarized (dark)")
#=> {:ok, "<pre style=\"background-color:#002b36;\">\n<span style=..."}
Pearly currently supports formatting output for either HTML pages or the terminal.
See HexDocs for additional documentation.
Dependencies
Pearly depends on the Rust library Syntect, and you will need to have the Rust compiler installed.
Additionally, one of Syntect's dependencies (onig) requires cmake to be installed.
Installation
Ensure Rust and cmake are installed, then add Pearly to your mix.exs:
defp deps do
[
{:pearly, "~> 0.1.1"}
]
end
Finally, run mix deps.get.
Roadmap
- [x] Highlight for HTML pages (styled
<pre>tags) - [x] Highlight for the terminal (24-bit color ANSI terminal escape sequences)
- [x] Provide Elixir and EEx syntaxes
- [ ] Support providing additional syntaxes
- [ ] Support providing additional themes
- [ ] Support additional and/or custom formatters
License
Pearly is licensed under the MIT License
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
