GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jacobmstein/carbon-api: An unofficial Java API for Carbon. Create and share beautiful images of your source code, dynamically, with Java!

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
gradle/wrapper
gradle/wrapper
 
 
src/main/java/sh/stein/carbon
src/main/java/sh/stein/carbon
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Carbon API


An unofficial Java API for Carbon. Create and share beautiful images of your source code, dynamically, with Java!

CarbonService carbon = new PlaywrightCarbonService();

ImageOptions options = new ImageOptions.ImageOptionsBuilder()
        .language(ImageOptions.Language.CSharp)
        .fontFamily(ImageOptions.FontFamily.JetBrainsMono)
        .theme(ImageOptions.Theme.Hopscotch)
        .build();

String code = "Console.WriteLine(\"Hello, world!\");";

byte[] image = carbon.getImage(code, options);

// or, read code from a file
image = carbon.getImage(new File("README.md"), options);

Want to use Carbon with Discord? Check out Carbon Bot.

Contents

  • How It Works
  • Using Carbon API
  • Documentation
  • Dependencies
  • Style

How It Works

  1. Creates a URI from the specified arguments.
  2. Uses Microsoft Playwright to visit the created URI.
  3. Screenshots the created image.

Using Carbon API

Java versions 11 and up are supported.

Latest stable release:

Gradle

Just include the following in your build.gradle file:

Replace VERSION with a valid Maven release.

repositories {
    mavenCentral()
}

dependencies {
    implementation 'sh.stein:carbon-api:VERSION'
}

Documentation

The latest Javadoc is available here.

Dependencies

  • Playwright
    • GitHub
    • Playwright requires various dependencies to install browsers, see the docs.

Style

The IntelliJ code style files, which are a fork of the Google Java Style Guide, are stored in the .idea/codeStyles directory.

About

An unofficial Java API for Carbon. Create and share beautiful images of your source code, dynamically, with Java!

Topics

apicarboncarbon-apigradlejavamaven

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.