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: 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

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: 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

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

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

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.

Where Next?

Popular in Libraries Top

hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
zoltanszogyenyi
Hey everyone :wave: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-source U...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
OvermindDL1
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
132 13487 106
New
arkgil
Hi all! I’m happy to announce that Telemetry v0.3.0 is out! This release marks the conversion from Elixir to Erlang so that all the libr...
New
mcrumm
If you would like to migrate away from node/npm/webpack while still using sass, the dart_sass package provides a installer and runner for...
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New

Other popular topics Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

Sub Categories:

We're in Beta

About us Mission Statement