Go to file
Kujiu 3e49ee8612
More typing hints with strict checks
2023-09-19 02:01:13 +02:00
sphinx_pyppeteer_builder More typing hints with strict checks 2023-09-19 02:01:13 +02:00
typings More typing hints with strict checks 2023-09-19 02:01:13 +02:00
.gitignore Initial release 2020-06-20 16:57:17 +02:00
AUTHORS Can overwrite pyppeteer args 2023-09-17 15:13:59 +02:00
CHANGES More typing hints with strict checks 2023-09-19 02:01:13 +02:00
LICENSE Initial release 2020-06-20 16:57:17 +02:00
LICENSE-de Initial release 2020-06-20 16:57:17 +02:00
LICENSE-fr Initial release 2020-06-20 16:57:17 +02:00
LICENSE-nl Initial release 2020-06-20 16:57:17 +02:00
README.rst New git home 2020-07-08 01:04:26 +02:00
babel.cfg Initial release 2020-06-20 16:57:17 +02:00
pyproject.toml More typing hints with strict checks 2023-09-19 02:01:13 +02:00

README.rst

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head>

Sphinx Pyppeteer builder

Sphinx Pyppeteer builder is a PDF generator for Sphinx without usage of LaTeX. It uses Pyppeteer, a wrapper to control a web browser. It supports Chromium for now.

Install

You can install it with pip:

pip install sphinx_pyppeteer_builder

Or with setup.py:

python setup.py install
pyppeteer-install

Configuration

You can configure your output with these options:

  • pyppeteer_basename

  • pyppeteer_theme

  • pyppeteer_theme_options

  • pyppeteer_title

  • pyppeteer_theme_path

  • pyppeteer_short_title

  • pyppeteer_style

  • pyppeteer_css_files

  • pyppeteer_show_copyright

  • pyppeteer_show_sphinx

Each one has the same behavior of its equivalent for html builder.

In addition, you can set pyppeteer_pdf_options var. This dict is passed as is to the pdf coroutine. Default values are:

pyppeteer_pdf_options = {
    'printBackground': True,
    'format': 'A4',
    'margin': {
        'top': '20mm',
        'bottom': '20mm',
        'left': '10mm',
        'right': '10mm'
    }
}

Use

Just launch the following:

make pyppeteer

Why an other PDF builder for Sphinx?

LaTeX is really hard to use and to personalize. There's also an other project to make PDF without LaTeX but it is not based on CSS stylesheets.

Web browser to generate PDF have all new generation CSS specs implemented. You can use sphinx_weasyprint_builder instead if you don't want a full browser.

This plugin is just singlehtml output with conversion to PDF.

</html>