Crate code2prompt_core

Source
Expand description

Core library for code2prompt.

Modulesยง

configuration
This module defines the Code2PromptConfig struct and its Builder for configuring the behavior of code2prompt in a stateless manner. It includes all parameters needed for file traversal, code filtering, token counting, and more.
filter
This module contains the logic for filtering files based on include and exclude patterns.
git
This module handles git operations.
path
This module contains the functions for traversing the directory and processing the files.
session
This module defines a Code2promptSession struct that provide a stateful interface to code2prompt-core. It allows you to load codebase data, Git info, and render prompts using a template.
sort
This module provides sorting methods for files and directory trees.
template
This module contains the functions to set up the Handlebars template engine and render the template with the provided data. It also includes functions for handling user-defined variables, copying the rendered output to the clipboard, and writing it to a file.
tokenizer
This module encapsulates the logic for counting the tokens in the rendered text.
util
This module contains util functions