useblocks / sphinx-simplepdf

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

Backcover appears in PDF, but not in HTML #49

Closed sachin-suresh-rapyuta closed 1 year ago

sachin-suresh-rapyuta commented 1 year ago

With the below configuration in conf.py, I am also getting the cover image at the end of the PDF. Is this a backcover for the PDF? If so, why I am not able to see this image in the simplepdf html?

simplepdf_vars = {
    'primary-opaque': '#E11A27',
    'cover-bg': 'url(User_guide_pdf_cover.png) no-repeat center',
    'primary': '#E11A27',
    'secondary': '#E11A27',
    'cover': '#ffffff',
    'white': '#ffffff',
    'links': '#2980B9',
    'top-left-content': 'counter(page)',
    'top-center-content': '',
    'top-right-content': '"My Documentation"',
    'bottom-left-content': 'counter(page)',
    'bottom-center-content': '',
    'bottom-right-content': 'string(heading)'
}
danwos commented 1 year ago

Yes, it's a back cover for the PDF and is currently hard-coded. So there is no option to deactivate it.

it is part of the simplepdf HTML build and the resulting HTML code, but may not be configured via CSS the right way, so that you can easily see it. But that's not needed, as the simplepdf HTML artifacts are just an intermediate step and should not be used by the user directly.

I close this issue as it is not a bug, but feel free to reopen if you have further requests.

sachin-suresh-rapyuta commented 1 year ago

So what if I need to include a custom back cover png? Where and how I can configure it? I tried to set the back cover for the #back-cover ID and I get error:

ERROR: No anchor # for internal URI reference.

My custom.css:

#back-cover{
  background: url('../backcover.png') no-repeat center;
  background-size: cover;
}
danwos commented 1 year ago

There is no way to configure it via the conf.py, yet.

The only way I see is custom CSS and even a custom template file. But I don't know any implementation of it and I'm currently too busy to make some tests here.