|
| 1 | +# Athena |
| 2 | + |
| 3 | +[Main Website][athenapdf] |
| 4 | + |
| 5 | +Simple, Docker-powered PDF conversions. |
| 6 | + |
| 7 | +Athena is comprised of an [Electron][electron] command line interface (CLI) tool, and a [Go][go] microservice for converting HTML to PDF documents. |
| 8 | + |
| 9 | +> Athena transformed Arachne into a spider for challenging her as a weaver and/or weaving a tapestry that insulted the gods. |
| 10 | +
|
| 11 | +**Examples:** |
| 12 | + |
| 13 | +- Original: [Google isn’t even close as a tool for proper due diligence. Why not?][example-1] **(Converted: [PDF][example-1-pdf] | [Aggressive][example-1-aggressive])** |
| 14 | +- Original: [Panamanian Law Firm Is Gatekeeper To Vast Flow of Murky Offshore Secrets][example-2] **(Converted: [PDF][example-2-pdf] | [Aggressive][example-2-aggressive])** |
| 15 | + |
| 16 | +_When [aggressive mode][aggressive] is toggled, only the essential contents of a page are kept in the generated PDF document. It is a clutter-free version of the web page, perfect for reading._ |
| 17 | + |
| 18 | +**HTML, PDF, PDF (Aggressive):** |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +## Background |
| 24 | + |
| 25 | +Athena is an open source project. |
| 26 | + |
| 27 | +It was designed to [do one thing and to do it well][unixphil] - PDF conversions; to work together with other programs; and to be able to handle text streams, because that is a universal interface. |
| 28 | + |
| 29 | +It aims to empower individuals, and organisations with an on-demand capability to convert HTML to PDF without frills. |
| 30 | + |
| 31 | +At the lowest level, its [CLI][cli] component ([`athenapdf`][cli]) was designed to be an alternative / drop-in replacement for [wkhtmltopdf], a popular CLI tool for HTML to PDF conversions. |
| 32 | + |
| 33 | +There is also a [microservice][weaver] component ([`weaver`][weaver]), and it was designed to be an alternative / drop-in replacement for paid services like [CloudConvert][cloudconvert], but with more freedom, and flexibility, and without limitations, long support response times, and price plans. |
| 34 | + |
| 35 | + |
| 36 | +## Getting Started |
| 37 | + |
| 38 | +### CLI vs Microservice |
| 39 | + |
| 40 | +Our [CLI][cli] tool will suffice for most simple, and everyday HTML to PDF conversions. |
| 41 | + |
| 42 | +However, for conversions at scale / PDF conversion as a service, we recommend getting started with our [microservice][weaver] component instead. |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +The microservice is packaged with `athenapdf`, and you can run both components independently. |
| 47 | + |
| 48 | +### Docker |
| 49 | + |
| 50 | +Both components are packaged, and distributed as [Docker][docker] images. |
| 51 | + |
| 52 | +The only dependency you will need is Docker, and the rest will be handled for you (even if you are running in an environment without a display server - [headless environment][headless]). |
| 53 | + |
| 54 | +### Quick Start |
| 55 | + |
| 56 | +Before starting, ensure your [Docker][docker] environment is set up, and ready-to-use. |
| 57 | + |
| 58 | +**For OSX / Windows users**, ensure your [Docker Machine][docker-machine] is prepared, and the appropriate environment variables are established. |
| 59 | + |
| 60 | +#### CLI |
| 61 | + |
| 62 | +[](https://asciinema.org/a/c1fbvtdnrctfq6baipfox00ct) |
| 63 | + |
| 64 | +1. `docker pull arachnysdocker/athenapdf` |
| 65 | +2. `docker run --rm -v $(pwd):/converted/ arachnysdocker/athenapdf athenapdf <input_path> [output_path]` |
| 66 | +3. See [`cli`][cli] for full documentation |
| 67 | + |
| 68 | +The `[output_path]` can be omitted. |
| 69 | + |
| 70 | +Example: `docker run --rm -v $(pwd):/converted/ arachnysdocker/athenapdf athenapdf http://blog.arachnys.com/` |
| 71 | + |
| 72 | +#### Microservice |
| 73 | + |
| 74 | +[](https://asciinema.org/a/41247) |
| 75 | + |
| 76 | +1. `docker pull arachnysdocker/athenapdf-service` |
| 77 | +2. `docker run -p 8080:8080 --rm arachnysdocker/athenapdf-service` |
| 78 | +3. Inline conversion: `http://<docker-address>:8080/convert?auth=arachnys-weaver&url=http://blog.arachnys.com/` |
| 79 | +4. OR cURL, and redirect output to file: `curl http://dockerhost:8080/convert\?auth\=arachnys-weaver\&url\=http://blog.arachnys.com/ |> out.pdf` |
| 80 | +5. See [`weaver`][weaver] for full documentation |
| 81 | + |
| 82 | +The default authentication key is `arachnys-weaver`. This can be changed through the `WEAVER_AUTH_KEY` environment variable. |
| 83 | + |
| 84 | + |
| 85 | +## License |
| 86 | + |
| 87 | +Please note `athenapdf` is NEITHER affiliated with NOR endorsed by Google Inc. and GitHub Inc. |
| 88 | + |
| 89 | +See [`LICENSE`](LICENSE). |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +An [Arachnys][arachnys] Christmas project. |
| 96 | + |
| 97 | + |
| 98 | +[athenapdf]: http://www.athenapdf.com/ |
| 99 | +[unixphil]: https://en.wikipedia.org/wiki/Unix_philosophy |
| 100 | +[example-1]: http://blog.arachnys.com/google-isnt-even-close-to-proper-due-diligence.-why-not?utm_campaign=athena&utm_medium=external%20website&utm_source=github&utm_content=readme |
| 101 | +[example-1-pdf]: https://s3-eu-west-1.amazonaws.com/athena-pdf-public/examples/d0ae9e636bb7edceac48bd9b0780ad9dd69397cc.pdf |
| 102 | +[example-1-aggressive]: https://s3-eu-west-1.amazonaws.com/athena-pdf-public/examples/d0ae9e636bb7edceac48bd9b0780ad9dd69397cc-aggressive.pdf |
| 103 | +[example-2]: https://panamapapers.icij.org/20160403-mossack-fonseca-offshore-secrets.html |
| 104 | +[example-2-pdf]: https://s3-eu-west-1.amazonaws.com/athena-pdf-public/examples/f86e19ea13661e47c1f5f83bbde650eb3fe85aad.pdf |
| 105 | +[example-2-aggressive]: https://s3-eu-west-1.amazonaws.com/athena-pdf-public/examples/f86e19ea13661e47c1f5f83bbde650eb3fe85aad-aggressive.pdf |
| 106 | +[aggressive]: cli/docs/aggressive.md |
| 107 | +[electron]: http://electron.atom.io/ |
| 108 | +[go]: https://golang.org/ |
| 109 | +[cli]: cli/ |
| 110 | +[weaver]: weaver/ |
| 111 | +[wkhtmltopdf]: http://wkhtmltopdf.org/ |
| 112 | +[cloudconvert]: https://cloudconvert.com/ |
| 113 | +[docker]: https://www.docker.com/ |
| 114 | +[docker-machine]: https://docs.docker.com/mac/step_one/ |
| 115 | +[headless]: http://internetofthingsagenda.techtarget.com/definition/headless-system |
| 116 | +[arachnys]: https://www.arachnys.com/?utm_campaign=athena&utm_medium=external%20website&utm_source=github&utm_content=readme |
0 commit comments