Metadata-Version: 2.1
Name: pelican-html-to-pdf
Version: 2.0.0
Summary: HTML to PDF is a Pelican plugin for generating PDFs from specific articles and pages HTML files.
Keywords: pelican,plugin,pdf
Author-Email: Matt Marcha <from+topdf@marcha.me>
License: AGPL-3.0
Classifier: Development Status :: 1 - Planning
Classifier: Environment :: Console
Classifier: Framework :: Pelican
Classifier: Framework :: Pelican :: Plugins
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Homepage, https://codeberg.org/MattMarcha/pelican-html-to-pdf/
Project-URL: Issue Tracker, https://codeberg.org/MattMarcha/pelican-html-to-pdf/issues
Project-URL: Changelog, https://codeberg.org/MattMarcha/pelican-html-to-pdf/blob/main/CHANGELOG.md
Requires-Python: >=3.13
Requires-Dist: pdfkit>=1.0.0
Requires-Dist: pelican>=4.5
Provides-Extra: markdown
Requires-Dist: markdown>=3.4; extra == "markdown"
Description-Content-Type: text/markdown

HTML to PDF: A Plugin for Pelican
====================================================

[![Build Status](https://codeberg.org/mattmarcha/pelican-html-to-pdf/badges/workflows/main.yml/badge.svg?label=Build)](https://codeberg.org/MattMarcha/pelican-html-to-pdf/actions)
[![PyPI Version](https://img.shields.io/pypi/v/pelican-html-to-pdf)](https://pypi.org/project/pelican-html-to-pdf/)
[![Downloads](https://img.shields.io/pypi/dm/pelican-html-to-pdf)](https://pypi.org/project/pelican-html-to-pdf/)
![License](https://img.shields.io/pypi/l/pelican-html-to-pdf?color=blue)

HTML to PDF is a Pelican plugin for generating PDFs from specific articles and pages HTML files.
This plugins differs from the [PDF](https://github.com/pelican-plugins/pdf) Pelican plugin as :

- It generates a PDF only for the articles/pages flagged for.
- The generation is based on the HTML files and can be styled with CSS

Works on top of `wkhtmltopdf` and `pdfkit`.

Installation
------------

This plugin can be installed via:

    python -m pip install pelican-html-to-pdf

As long as you have not explicitly added a `PLUGINS` setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add `html_to_pdf` to your existing `PLUGINS` list. For more information, please see the [How to Use Plugins](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.

### Dependancies

- wkhtmltopdf (system)
- pdfkit (Python)


Usage
-----

Simply add the metadata `To_pdf` to your page to trigger a PDF generation for the page/article.
The value can be empty, or a python dictionnary to set the file name and/or add a stylesheet :

```markdown
To_pdf: {'name': 'mysuperfile', 'css': 'content/static/print.css'}
```

> Note :
> - PDF files will be generated at the same path as the HTML file.
> - Identical names at same path will result in overwriting.

#### Emojis

For emojis support in wkhtmltopdf, the font has to be set to one with emoji support which will depend of the system or has to be fetched online (ex: `Noto Color Emoji` on my system).
For emojis added through css `content`, use the unicode.

Contributing
------------

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].

To start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.

[existing issues]: https://codeberg.org/MattMarcha/pelican-html-to-pdf/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html

License
-------

This project is licensed under the AGPL-3.0 license.
