#snapshot #generate #pure #themes #syntax #line #syntax-highlighting

codesnap

Pure Rust library for generating beautiful code snapshots

27 releases (8 breaking)

0.8.2 Dec 10, 2024
0.7.5 Dec 3, 2024
0.7.2 Nov 30, 2024

#173 in Text editors

Download history 192/week @ 2024-10-07 17/week @ 2024-10-14 175/week @ 2024-10-21 256/week @ 2024-10-28 283/week @ 2024-11-04 581/week @ 2024-11-11 528/week @ 2024-11-18 634/week @ 2024-11-25 791/week @ 2024-12-02 921/week @ 2024-12-09

2,894 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

~24–37MB
~538K SLoC