Skip to content

waj/ex_pp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pretty printing for Elixir

This pretty printer is inspired in the pp macro from Crystal: [https://crystal-lang.org/api/toplevel.html#pp%28%2Aexps%29-macro]. It's quite useful while doing print debugging.

Installation

The package can be installed by adding pp to your list of dependencies in mix.exs:

def deps do
  [
    {:pp, "~> 0.1.0"}
  ]
end

Usage

In order to use the pp macro, first import the PP module in your code:

import PP

Now you're ready to use the macro:

x = 1
y = 2
pp x + y, :red

When that code is executed, it will print in the console in red color:

x + y # => 3

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/pp.

About

Pretty printing for Elixir

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages