code-snip

Crates.iocode-snip
lib.rscode-snip
version0.1.1
created_at2025-02-19 23:17:42.470635+00
updated_at2025-02-19 23:18:43.844717+00
descriptionA CLI tool to create images from code snippets.
homepage
repositoryhttps://github.com/max-taylor/code-snip
max_upload_size
id1561994
size57,591
Max (max-taylor)

documentation

README

Code Snip

code-snip is a Rust binary that simplifies the process of generating code snippets. It allows you to quickly create and save code snippets by specifying the input code and the desired output file name.

Installation

Install code-snip via Cargo:

cargo install code-snip

Usage

code-snip --input "fn main() { println!(\"Hello, world!\"); }" --output snippet.rs

Arguments

  • input: The code you want to create a snippet for.
  • output: The filename for the generated snippet.

Environment Variables

You can configure the export path via the SYNTAX_EXPORT_PATH environment variable. If set, all generated snippets will be saved in this directory:

export SYNTAX_EXPORT_PATH="/path/to/snippets"

All code snippets will then be exported to {SYNTAX_EXPORT_PATH}/{output}.

License

This project is licensed under the MIT License.

Commit count: 13

cargo fmt