#snapshot #generate #pure #themes #syntax #tool #line

codesnap

Pure Rust library for generating beautiful code snapshots

34 releases (10 breaking)

0.10.5 Feb 5, 2025
0.9.0 Feb 2, 2025
0.8.3 Dec 22, 2024
0.7.2 Nov 30, 2024

#269 in Text editors

Download history 280/week @ 2024-10-27 343/week @ 2024-11-03 577/week @ 2024-11-10 295/week @ 2024-11-17 833/week @ 2024-11-24 767/week @ 2024-12-01 907/week @ 2024-12-08 241/week @ 2024-12-15 312/week @ 2024-12-22 113/week @ 2024-12-29 201/week @ 2025-01-05 121/week @ 2025-01-12 3/week @ 2025-01-19 886/week @ 2025-02-02 37/week @ 2025-02-09

926 downloads per month
Used in codesnap-cli

MIT license

3MB
3K SLoC

CodeSnap is a tool to generate beautiful snapshots of your code snippets. It's a pure Rust library that provides a simple API to create snapshots of code snippets with syntax highlighting, line numbers, code theme and more.

Quick start

CodeSnap::default()
    .code(
        CodeBuilder::default()
            .language("haskell")
            .content(r#"print "Hello, CodeSnap!""#)
            .build()?,
    )
    .watermark(WatermarkBuilder::default().content("YYM").build()?)
    .build()?
    .create_snapshot()?
    .raw_data()?
    .copy()?;

Now try to paste the code snapshot to your friends! (Don't forget tell him that this was generated by CodeSnap! ^ ^)

Dependencies

~25–39MB
~559K SLoC