CodeSnap

Getting started

Get started with the CodeSnap quickly

Quick Start

Welcome to the "Getting Started" guide for CodeSnap! 🎉 This page will help you get started with CodeSnap.

CodeSnap is a powerful tool for creating beautiful code snippets. It allows you to customize the appearance of your code snippets, making them visually appealing and easy to read. This guide will walk you through the process of setting up CodeSnap in your project and using it effectively.

CodeSnap also provides CLI and editor plugin support, allowing you to integrate it into your development workflow seamlessly.

CLI

CodeSnap CLI is a command-line tool that allows you to generate code snippets directly from your terminal.

CodeSnap.nvim

Neovim plugin that allows you to generate code snippets directly from your editor.

Zed integration

Describe how to use CodeSnap with Zed.

VSCode plugin (coming soon)

Visual Studio Code plugin that allows you to generate code snippets directly from your editor.

IDEA plugin (coming soon)

IntelliJ IDEA plugin that allows you to generate code snippets directly from your editor.

Installation

cargo add codesnap

Basic Usage

use codesnap::config::{CodeBuilder, CodeSnap, Content};
 
pub fn main() -> anyhow::Result<()> {
    let code_content = Content::Code(
        CodeBuilder::default()
            .content(r#"pub fn main() {}"#)
            .language("rust")
            .build()?,
    );
 
    let snapshot = CodeSnap::from_default_theme()?
        .content(code_content)
        .build()?
        .create_snapshot()?;
 
    // Copy the snapshot data to the clipboard
    snapshot.raw_data()?.copy()
}

Next Steps

On this page