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: https://github.com/tmbb/makeup
Hex package: https://hex.pm/packages/makeup
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: https://tmbb.github.io/exdocs_makedown_demo/api-reference.html.
For an example of actual code being highlighted, see here: https://tmbb.github.io/exdocs_makedown_demo/Agent.html#module-examples
It also highlights the iex prompt correctly: https://tmbb.github.io/exdocs_makedown_demo/Calendar.ISO.html#day_of_week/3, 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:
This means you can now use Makeup as the syntax highlighting library for the hexdocs documentation of your packages.
tmbb
Happy new year everyone! I just wanted to remind possible contributer that although this forum thread has been a bit stale, we still welcome contributions to makeup in the form of new lexers. @josevalim has mostly taken over the project, as I have been dedicating myself to other things.
New contributions for 2024 in the form of new lexers are extremely welcome.
NobbZ
Impossible for the common “highlight a single file”-highlighters. It does only know about the currently highlighted module Foo, nothing about Bar. Therefore it cant know if Bar.foo() is calling into a macro or into a function.







