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

Self-contained HTML with block banner figure #1496

Open
GilHenriques opened this issue Jul 22, 2022 · 12 comments
Open

Self-contained HTML with block banner figure #1496

GilHenriques opened this issue Jul 22, 2022 · 12 comments
Labels
bug Something isn't working verify-fixed Already fixed, awaiting verification from the issue reporter to confirm.
Milestone

Comments

@GilHenriques
Copy link

Thank you for developing Quarto! I'm not sure which repo to post this issue in; I am posting it here as I'm working with Quarto in RStudio, but I apologize if it is the wrong repo.

According to the Quarto website we can set up a custom background for a title block banner by using the image path as an argument for title-block-banner in the header. Also according to the website, we can use self-contained: true under html to create "a standalone HTML file with no external dependencies", "with images, CSS, etc. embedded into the HTML file". But when I create a supposedly self-contained HTML file with a banner image, I need to keep the HTML file in the root directory of the provided image path; otherwise, the image doesn't show. In other words, the document is not self-contained, inasmuch as it depends on the presence of the image file.

@cderv cderv transferred this issue from quarto-dev/quarto-r Jul 22, 2022
@cderv
Copy link
Collaborator

cderv commented Jul 22, 2022

quarto-r repo issue board is dedicated to R package issues. So I transferred to quarto-cli.

It seems Pandoc is failing to apply self-contained on this

<style>
.quarto-title-block .quarto-title-banner {
    background-image: url(<file>)
}
</style>

when it is included in the HTML file.

I don't know if this is a limitation or a bug.

It possible the Pandoc consider that the CSS is already inline and will not process it. If the CSS is added using an external file, it seems to be processed correctly.

@cderv
Copy link
Collaborator

cderv commented Jul 22, 2022

I opened an issue in Pandoc to ask : jgm/pandoc#8193

@GilHenriques
Copy link
Author

Thank you for your reply and for opening the issue in Pandoc, and sorry for opening the issue in the wrong place.

@mcanouil
Copy link
Collaborator

mcanouil commented Jul 22, 2022

Seems to be related to #980 thus to jgm/pandoc#5124 🤔

I think a LUA filter replacing the image with the base64 image would solve this post rendering (I am kind of already working a bit on this).

@cderv
Copy link
Collaborator

cderv commented Jul 22, 2022

@mcanouil I think it is a bit different has it is not the same background-image attributes which is specifically treated for revealjs and not included in any CSS part. Pandoc correctly embed the CSS when passed in a file, but not when passed in the template directly. I think this is a pandoc issue. We'll see.

I think a LUA filter replacing the image with the base64 image would solve this post rendering (I am kind of already working a bit on this).

If we were to do that ourself, I think we would do it directly in Quarto when inserting the CSS. I don't think you get good access to this CSS part from the LUA filter anyway.

@mcanouil
Copy link
Collaborator

I think this is a pandoc issue. We'll see.

Since the issue is about the same css attributes and related to Pandoc, I assumed the main issue was the same. Indeed, we'll see.

If we were to do that ourself, I think we would do it directly in Quarto when inserting the CSS. I don't think you get good access to this CSS part from the LUA filter anyway.

This is what my first few tries seemed to tell me ^^

@cderv
Copy link
Collaborator

cderv commented Jul 22, 2022

Since the issue is about the same css attributes and related to Pandoc, I assumed the main issue was the same

Reveal has a specific way to configure background through Reveal.initialize({ in JS part of the template. And Pandoc did not process that for sure. So same name, but different usage IMO.

@dragonstyle dragonstyle added this to the Future milestone Jul 23, 2022
@cderv
Copy link
Collaborator

cderv commented Jul 25, 2022

@dragonstyle this has been fixed upstream in Pandoc now, so we'll be able to get that if / when we upgrade to pandoc next release. Fix in Pandoc: jgm/pandoc@4ea51b6

@GilHenriques
Copy link
Author

@dragonstyle this has been fixed upstream in Pandoc now, so we'll be able to get that if / when we upgrade to pandoc next release. Fix in Pandoc: jgm/pandoc@4ea51b6

Do you happen to know when the next release is scheduled for? 🙂

@dragonstyle
Copy link
Collaborator

We don't have a concrete timeframe. This week is the RStudio Conference so I'd expect this week to be quiet, but perhaps as early as next week, pre-release builds beginning to be updated once again. I'm not sure where a pandoc update will fall on the priority list, though we typically work pretty hard to stay on the latest pandoc.

@mcanouil
Copy link
Collaborator

mcanouil commented Jul 26, 2022

Since there is no project/milestone on Pandoc repository and no information elsewhere on releases scheduling (the last release is from the 4th of April), it's unclear when the fix mentionned above is going to be released, thus included in Quarto.

@GilHenriques
Copy link
Author

Sounds good, thank you for your help on this!

@mcanouil mcanouil added the verify-fixed Already fixed, awaiting verification from the issue reporter to confirm. label Jul 18, 2023
@mcanouil mcanouil added the bug Something isn't working label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verify-fixed Already fixed, awaiting verification from the issue reporter to confirm.
Projects
None yet
Development

No branches or pull requests

4 participants