tmbb
Makeup - A syntax highlighter for Elixir
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highlights Elixir and HTML5 and formats the results as HTML.
GitHub repo: GitHub - elixir-makeup/makeup: Syntax highlighter for Elixir inspired by Pygments · GitHub
Hex package: makeup | Hex
The Elixir highlighter is already quite good in my opinion. The HTML5 hasn’t been tested as thoroughly.
Demo here: https://tmbb.github.io/makeup_demo/ (navigate the links to find the demos for Elixir and HTML5).
Contributions are accepted and highly encouraged, especially new lexers. Documentation on how to write them is pretty much inexistent at the moment, though.
Most Liked
tmbb
New version released, based on NimbleParsec. It’s way faster than the previous version based on ExSpirit. I’ll add some docs soon, but the code is out there in the repo if you want to play with it. It’s a great way to look at how flexible @josevalim’s NimbleParsec is.
tmbb
Another example of Makeup’s output: the official elixir docs highlighted by Makeup instead of Highlight.js: API Reference – elixir v1.7.0-rc.0.
For an example of actual code being highlighted, see here: Agent – elixir v1.7.0-rc.0
It also highlights the iex prompt correctly: Calendar.ISO – elixir v1.7.0-rc.0, so it now doubles as an iex lexer.
You can’t try this at home yet because it still depends on an unreleased package and on manually editing the minified javascript returned by ExDoc to play well with my own javascript.
EDIT: the CSS stylefor the highlighted code is not the same. I didn’t try to port the highlightjs stylesheet, and I don’t think I should because my own style is richer and shows more distinctions between identifiers. The them is my new “Samba” theme, which is a patched version of the Pygments “Tango” style to render module names in a different color from variable names and play better with the rest of the ExDocs theme.
tmbb
A new version of ExDoc has been released. This version (0.16.3) supports using Makedown (a markdown implementation that uses Makeup) as the markdown processor. Instructions on how to integrate here:
https://github.com/tmbb/makedown#integration-with-exdoc
This means you can now use Makeup as the syntax highlighting library for the hexdocs documentation of your packages.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









