Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML template not used for header and footer #9990

Closed
Foitn opened this issue Jun 6, 2024 · 0 comments · Fixed by #10099
Closed

HTML template not used for header and footer #9990

Foitn opened this issue Jun 6, 2024 · 0 comments · Fixed by #10099
Labels
pdf Produce PDF as the output format

Comments

@Foitn
Copy link

Foitn commented Jun 6, 2024

In my previous issue #9463 I requested the use of header and footer to be added through a template.
This has now been added, but not in a way that is very usable.
I have several issues with the current implementation.

Template is not using html files

When I try to use the pdfHeaderTemplate, I cannot use it like the cover page.
I have tried the following:

pdf: true
pdfTocPage: true
pdfFileName: TestDoc.pdf
pdfCoverPage: articles/TestDoc/0-cover.html
pdfHeaderTemplate: articles/TestDoc/0-header.html
pdfFooterTemplate: articles/TestDoc/0-footer.html
items:
- name: Introduction
  href: 1-introduction.md
- name: Some amazing content
  href: 2-some-amazing-content.md
- name: Conclusion
  href: 3-conclusion.md

When I generate this, the cover page is properly added, but the header becomes (very tiny in the top left corner):
image
The same goes for the footer

In the toc.yml file, if I add the full html of the example/default I get an error, since the html contains a colon (:) since html works that way.

The header/footer are not added to the TOC page

Nothing is added on the TOC page.
image

What I would like

In the end it would be great if I can add a template for both header and footer in html file (or md which generates html files).
I have added the following zip, that contains all files that could be turned into a pdf file.
This PDF would contain 3 chapters, a TOC and the front page.
Each of these files would receive the header and footer as provided.

TestDoc.zip

@Foitn Foitn changed the title [Feature Request] My awesome feature HTML template not used for header and footer Jun 17, 2024
Foitn pushed a commit to Foitn/docfx that referenced this issue Jun 17, 2024
@yufeih yufeih added the pdf Produce PDF as the output format label Jun 19, 2024
yufeih added a commit to Foitn/docfx that referenced this issue Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pdf Produce PDF as the output format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants