Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waj/ex_pp
Pretty printing for Elixir
https://github.com/waj/ex_pp
Last synced: 3 days ago
JSON representation
Pretty printing for Elixir
- Host: GitHub
- URL: https://github.com/waj/ex_pp
- Owner: waj
- Created: 2018-02-02T16:52:44.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T17:22:56.000Z (almost 7 years ago)
- Last Synced: 2024-09-24T21:56:03.810Z (about 2 months ago)
- Language: Elixir
- Homepage: https://hex.pm/packages/pp
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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`:
```elixir
def deps do
[
{:pp, "~> 0.1.0"}
]
end
```## Usage
In order to use the `pp` macro, first import the `PP` module in your code:
```elixir
import PP
```Now you're ready to use the macro:
```elixir
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](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/pp](https://hexdocs.pm/pp).