Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsuyoshi30/germanium
Generate image from source code
https://github.com/matsuyoshi30/germanium
Last synced: about 1 month ago
JSON representation
Generate image from source code
- Host: GitHub
- URL: https://github.com/matsuyoshi30/germanium
- Owner: matsuyoshi30
- License: mit
- Created: 2021-02-23T08:43:03.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T13:45:02.000Z (12 months ago)
- Last Synced: 2024-08-01T21:47:55.761Z (4 months ago)
- Language: Go
- Homepage:
- Size: 520 KB
- Stars: 193
- Watchers: 3
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- go-awesome - Germanium - Generate images for code (Open source library / Graphics Processing)
README
# Germanium
Germanium is an alternative to [Carbon](https://github.com/carbon-app/carbon) and [Silicon](https://github.com/Aloxaf/silicon) implemented in Go.
![screenshot](assets/img/sample.png)
Germanium can work without browser and internet like Silicon.
## Usage
```
germaniumUSAGE:
germanium [FLAGS] [FILE]FLAGS:
-o, --output Write output image to specific filepath [default: ./output.png]
-b, --background Background color of the image [default: #aaaaff]
-f, --font Specify font eg. 'Hack-Bold'
-l, --language The language for syntax highlighting eg. 'go'
-s, --style The style for syntax highlighting eg. 'dracula'
-c, --clip Copy image to clipboard
--list-styles List all available styles for syntax highlighting
--list-fonts List all available fonts in your system
--no-line-number Hide the line number
--no-window-access-bar Hide the window access bar
--font-size <SIZE> Change the font size [default: 24px]
-v, --version Show Version
```### Example
Generate image From file
```
germanium -o main.png main.go
```Generate image From Stdin (need to add option `-l` or `--language`)
```
cat main.go | germanium -l go -o main.png -
```Generate image with another style (you can get a list of them with `--list-styles`)
```
germanium -s solarized-dark -o main.png main.go
```Generate image without line number
```
germanium --no-line-number -o main.png main.go
```Generate image without window control bar
```
germanium --no-window-access-bar -o main.png main.go
```Generate image and copy to clipboard
```
germanium --no-window-access-bar -o main.png main.go -c
```## Install
### GitHub releases
You can download from [here](https://github.com/matsuyoshi30/germanium/releases).
### Arch Linux
```
yay germanium
```### Build from source
```
git clone https://github.com/matsuyoshi30/germanium
cd cmd/germanium && go install
```#### Requirements
- Go (1.17 or 1.18)
## Related Projects
- [denops-germanium.vim](https://github.com/skanehira/denops-germanium.vim) is a Vim/Neovim plugin for germanium by [skanehira](https://github.com/skanehira).
- [germanium.el](https://github.com/matsuyoshi30/germanium-el) is a Emacs package for germanium.## LICENSE
[MIT](./LICENSE)
## Author
[matsuyoshi30](https://twitter.com/matsuyoshi30)