Giter Site home page Giter Site logo

alfareiza / repository-to-pdf Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 13 KB

[Personal Project] Python program that converts your repository into a PDF file locally. It takes the information using argparse as mechanism of input. Besides, I used pdfkit and pygments as external libraries.

License: MIT License

Python 100.00%
argparse python pdfkit pygments pathlib

repository-to-pdf's Introduction

Python Script that convert your repository to PDF
GitHub stars GitHub followers

⚈ About This

I decided to make this program because in cases where I work with projects in django, there are a lot of boring files and structures to follow. This is why I usually print the code to have it closer to me, but for this to happen, they have to go through a lot of copying and pasting. This is why I decided to convert my repositories to pdf.

⚈ Prerequisites

Git, Pip, Python (^3.8) installed and configured as environment variables.

1. Clone the Project

Execute the next command on your terminal

git clone https://github.com/Alfareiza/repository-to-pdf.git

2. Isolate the environment

Once the repository has been cloned, a folder is created with the name of the project repository-to-pdf.

Go toward this folder using the terminal :

cd repository-to-pdf

And execute:

python -m venv .venv

Then to activate the isolated environment execute the next command according to your O.S

Windows Linux
.venv\Scripts\activate source .venv/bin/activate

Finally, execute:

pip install -r requirements.txt

All the dependencies and sub-dependencies will be installed on the local project.

⚈ How to use it

Once the environment has been isolated, you can execute the program through the terminal.

So, for the magic to happen, execute the next command:

python -m generate_pdf.py {path_of_the_directory}

Examples:

    python generate_pdf.py --style tango /home/alfonso/PycharmProjects/blog/

    python generate_pdf.py /home/alfonso/PycharmProjects/colombian_newspapers

    python -m generate_pdf /home/alfonso/PycharmProjects/xml-to-json
    
    python generate_pdf.py C:\Users\Alfonso\PycharmProjects\ScrappingColombianNewspapers

In case you want to change the theme, you can choose it from the next list:

  • bw
  • sas
  • xcode
  • autumn
  • borland
  • arduino
  • igor
  • lovelace
  • pastie
  • rainbow_dash
  • emacs
  • tango
  • colorful
  • rrt
  • algol
  • abap

repository-to-pdf's People

Contributors

alfareiza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

repository-to-pdf's Issues

Became it in Web

Currently, this project only works if you clone it and use it locally. However, the purpose of this issue is register the necessity to create a webapp who execute this repo in the back end.

So, you can paste your github repository and it gill generate and pdf .

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.