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
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'
It's needed to test the released binaries available here. 🙈
- Download the artifact
-
$ tar -xzf caani-Linux.tar.gz $ cd caani $ echo 'main = pure ()' | ./caani -o foo.png
With the Nix installed:
$ make build
$ ./result/bin/caani -h
With Cabal (cabal-install)
$ cabal new-build exe:caani
$ make cp-bin
$ ./caani -h
- Add numbers in the lines
- More languages (with skylighting perhaps 🤔)
- More themes 🎨
- Absolute path with
getExecutablePath
- Customization options (background-color, fonts...)
- 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?
-
Silicon - "Silicon is an alternative to Carbon implemented in Rust."
-
Carbon - "Create and share beautiful images of your source code"
by jeovazero