Closed kreuzberger closed 9 months ago
I currently have no idea there it comes from.
__init__
) shows the "normal" theme without section names too
if self.app.config.html_theme != "simplepdf_theme":
print("Setting theme to sphinx_simplepdf")
@kreuzberger - Off topic, I was curious to know your configuration for the "page numbers" for top-left-content
and "section titles" for top-right-content
?
@sachin-suresh-rapyuta That's the default configuration.
Not used anymore for the DEMO PDF, to test certain things. But each other PDF should start with this config.
The default config can be found in this file: https://github.com/useblocks/sphinx-simplepdf/blob/main/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_variables.scss
$top-left-content: config('top-left-content', 'counter(page)') !default;
$top-center-content: config('top-center-content', '') !default;
$top-right-content: config('top-right-content', 'string(heading)') !default;
So its counter(page)
for top-left-content
and string(heading)
for top-right-content
.
These magic strings are coming from the weasyprint library. Unfortunately I haven't found a nice overview for these magic strings yet.
Oh, that was silly to ask, 'bottom-right-content'
already had this. Thanks, @danwos!
Seems the error with the section numbers comes from sphinx, where concrete name checks are used to identfy the build to add section and figure numbers. Refer to the Sphinx issue provided here
Due to the answers in https://github.com/sphinx-doc/sphinx/issues/11640 the desired way to be is to have a custom simplepdf writer (could extend Html5Translator) to get the two functions (sectionnumber and fignumber) implemented properly
Interesting and thanks for diving deeper into the root cause. Do you have some time to create such a customized writer? I'm currently totally overloaded with other projects, but happy to test stuff if needed.
Currently this issues (missing section numbers) does not block my current project, which is planned to have a release end of 09/2023. So currently i have no idea if i could spend some hours in September. But i would say no issue, the one who has time first should log the "start of work" here in this issue.
Ok, my index.rst uses toctree :numbered: The generated html has a numbered toc after the cover page, but the entries in the html have not. I attached the pdf from the demo as example. The toc is numbered, the sections in the pdf are not.
I am using Sphinx 4.5.0. Maybe this is the issue.
Sphinx-SimplePDF-DEMO.pdf
Originally posted by @kreuzberger in https://github.com/useblocks/sphinx-simplepdf/issues/19#issuecomment-1249155694