Skip to content

Latest commit

 

History

History
99 lines (65 loc) · 1.97 KB

README.md

File metadata and controls

99 lines (65 loc) · 1.97 KB

⚠️ Work in Progress

A Library and CLI made in Haskell (It's a project for fun and learn a lot)

Take a haskell code and generate an image.

You can test a telegram bot, which uses this library: https://t.me/PepeHsBot

Example with the CLI

file: samples/code.hs

module Main (main) where

import qualified Prelude as P (IO, ($), unwords, print)

-- | Hue hue Comment

main :: P.IO ()
main = do
  P.print P.$ P.unwords ["Hello", "Friend"]
$ cat samples/code.hs | ./result/bin/caani -o docs/code.png

   Yay!!! The image was saved in 'docs/code.png'

samples/code.png

Releases

It's needed to test the released binaries available here. 🙈

  1. Download the artifact
  2. $ tar -xzf caani-Linux.tar.gz
    $ cd caani
    $ echo 'main = pure ()' | ./caani -o foo.png

Building

With the Nix installed:

$ make build
$ ./result/bin/caani -h

With Cabal (cabal-install)

$ cabal new-build exe:caani
$ make cp-bin
$ ./caani -h

Roadmap

Features

  • Add numbers in the lines
  • More languages (with skylighting perhaps 🤔)
  • More themes 🎨
  • Absolute path with getExecutablePath
  • Customization options (background-color, fonts...)

Project

  • Compile the project with the -Wall flag 🙃
  • Use a pinned nixpkgs from the channel 20.09
  • Upgrade the freetype2 library to 0.2.0
  • Add a formatter
  • Distribute some binaries
  • Tests? CI? Hlint?

Related Projects

  • Silicon - "Silicon is an alternative to Carbon implemented in Rust."

  • Carbon - "Create and share beautiful images of your source code"

----

by jeovazero