Giter VIP home page Giter VIP logo

textpixels's Introduction

TextPixels

Generate an image of a repository, visualized as 1-pixel tall text.

TextPixels output

Installation

This requires ImageMagick, if you want images instead of raw pixels.

This requires that the Python Pygments pygmentize command is in your PATH. If you don't have Pygments installed, just run:

pip install pygments

This also requires Ruby 2.0. (The language detection libs require it.)

Then, just check out this repo and install the Ruby dependencies with Bundler:

bundle

Usage

Simple example to render a repository at 1920x1080, 80-column lines, PNG output.

bundle exec bin/textpixels --repo /path/to/repository --out graphic.png

Options

Option descriptions

--files FILES / --repo REPO

What files to process. If neither option is given, filenames will be read from stdin. A directory is treated as a git repository on which git ls-files will be called to find filenames.

--cols N

Number of columns per line of text. Default: 80.

--transparent / --alpha

Make the default background transparent.

--solid / --no-alpha

Don't use transparency. (Default is to not use transparency.)

--style STYLE

Name of a Pygments style to use for colorization. Try the Pygments demo to see them.

The special value NONE will prevent any style from being used. Then you probably also want to use --lang-as for language-based colors, or --fg and --bg for two-color output.

--finish PHASE

Only really useful with --save.

Stop after the named phase. Mainly for debugging, but also for preprocessing a set of files to colorize them in several different ways.

See example below.

--load FILE

Load a file previously --save'd.

--save FILE

Save the results of processing in the named file. Mostly for debugging. But can be used for caching intermediate stages for multiple uses. E.g.:

# save the results of parsing all the files into HTML
bundle exec bin/textpixels --repo some/large/repo --finish htmlize --save HTML

# generate output with two different styles
bundle exec bin/textpixels --load HTML --style fruity --out fruity.png
bundle exec bin/textpixels --load HTML --style monokai --out monokai.png
--known/--skip-unknown

Ignore files with unknown filetype.

--lines MAX

Only render the first MAX lines of output.

--out IMAGEFILE

Output to this file. Can use anything valid as the target of an ImageMagick command. See the explanation of Output Filename in the ImageMagick documentation.

--height N

Height of an image strip. Default: 1080.

--crop DIMS

Size of the final crop for the output image. Default: 1920x+0+0. See the ImageMagick description of -crop

--no-crop

Prevents the final image crop.

--long

Sets --no-crop and makes the height as tall as needed to fit all file lines.

--size WxH

Sets --height to H and --crop to Wx+0+0.

--raw

Prints raw RGB or RGBA (depending on --transparency) pixels.

--fg COLOR / --default-fg COLOR

Default foreground color. Must be specified as RRGGBB or RRGGBBAA. (No leading hash.)

--bg COLOR / --default-bg COLOR

Default background color. Must be specified as RRGGBB or RRGGBBAA. (No leading hash.)

--lang-as PROPS

Use the GitHub language color as the specified comma-separated CSS properties. Only color and background-color have any effect.

E.g.:

# generate a block of color for each file
bundle exec bin/textpixels --repo somerepo --style NONE --lang-as color,background-color

textpixels's People

Contributors

benizi avatar justinxreese avatar bruceadams avatar workergnome avatar

Stargazers

Ashish Dixit avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

textpixels's Issues

Anchors are screwy in README

Anyone know how to get something like this to work:

* [--default-fg](#fg) COLOR ... item in list

# later

* <a id="fg"><a> `--default-fg` COLOR ... description of thing in list

Fails when files aren't UTF-8

I think the GitHub tools assume UTF-8 text at some layer. Possibly it's because I'm using Linguist::FileBlobs rather than Grit::Blobs. Look into it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.