GithubHelp home page GithubHelp logo

deikras25 / carbon-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyberboysumanjay/carbon-api

0.0 0.0 0.0 95 KB

Unofficial API for generating beautiful images of your source code using Carbon.

Home Page: https://carbonnowsh.herokuapp.com/

License: GNU Lesser General Public License v3.0

Python 100.00%

carbon-api's Introduction

Carbon API [Unofficial]


Carbon
Unofficial API

Show some ❤️ and ⭐ the repo

GitHub stars GitHub followers Telegram Channel

Carbon API written in Python using Flask and Pyppeteer

made-with-python Open Source Love svg1

Carbon makes it easy to create and share beautiful images of your source code

Usage

You can use the API by sending a GET or a POST request using these params

parameter default type description
code (required) string Code snippet
backgroundColor "rgba(171, 184, 195, 1)" string Hex or rgba color
dropShadow true boolean Turn on/off shadow
dropShadowBlurRadius "68px" string shadow blur radius
dropShadowOffsetY "20px" string shadow offset y
exportSize "2x" string resolution of exported image, e.g. 1x, 3x
fontSize "14px" string font size
fontFamily "Hack" string font family, e.g. JetBrains Mono, Fira Code.
firstLineNumber 1 number first line number
language "auto" string programing language for properly highlighting
lineNumbers false boolean turn on/off line number
paddingHorizontal "56px" string horizontal padding
paddingVertical "56px" string vertical padding
theme "seti" string code theme
watermark false boolean turn on/off watermark
widthAdjustment true boolean turn on/off width adjustment
windowControls true boolean turn on/off window controls
windowTheme "none" string window theme

GET /

Params are encoded in url

https://carbonnowsh.herokuapp.com/?code=Made+with+Love+in+India+by+Sumanjay&theme=darcula&backgroundColor=rgba(144, 19, 254, 100)

POST /

Body is JSON with these params:

{
    "backgroundColor": "rgba(144, 19, 254, 100)",
    "code": "Made with Love in India by Sumanjay",
    "theme": "dracula"
}

RESPONSE

Response is an image of a code or text snippet.

Response

Deploy Option

  • Heroku Method Deploy

  • Other Method

    # Clone the repo
    git clone https://github.com/cyberboysumanjay/Carbon-API
    cd Carbon-API
    
    # Create virtualenv
    virtualenv -p /usr/bin/python3 venv
    ../venv/bin/activate
    
    # Install requirements
    pip3 install -r requirements.txt
    
    # Finally run the app
    python3 app.py

Made with ❤️️ in India

Copyright & License

carbon-api's People

Contributors

cyberboysumanjay avatar

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.