tmbb

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

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

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

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.

Where Next?

Popular in Announcing Top

ostinelli
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New
Crowdhailer
The latest release of Ace (0.10.0) includes serving content over HTTP/2. I have started writing a webserver to teach my self more about...
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have ...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
aditya7iyengar
Rummage.Ecto and Rummage.Phoenix provide ways to perform Searching, Sorting and Pagination over Ecto queries and Phoenix collections. Fo...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps w...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39523 209
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement