Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skanehira/deno-silicon
Deno module to generate images from source code using Aloxaf/silicon.
https://github.com/skanehira/deno-silicon
deno typescript
Last synced: about 2 months ago
JSON representation
Deno module to generate images from source code using Aloxaf/silicon.
- Host: GitHub
- URL: https://github.com/skanehira/deno-silicon
- Owner: skanehira
- License: mit
- Created: 2022-09-01T17:18:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-26T00:03:27.000Z (10 months ago)
- Last Synced: 2024-05-02T02:29:03.437Z (9 months ago)
- Topics: deno, typescript
- Language: TypeScript
- Homepage: https://deno.land/x/silicon
- Size: 128 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deno-silicon
Deno module to generate images from source code using
[Aloxaf/silicon](https://github.com/Aloxaf/silicon).![](https://i.gyazo.com/ab38b1037f15fb0c8132264ced695067.png)
## Dependencies
Please refer silicon's
[dependencies](https://github.com/Aloxaf/silicon#dependencies)## Support Version
| `deno-silicon` | `Deno` |
| -------------- | -------------------- |
| v0.0.2 | `v1.24.3` or earlier |
| v0.0.3 ~ | `v1.25.0` or later |
| v0.0.5 ~ | `v1.32.4` or later |## Usage
You can call `generate(code, language, options)` to generates image from source
code.```typescript
const code = `package mainimport {
"fmt"
}func main() {
fmt.Println("Hello World")
}`;const data = generate(code, "go", { theme: "Dracula" });
await Deno.writeFile("out.png", data);
````code` and `language` are required; `options` is optional.\
The options conform to silicon options, see silicon help for details.## Thanks
- [Aloxaf/silicon](https://github.com/Aloxaf/silicon)