Welcome Contributors!
Your insights, skills, and valuable time can make a huge difference in the evolution of repo2pdf! We’re always excited to see the community helping in shaping this tool to be even more efficient and feature-rich. Whether you’re fixing a bug, adding a feature, or improving documentation, your contributions are welcome and appreciated.Ways to Contribute
There are many ways to contribute to repo2pdf:Report Bugs
Suggest Features
Write Code
Reporting Bugs
Encountered a hiccup? We’re here to help!Before Submitting a Bug Report
- Check existing issues: Search GitHub Issues to see if the bug has already been reported
- Try the latest version: Make sure you’re using the most recent version of repo2pdf:
- Review the troubleshooting guide: Check the Troubleshooting page for common issues
Submitting a Bug Report
When opening an issue on GitHub, please include:Describe the bug
Steps to reproduce
- Run
npx repo2pdf - Enter repository URL:
https://github.com/example/repo - Select features: Line numbers, Highlighting
- Click generate
- Observe error
Expected behavior
Actual behavior
Environment information
- Operating System: macOS 13.0, Ubuntu 22.04, Windows 11, etc.
- Node.js version: Run
node --version - npm version: Run
npm --version - Git version: Run
git --version - repo2pdf version: Check with
npm list -g repo2pdf
Repository details (if applicable)
- Repository URL (if public)
- Approximate size (number of files)
- File types in the repository
- Any special characters in filenames
Bug Report Template
Suggesting Enhancements
Have a brilliant idea for a new feature or an improvement to an existing one? We’re all ears!Before Submitting an Enhancement
- Check existing issues: Search for similar feature requests
- Review the roadmap: Check if the feature is already planned
- Consider the scope: Make sure the feature aligns with repo2pdf’s core purpose
Submitting a Feature Request
When opening an issue on GitHub, please:Describe the feature
Explain the motivation
Describe the solution
Alternatives considered
Additional context
Enhancement Template
Writing Code
Ready to contribute code? Here’s how to get started:Getting Started
Fork the repository
Clone your fork
Install dependencies
Create a branch
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Adding tests
Make your changes
src/clone.ts- Main PDF generation logicsrc/configHandler.ts- CLI prompts and configurationsrc/syntax.ts- Syntax highlighting and formattingsrc/loadIgnoreConfig.ts- File ignore configurationsrc/universalExcludes.ts- Default exclusion lists
Test your changes
Format your code
Commit your changes
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
Push to your fork
Create a pull request
- Go to your fork on GitHub
- Click “Pull Request”
- Select your branch
- Fill out the PR template (see below)
- Submit the pull request
Pull Request Guidelines
When submitting a pull request, please:Provide a clear description
Provide a clear description
- Summary: Brief overview of changes
- Motivation: Why is this change needed?
- Changes: List of specific changes made
- Testing: How you tested the changes
Keep changes focused
Keep changes focused
- One PR should address one issue or feature
- Avoid mixing unrelated changes
- If you have multiple improvements, create separate PRs
Follow coding conventions
Follow coding conventions
- Use TypeScript for all new code
- Follow the existing code style
- Run
npm run formatbefore committing - Add type definitions for new functions
- Use meaningful variable and function names
Update documentation
Update documentation
- Update README.md if needed
- Add JSDoc comments for new functions
- Update type definitions
- Add examples for new features
Add tests (if applicable)
Add tests (if applicable)
- Testing your changes manually with various repositories
- Documenting test cases in the PR description
- Suggesting test scenarios for reviewers
Be responsive to feedback
Be responsive to feedback
- Respond to review comments promptly
- Be open to suggestions and changes
- Update your PR based on feedback
- Keep the conversation focused and professional
Development Tips
Understanding the codebase
Understanding the codebase
src/clone.ts- Entry point and main PDF generation logic- Handles CLI initialization
- Orchestrates PDF creation
- Manages file processing
src/configHandler.ts- Interactive CLI prompts- Defines all user prompts
- Handles validation
- Passes configuration to main function
src/syntax.ts- Syntax highlighting- Converts highlight.js output to PDF format
- Handles color mapping
src/loadIgnoreConfig.ts- File filtering- Loads
repo2pdf.ignoreconfiguration - Merges with default exclusions
- Loads
src/universalExcludes.ts- Default exclusions- Lists of always-excluded files and extensions
Working with PDFKit
Working with PDFKit
Working with highlight.js
Working with highlight.js
Debugging
Debugging
-
Use console.log liberally:
-
Test with small repositories first:
- Create a test repo with just a few files
- Easier to track down issues
-
Check the temp directory:
- Cloned repos are in
./tempRepo - Select “Yes” to keep it for inspection
- Cloned repos are in
-
Use the TypeScript compiler:
Publishing Releases
v*.*.*) or when manually dispatched.
Release Process
Update version
package.json and package-lock.json:Commit the version change
Create a git tag
Verify the publish
- Check the Actions tab on GitHub
- Ensure the build succeeds
- Verify the new version on npm
Re-running a Failed Publish
If the publish step needs to be re-run:- Go to the Actions tab on GitHub
- Select Publish Package
- Click Run workflow
- Enter the tag name (e.g.,
v2.3.0) as therelease_taginput - Click Run workflow
Meet Our Contributors
We’re ever grateful for the valuable contributions from our community. Meet the people who are helping shape repo2pdf:Code of Conduct
Our Pledge
We are committed to providing a welcoming and inspiring community for all. We pledge to make participation in our project a harassment-free experience for everyone, regardless of:- Age, body size, disability, ethnicity
- Gender identity and expression
- Level of experience, education, socio-economic status
- Nationality, personal appearance, race, religion
- Sexual identity and orientation
Our Standards
Examples of behavior that contributes to a positive environment:- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members