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

codesnap

Pure Rust library for generating beautiful code snapshots

6 releases

new 0.2.3 Nov 3, 2024
0.2.2 Nov 1, 2024
0.2.0 Oct 27, 2024
0.1.0 Oct 26, 2024
0.0.1 Oct 7, 2024

#122 in Text editors

Download history 187/week @ 2024-10-06 21/week @ 2024-10-13 76/week @ 2024-10-20 345/week @ 2024-10-27

629 downloads per month
Used in codesnap-cli

MIT license

98KB
2.5K 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, and custom themes.

Quick start

CodeSnap::default()
  .code(
      CodeBuilder::default()
          .language("rust")
          .content(CODE_SNIPPET)
          .build()?,
  )
  .watermark(WatermarkBuilder::default().content("CodeSnap").build()?)
  .build()?
  .create_snapshot()?
  .copy()

Now try to paste the code snapshot to your friends!

/_/
( -.- ) If you enjoy CodeSnap, also try Silicon

Dependencies

~24–38MB
~538K SLoC