Interactive Configuration
repo2pdf uses an interactive prompt system powered by Inquirer.js to guide you through the configuration process. All options are configured at runtime—there’s no config file to maintain.Available Features
When you run repo2pdf, you’ll be presented with a checkbox prompt to select features:Add Line Numbers
Adds line numbers to the left side of each line of code in the PDF output.- Without Line Numbers
- With Line Numbers
Add Highlighting
Applies syntax highlighting to code using highlight.js. The tool automatically detects the language based on file extensions. Supported Languages: Highlight.js supports 190+ languages. The tool attempts to detect the language from the file extension:Syntax highlighting adds color to different code elements like keywords, strings, comments, and functions, making the PDF more readable.
Add Page Numbers
Adds page numbers in the format “Page: X of Y” centered at the bottom of each page.Remove Comments
Strips comments from source code using the strip-comments library.- Single-line comments (
//,#, etc.) - Multi-line comments (
/* */,<!-- -->, etc.) - Docstring comments
- With Comments
- Without Comments
Remove Empty Lines
Removes blank lines from the output to create more compact PDFs.This feature is useful for reducing PDF size and page count, especially for codebases with heavy whitespace formatting.
One PDF per File
Generates a separate PDF for each file instead of combining everything into a single PDF. When this option is selected:- You’ll be prompted for an output folder name instead of a file name
- Each file gets its own PDF named after its path
- The default folder is
./output
Output Configuration
The output configuration depends on whether you select “One PDF per file”:- Single PDF
- Multiple PDFs
You’ll be prompted for a filename:Default:
output.pdfThis creates one PDF containing all files in the repository.Custom Exclusions
You can customize which files and extensions to exclude by creating arepo2pdf.ignore file in the root of your repository.
File Format
Therepo2pdf.ignore file uses JSON format:
How It Works
The tool loads the ignore configuration using:Universal Exclusions
These files and extensions are always excluded: Files/Directories:Example Use Cases
- Exclude Sensitive Files
- Exclude Build Artifacts
- Exclude Test Files
Code Formatting
repo2pdf automatically formats code using Prettier when a supported parser is available.Supported File Types
Repository Cleanup
For remote repositories, you can choose whether to keep the cloned repository:- No (Default)
- Yes
The
tempRepo directory is automatically deleted after a 3-second delay:This option only appears when converting remote repositories. Local repositories are never deleted.
Next Steps
Output Options
Learn about single vs multiple PDF output modes
Basic Usage
Back to basic usage guide
Local Repositories
Process local repositories