You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
repo2pdf is a tool that allows you to convert a GitHub repository into a PDF file. It clones the repository, processes the files, and then creates a PDF.
Notifications You must be signed in to change notification settings
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go to filerepo2pdf can be installed by either directly using NPX or cloning the repository from GitHub. The steps and prompts vary based on the chosen method.
This method downloads and installs the latest version of repo2pdf from the NPM registry.
npx repo2pdf
This method involves manually cloning the repo2pdf repository and setting it up on your local machine.
git clone https://github.com/BankkRoll/repo2pdf
cd repo2pdf
npm install
npm run build
npm start
Please note that you need to have Node > 18 and git(for non-local repos) installed on your system in order to run repo2pdf.
repo2pdf automatically ignores certain file types and directories (e.g., .png , .git ). To customize the files and directories to ignore, you can add a repo2pdf.ignore file to the root of your repository.
Please note that if you use a local repository, the repo2pdf.ignore file must be in the root of the repository directory. And you might need to add more directories to the ignore list, as the script does not automatically ignores different build files and directories.
< "ignoredFiles": ["tsconfig.json", "dist", "node_modules"], "ignoredExtensions": [".raw"] >
Q: I'm getting an error "Failed to install [package-name]". What should I do? A: Make sure you have Node.js and npm installed on your system. Try running the following command to install the required package manually:
npm install [package-name]
Q: How can I customize the styling of the generated PDF? A: You can modify the code in `clone.ts` or `syntax.ts` to change the font, font size, colors, and other styling options for the PDF document.
// Example: Changing font size in syntax.ts doc.fontSize(12);
Q: What types of files are supported for conversion to PDF? A: Currently, repo2pdf supports all text-based files for conversion to PDF. Binary files like images or compiled binaries are ignored. Q: How can I modify the ignored files list? A: You can add a `repo2pdf.ignore` file to the root of your repository to customize the list of ignored files. Here's an example of how to structure this file:
< "ignoredFiles": ["tsconfig.json"], "ignoredExtensions": [".md"] >
Q: How can I include line numbers in the generated PDF? A: During the execution of the script, you'll be prompted with the question "Include line numbers?". Answering 'Y' will include line numbers in the generated PDF. Q: How can I keep the cloned repository after generating the PDF? A: You'll be asked "Keep cloned repository?" during the script execution. Answer 'Y' to keep the cloned repository on your system after the PDF is generated. Q: How can I generate a PDF for a local repository? A: When running the script, you'll be asked to either clone a repository or use a local one. Choose the latter and provide the local repository path.
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.
Encountered a hiccup? We're here to help! Please:
Have a brilliant idea for a new feature or an improvement to an existing one? We're all ears! Please:
If you're up for rolling up your sleeves to contribute code to fix a bug or implement a new feature, here's how you can get started:
In your pull request, please provide a clear description of the changes you've made. We appreciate contributions that adhere to our coding conventions and are consistent with the existing codebase - it helps us maintain the quality of the project and makes the review process more efficient.
Here are some feature ideas and improvements that could be implemented in repo2pdf to enhance its functionality and user experience:
Feel free to contribute to the project by implementing any of these ideas or suggesting new ones!
We're ever grateful for the valuable contributions from our community. Meet the people who're helping shape repo2pdf:
repo2pdf is open source software, licensed under the MIT License. See the LICENSE file for more information.