Skip to content

evanlh/code2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

27757fe · Apr 12, 2023

History

13 Commits
Sep 18, 2017
Sep 10, 2017
Sep 10, 2017
Apr 12, 2023
Oct 15, 2017
Oct 15, 2017
Sep 20, 2017
Oct 15, 2017
Sep 25, 2017
Oct 15, 2017
Sep 25, 2017
Oct 14, 2017
Aug 26, 2021
Sep 10, 2017

Repository files navigation

What is this?

One day I woke up & thought “Wouldn’t it be nice to be able to study a codebase like a book? Just curl up with a repo & study away, no distractions or notifications?”

This is an attempt to answer that question. The answer is it’s not very nice, codebases are just too big, it’s like reading a non-linear War & Peace without the aid of hypertext navigation.

But you’re welcome to try for yourself, it was still a fun experiment.

Installation

npm i

Usage

To print usage info

$ npm run code2pdf

Which will echo…

Usage: index [options]

Options:
  -t, --theme <cssfile>        Specify theme css
  -d, --directory <directory>  One or more directories to traverse
  -o, --output <outputfile>    Path to write PDF file to
  -p, --pagesize <pagesize>    A3|A4|A5|A6
  -h, --help                   output usage information

To pass arguments in, use `npm run`’s facility:

$ npm run code2pdf -- -d /path/to/my/code -o /path/to/output.pdf

Bugs & Issues

  • You have to be very explicit about what the directory you want crawled (usually `src`) because detection of what is vs is not source code is currently very poor.
  • There is currently no way of specifying globs of files to include/exclude
  • I need to upgrade the version of highlight.js

About

Beautiful Print-ready Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published