GithubHelp home page GithubHelp logo

code-to-one-pdf's Introduction

Code to PDF Converter 中文

Code to PDF Converter is a Python tool for converting source code files within a directory into a single PDF document, while allowing you to specify files and directories to exclude through a configuration file. This tool is particularly useful for developers who need to archive or send their code repositories to AI.

Features

  • Convert all source code files within a directory into a single PDF file.
  • Exclude specific files and directories using a configuration file.
  • Support custom file patterns using wildcards in the configuration.

Installation

To use this tool, you need to have Python installed on your system. Clone this repository and install the required dependencies:

git clone [email protected]:johnsmzr/Code-to-one-PDF.git 
cd Code-to-one-PDF 
pip install -r requirements.txt

Usage

Copy the compiled binary to the directory containing the code you want to convert to PDF, and run it:

./code-to-pdf

(Or manually run the Python code)

Configuration File

The configuration file .pdfignore.yml should be placed in the same directory. It specifies which files and directories to exclude. For example:

directories:
  - .git
  - log
files:
  - .DS_Store
patterns:
  - '*.pdf'
  - '*.tmp'

Compile to Binary

pyinstaller --onefile code-to-pdf.py

FAQ

Q: Can I exclude files based on their content?

A: Currently, exclusion is only based on file names and directory paths specified in the configuration file.

code-to-one-pdf's People

Contributors

johnsmzr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.