Project

source2pdf

0.0
No commit activity in last 3 years
No release in over 3 years
Export any project from a given git repository (or a local directory) to a single pdf file. Combine useful features of vim_printer, html2pdf, pdfs2pdf and others to produce a single pdf file for quick review.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 1.0
~> 2.13
~> 5.4
~> 0.10
~> 1.1
~> 10.3
~> 0.53
~> 0.9

Runtime

~> 1.2.8
~> 0.2
~> 0.2
~> 0.19.1
 Project Readme

source2pdf

Gem Version Dependency Status Code Climate

Export/print content of a given git repository (or local project directory) to a single pdf for quick review offline.

Requirements

Installation

gem install source2pdf

Synopsis/Usage

Basic Usage

Usage:

  $source2pdf -e, --exts=EXT1 EXT2 EXT3 -u, --url=URL -theme=theme_name --output-name=output_file.pdf

Example:

  # Export the *.rb from the given repository

  $source2pdf -e rb -u https://github.com/agilecreativity/source2pdf.git

  # Export the *.rb and also 'Gemfile' from a 'source2pdf' directory
  # Note: this directory must be directly below the current directory

  $source2pdf -e rb -f Gemfile -u source2pdf

  # Same as previous command with the 'solarized' instead of 'default' colorscheme
  $source2pdf -e rb -f Gemfile -u filename_cleaner -t solarized

Options:

  -u, --url=URL                   # The full url of the github project to be cloned OR local directory name

  -e, --exts=EXT1 EXT2 EXT3 ..    # The list of extension names to be exported
                                  # e.g. -e md rb java

  -f, [--non-exts=one two three]  # The list of file without extension to be exported
                                  # e.g. -f Gemfile LICENSE

  -t, [--theme=theme_name]        # The theme/colorscheme to be used with vim_printer see :help :colorscheme from inside Vim
                                  # default: 'default'
                                  # e.g. -t solarized

  -o, [--output-name=output.pdf]  # The output pdf filename (will default to 'repository_name'.pdf)
                                  # e.g. -o repository_name.pdf

Export a given Github project or a local project directory to a single pdf file

Sample Usage:

source2pdf -u https://github.com/agilecreativity/source2pdf.git -e rb

Should result in something similar to this in the console

The project /Users/agilecreativity/Desktop/source2pdf already exist, no git clone needed!
FYI: list of extensions: ["gem", "gemspec", "lock", "md", "pdf", "png", "rb"]
FYI: list of all files : ["./lib/source2pdf.rb", "./lib/source2pdf/cli.rb", "./lib/source2pdf/source2pdf.rb", "./lib/source2pdf/exporter.rb", "./lib/source2pdf/logger.rb", "./lib/source2pdf/version.rb", "./test/lib/github_exporter/test_github_exporter.rb", "./test/test_helper.rb"]
FYI: input options for VimPrinter : ["print", "--base-dir", "/Users/agilecreativity/Desktop/source2pdf", "--exts", ["rb"], "--theme", "seoul256", "--recursive"]
FYI: process file 1 of 8 : ./lib/source2pdf.rb
FYI: process file 2 of 8 : ./lib/source2pdf/cli.rb
FYI: process file 3 of 8 : ./lib/source2pdf/source2pdf.rb
FYI: process file 4 of 8 : ./lib/source2pdf/exporter.rb
FYI: process file 5 of 8 : ./lib/source2pdf/logger.rb
FYI: process file 6 of 8 : ./lib/source2pdf/version.rb
FYI: process file 7 of 8 : ./test/lib/github_exporter/test_github_exporter.rb
FYI: process file 8 of 8 : ./test/test_helper.rb
Your output file is '/Users/agilecreativity/Desktop/source2pdf/vim_printer_source2pdf.tar.gz'
Convert file 1 of 9 : ./index.html
Convert file 2 of 9 : ./lib/source2pdf.rb.xhtml
Convert file 3 of 9 : ./lib/source2pdf/cli.rb.xhtml
Convert file 4 of 9 : ./lib/source2pdf/source2pdf.rb.xhtml
Convert file 5 of 9 : ./lib/source2pdf/exporter.rb.xhtml
Convert file 6 of 9 : ./lib/source2pdf/logger.rb.xhtml
Convert file 7 of 9 : ./lib/source2pdf/version.rb.xhtml
Convert file 8 of 9 : ./test/lib/github_exporter/test_github_exporter.rb.xhtml
Convert file 9 of 9 : ./test/test_helper.rb.xhtml
Convert files to pdfs took 8.01304 ms
Your final output is '/Users/agilecreativity/Desktop/source2pdf_tmp/source2pdf/html2pdf_source2pdf.tar.gz'
Create pdfmarks took 0.026689 ms
Combine pdf files took 0.463659 ms
Your combined pdf is available at /Users/agilecreativity/Desktop/source2pdf_tmp/source2pdf/pdfs2pdf_source2pdf.pdf
Your final output is /Users/agilecreativity/Desktop/source2pdf.pdf

Sample Output

Using the 'default' theme/colorscheme for Vim

source2pdf -u https://github.com/agilecreativity/source2pdf.git --exts rb

Which generated the following pdf output file

The example screenshot:

Use non-default colorscheme/theme for Vim

Use my favourite seoul256 colorscheme

source2pdf -u https://github.com/agilecreativity/source2pdf.git --exts rb --theme seoul256

Which generated the following pdf output file

The example screenshot:

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request