useblocks / sphinx-simplepdf

A simple PDF builder for Sphinx documentations
https://sphinx-simplepdf.readthedocs.io
MIT License
32 stars 14 forks source link

`html_extra_path` to copy the custom file to the simplepdf build root directory #64

Open sachin-suresh-rapyuta opened 1 year ago

sachin-suresh-rapyuta commented 1 year ago

Is there a html_extra_path configuration option in simplepdf?

For example, if I want to copy a custom file, say test.htmlto the html's build root directory, in conf.py, I can do so by:

html_extra_path = ['user/test.html'] //user/test.html gets copied to build/html

How to achieve this for simplepdf? i.e., to copy user/test.html to /simplepdf

danwos commented 1 year ago

This is not supported, as Sphinx-SimplePDF needs a single HTML file, which is created by Sphinx.

I don't know if there is a mechanism inside Sphinx, which can merge the Sphinx-SingleHTML output with data from additional HTML files. I would guess not, as this is quite complex and use case specific.

Maybe a better approach would be to use the Sphinx Jinja Template system to define additional HTML content for the later SingleHTML build.