Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Aloxaf/silicon
Create beautiful image of your source code.
https://github.com/Aloxaf/silicon
carbon presentation rust snippets
Last synced: about 1 month ago
JSON representation
Create beautiful image of your source code.
- Host: GitHub
- URL: https://github.com/Aloxaf/silicon
- Owner: Aloxaf
- License: mit
- Created: 2019-07-07T14:50:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T02:31:59.000Z (8 months ago)
- Last Synced: 2024-04-30T03:28:11.008Z (8 months ago)
- Topics: carbon, presentation, rust, snippets
- Language: Rust
- Homepage:
- Size: 7.36 MB
- Stars: 2,960
- Watchers: 14
- Forks: 78
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - silicon - Create beautiful image of your source code. (Rust)
- awesome-tools - Aloxaf/silicon - Create beautiful image of your source code. (Command Line / Dependency Management)
- awesome-ops - Aloxaf/silicon - 07-07|2024-09-26 | 一款能够将代码创建为漂亮的图片渲染的工具 | (终端命令行工具)
- awesome-rust-tools - silicon
- awesome-ccamel - Aloxaf/silicon - Create beautiful image of your source code. (Rust)
- awesome-repositories - Aloxaf/silicon - Create beautiful image of your source code. (Rust)
README
# Silicon
[![Crates.io](https://img.shields.io/crates/v/silicon.svg)](https://crates.io/crates/silicon)
[![Documentation](https://docs.rs/silicon/badge.svg)](https://docs.rs/silicon)
[![CI](https://github.com/Aloxaf/silicon/workflows/CI/badge.svg)](https://github.com/Aloxaf/silicon/actions?query=workflow%3ACI)
![License](https://img.shields.io/crates/l/silicon.svg)Silicon is an alternative to [Carbon](https://github.com/dawnlabs/carbon) implemented in Rust.
It can render your source code into a beautiful image.
## Why Silicon
Carbon is a wonderful tool to create a beautiful image of your source code.
But it is a web application, which brings the following disadvantages:
- Cannot work without Internet & browser.
- Doesn't work well with shell. (Although there is _carbon-now-cli_, its experience is not very good, especially when the network is not so good.)However, Silicon doesn't have these problems.
It's is implemented in Rust and can work without browser & Internet.Silicon can render your source code on the fly while _carbon-now-cli_ takes several seconds on it.
## Disadvantages
It's not as beautiful as Carbon...
## Install
### Cargo
```bash
cargo install silicon
```NOTE: harfbuzz feature is enabled by default. If you are using Windows, I suggest you disable it to get it build easier.
### AUR
Silicon is available in the official repository:
```bash
pacman -S silicon
```### Homebrew
You can install Silicon using [Homebrew](https://brew.sh):
```bash
brew install silicon
```## Dependencies
### Ubuntu
```bash
sudo apt install expat
sudo apt install libxml2-dev
sudo apt install pkg-config libasound2-dev libssl-dev cmake libfreetype6-dev libexpat1-dev libxcb-composite0-dev libharfbuzz-dev libfontconfig1-dev g++
```### Fedora
```bash
sudo dnf install \
cmake \
expat-devel fontconfig-devel libxcb-devel \
freetype-devel libxml2-devel \
harfbuzz
```### Arch Linux
```bash
sudo pacman -S --needed pkgconf freetype2 fontconfig libxcb xclip harfbuzz
```## Examples
Read code from file
```bash
silicon main.rs -o main.png
```Read code from clipboard, and copy the result image to clipboard
```bash
silicon --from-clipboard -l rs --to-clipboard
```Specify a fallback font list and their size
```bash
silicon -o main.png -l bash -f 'Hack; SimSun=31; code2000' <