Giter Club home page Giter Club logo

sourcecodeposterizer's Introduction

Source Code Posterizer

Generate Images from your Code

Description

I got bored and thought "Maybe I want to print out my code and make a poster out of it?"
This CLI will take all files (with restrictions) from a path, minifies them and generates an image.

Basic usage

Search all files (according to the set filter) and create an image named "SCP.png" in the <DIRECTORY>

scp -p <DIRECTORY>

You can lock the aspect ratio to 1:1.414 if you want to generate an image you can easily print. As a side-effect, your text can overflow on the y-axis or leave a blank space. Simply increase or decrease the characters per line to manually fit everything into the frame

scp -p <DIRECTORY> -l 150 -u 80 -t SCP

Example output (locked aspect ratio):

Advanced usage

Create an image with different colors, 100 characters per line, 80 pixel border and the title "SCP". Notice that the aspect ratio is not locked.

scp -p <DIRECTORY> -f #FFFFFF -b #000000 -l 100 -u 80 -t SCP

Example outputs (unlocked aspect ratio):

Options

Note: The width of the image directly corresponds with the amount of characters and the resulting string width. Depending on the amount of code, you might want to change the Fontsize or LineLength to get the right aspect ratio for your image. Alternatively, you can lock the aspect ratio and work from there.

Short Name Long Name Default
-p --path None, this is the only required field.
-t --title SCP
-l --line-length 200
-f --foreground-color #000000
-b --background-color #FFFFFF
-c --casing Default
-s --size 16
-y --filetypes .cs,.css,.scss,.js,.json,.ts,.html,.txt,*.md
-u --border 0
-a --lock-aspect false

Build your own release package

Standard dotnet buildscripts apply.
For example, if you want to build a self-contained release with NET 5:

dotnet publish -r win-x64 -c Release -o publish -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true -p:IncludeNativeLibrariesForSelfExtract=true

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.