{"id":13452388,"url":"https://github.com/Aloxaf/silicon","last_synced_at":"2025-03-23T19:34:10.432Z","repository":{"id":35014255,"uuid":"195663378","full_name":"Aloxaf/silicon","owner":"Aloxaf","description":"Create beautiful image of your source code.","archived":false,"fork":false,"pushed_at":"2024-04-30T02:31:59.000Z","size":7721,"stargazers_count":2960,"open_issues_count":33,"forks_count":78,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-30T03:28:11.008Z","etag":null,"topics":["carbon","presentation","rust","snippets"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aloxaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-07T14:50:55.000Z","updated_at":"2024-04-30T03:28:12.714Z","dependencies_parsed_at":"2024-01-07T21:02:46.901Z","dependency_job_id":"b0b5a8c2-0e9a-4e88-9973-dd435f87294a","html_url":"https://github.com/Aloxaf/silicon","commit_stats":{"total_commits":203,"total_committers":27,"mean_commits":7.518518518518518,"dds":0.5123152709359606,"last_synced_commit":"cd1ec2f9f0b06370103ae604570a2cd9ed5c8a90"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aloxaf%2Fsilicon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aloxaf%2Fsilicon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aloxaf%2Fsilicon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aloxaf%2Fsilicon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aloxaf","download_url":"https://codeload.github.com/Aloxaf/silicon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245159331,"owners_count":20570362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carbon","presentation","rust","snippets"],"created_at":"2024-07-31T07:01:22.715Z","updated_at":"2025-03-23T19:34:09.392Z","avatar_url":"https://github.com/Aloxaf.png","language":"Rust","readme":"# Silicon\n\n[![Crates.io](https://img.shields.io/crates/v/silicon.svg)](https://crates.io/crates/silicon)\n[![Documentation](https://docs.rs/silicon/badge.svg)](https://docs.rs/silicon)\n[![CI](https://github.com/Aloxaf/silicon/workflows/CI/badge.svg)](https://github.com/Aloxaf/silicon/actions?query=workflow%3ACI)\n![License](https://img.shields.io/crates/l/silicon.svg)\n\nSilicon is an alternative to [Carbon](https://github.com/dawnlabs/carbon) implemented in Rust.\n\nIt can render your source code into a beautiful image.\n\n\u003cimg width=\"66%\" src=\"example/example.png\"\u003e\n\n## Why Silicon\n\nCarbon is a wonderful tool to create a beautiful image of your source code.\n\nBut it is a web application, which brings the following disadvantages:\n - Cannot work without Internet \u0026 browser.\n - 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.)\n\nHowever, Silicon doesn't have these problems.\nIt's is implemented in Rust and can work without browser \u0026 Internet.\n\nSilicon can render your source code on the fly while _carbon-now-cli_ takes several seconds on it.\n\n## Disadvantages\n\nIt's not as beautiful as Carbon...\n\n## Install\n\n### Cargo\n\n```bash\ncargo install silicon\n```\n\nNOTE: harfbuzz feature is enabled by default. If you are using Windows, I suggest you disable it to get it build easier.\n\n### AUR\n\nSilicon is available in the official repository:\n\n```bash\npacman -S silicon\n```\n\n### Homebrew\n\nYou can install Silicon using [Homebrew](https://brew.sh):\n\n```bash\nbrew install silicon\n```\n\n## Dependencies\n\n### Ubuntu\n```bash\nsudo apt install expat\nsudo apt install libxml2-dev\nsudo apt install pkg-config libasound2-dev libssl-dev cmake libfreetype6-dev libexpat1-dev libxcb-composite0-dev libharfbuzz-dev libfontconfig1-dev g++ \n```\n\n### Fedora\n```bash\nsudo dnf install \\\n  cmake \\\n  expat-devel fontconfig-devel libxcb-devel \\\n  freetype-devel libxml2-devel \\\n  harfbuzz\n```\n\n### Arch Linux\n\n```bash\nsudo pacman -S --needed pkgconf freetype2 fontconfig libxcb xclip harfbuzz\n```\n\n## Examples\n\nRead code from file\n\n```bash\nsilicon main.rs -o main.png \n```\n\nRead code from clipboard, and copy the result image to clipboard\n\n```bash\nsilicon --from-clipboard -l rs --to-clipboard\n```\n\nSpecify a fallback font list and their size\n\n```bash\nsilicon -o main.png -l bash -f 'Hack; SimSun=31; code2000' \u003c\u003cEOF\necho Hello\necho 你好\necho ∠( ᐛ 」∠)＿\nEOF\n```\n\nHighlight specified line\n\n```bash\nsilicon main.rs -o main.png --highlight-lines '1;3-4'\n```\n\nCustom the image\n\n```bash\nsilicon ./target/test.rs -o test.png \\\n    --shadow-color '#555' --background '#fff' \\\n    --shadow-blur-radius 30 --no-window-controls\n```\n\nTransparent background\n\nThe color can be `#RGB[A]` or `#RRGGBB[AA]`\n\n```bash\nsilicon ./target/test.rs -o test.png --background '#fff0'\n```\n\nShow window title\n\n```bash\nsilicon ./target/test.rs -o test.png --window-title \"target/test.rs\"\n```\n\nsee `silicon --help` for detail\n\n## Adding new syntaxes / themes\n\nSilicon reads syntax-definition and theme cache from user's cache directory. \n\nThe steps to add new syntaxes / themes is as same as bat: [sharkdp/bat#adding-new-syntaxes--language-definitions](https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions).\nJust replace `bat cache --build` to `silicon --build-cache`.\n\n## Configuration file\n\nYou can write some common args to `silicon --config-file`.\n\nExample:\n```shell\n# enable shadow\n--shadow-color '#555'\n--background '#fff'\n--shadow-blur-radius 30\n--no-window-controls\n```\n\n# Related projects\n\n- [vim-silicon](https://github.com/segeljakt/vim-silicon)\n- [silicon.el](https://github.com/iensu/silicon-el)\n- [silicon.lua](https://github.com/narutoxy/silicon.lua)\n","funding_links":[],"categories":["Rust","Command Line","rust","命令行工具","Dev-Utilities","\u003ca name=\"Rust\"\u003e\u003c/a\u003eRust"],"sub_categories":["Dependency Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAloxaf%2Fsilicon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAloxaf%2Fsilicon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAloxaf%2Fsilicon/lists"}