Skip to content

Quarto vignette titles are broken with quarto 1.6.x #2823

Closed

Description

@banfai

With the pre-release version of quarto the page title has a glitch, it's in a different div <header id="title-block-header" class="quarto-title-block">) instead of the previous <div class="page-header">. This causes the Source link to be placed above the title:

release version on gh-pages:
quarto-vignette-1 5 x

same version rendered with quarto 1.6.37:
quarto-vignette-1 6 37

The page-header div is still there with the logo and the source code link, but the title is missing: <h1></h1>

quarto::quarto_version()
#> [1] '1.6.37'

It remains the same with specifying

format:
  html:
    title-block-style: none

Activity

  1. banfai commented on Nov 26, 2024

    @banfai
    ContributorAuthor
  2. jayhesselberth commented on Nov 26, 2024

    @jayhesselberth
    Collaborator

    Quarto tests are also failing with the new release, this appears to be the same problem:

    Failure (test-build-quarto-articles.R:59:3): auto-adjusts heading levels
    xpath_text(html, "//h1") (`actual`) not equal to "title" (`expected`).
    
    `actual`:   "" "title"
    `expected`:    "title"
    
    Failure (test-build-quarto-articles.R:104:3): quarto headings get anchors
    xpath_attr(headings, "./a", "href") (`actual`) not equal to c("#heading-1", "#heading-2") (`expected`).
    
    `actual`:   "#heading-1"             
    `expected`: "#heading-1" "#heading-2"
    
  3. jayhesselberth commented on Dec 2, 2024

    @jayhesselberth
    Collaborator

    It's not clear from the comments whether the change in quarto-dev/quarto-cli#11224 will be permanent. Perhaps we should clarify before updating pkgdown to process the changed HTML.

    I'm assuming we don't want to be supporting multiple versions of quarto, so if we update to process the new HTML, we'd need to bump the required quarto version to 1.6.33.

  4. banfai commented on Dec 2, 2024

    @banfai
    ContributorAuthor

    It's not clear from the comments whether the change in quarto-dev/quarto-cli#11224 will be permanent. Perhaps we should clarify before updating pkgdown to process the changed HTML.

    should I open an issue for quarto?

    I'm assuming we don't want to be supporting multiple versions of quarto, so if we update to process the new HTML, we'd need to bump the required quarto version to 1.6.33.

    this might be an issue for some time since 1.6.x is still pre-release

  5. cderv commented on Dec 2, 2024

    @cderv
    Contributor

    It took me some time to understand the problem and this is indeed quarto-dev/quarto-cli#11224 having side effect on the custom processing that pkgdown is doing

    Within pkgdown, quarto render is called with a custom template, that create a div structure with some information

    <div class="meta">
    $if(title)$
    <h1>$title$</h1>
    $endif$
    $if(subtitle)$
    <p class="subtitle">$subtitle$</p>
    $endif$
    $for(author)$
    <p class="author">$author$</p>
    $endfor$
    $if(date)$
    <p class="date">$date$</p>
    $endif$
    $if(abstract)$
    <div class="abstract">
    $abstract$
    </div>
    $endif$
    </div>

    The custom template is applying which leads to this in the HTML before Quarto postprocessing

    <div class="meta">
      <h1>My cool title</h1>
    </div>

    However, as the custom template does not use title-block.html partial, it will trigger the post processing introduced by PR quarto-dev/quarto-cli#11224 as if the document had no title.
    https://github.com/quarto-dev/quarto-cli/blob/39baf4081f184fe090974295b48d1beab32cd1e4/src/format/html/format-html-title.ts#L205

    and a title block will be created anyway by this new post-processing. The h1 from the custom template is caught
    https://github.com/quarto-dev/quarto-cli/blob/39baf4081f184fe090974295b48d1beab32cd1e4/src/format/html/format-html-title.ts#L210
    and the h1 that pkgdown expect will be moved
    https://github.com/quarto-dev/quarto-cli/blob/39baf4081f184fe090974295b48d1beab32cd1e4/src/format/html/format-html-title.ts#L238

    I don't know exactly why pkgdown does this title processing with specific custom template, but this is indeed a Quarto issue in the sense that it should not probably apply this eagerly

    @banfai

    should I open an issue for quarto?

    I'll do it

    this might be an issue for some time since 1.6.x is still pre-release

    Quarto 1.6 is the latest release since last week.

  6. banfai commented on Dec 2, 2024

    @banfai
    ContributorAuthor

    @banfai

    should I open an issue for quarto?

    I'll do it

    thanks!

    this might be an issue for some time since 1.6.x is still pre-release

    Quarto 1.6 is the latest release since last week.

    oops, I missed that

  7. hadley commented on Dec 5, 2024

    @hadley
    Member

    Can we make pkgdown work either way? This is causing pkgdown to fail on CRAN and it's likely easier to submit an updated pkgdown than get CRAN to update their quarto.

  8. jayhesselberth commented on Dec 5, 2024

    @jayhesselberth
    Collaborator

    @hadley We could fix this to work with quarto 1.6, but may then have to revert if this is "fixed" on the quarto CLI side.

    And if we want to fix, should we be supporting quarto 1.5 (where this test passes) as well as quarto 1.6?

  9. jayhesselberth commented on Dec 5, 2024

    @jayhesselberth
    Collaborator

    I am also not clear what specific quarto version that CRAN is installing in their systems for checks. Is that documented somewhere?

  10. jayhesselberth commented on Dec 6, 2024

    @jayhesselberth
    Collaborator

    Quarto devs are planning for a quick fix quarto-dev/quarto-cli#11224 (comment) so maybe we sit tight.

  11. cderv commented on Dec 6, 2024

    @cderv
    Contributor

    Yes we have a fix that should sove the problem for pkgdown. We'll do a patch release.

    I am also not clear what specific quarto version that CRAN is installing in their systems for checks. Is that documented somewhere?

    Though I am like you and I don't know for sure if CRAN update Quarto at each stable release we do

  12. cderv commented on Dec 10, 2024

    @cderv
    Contributor

    FYI we merge a fix in Quarto, including for a patch release. So next 1.6 and 1.7 will not have the problem that impact pkgdown.

  13. jayhesselberth commented on Dec 10, 2024

    @jayhesselberth
    Collaborator

    Thanks @cderv for the quick fix! Will leave this open until we confirm it's fixed in the next patch release of quarto.

  14. jayhesselberth commented on Jan 3, 2025

    @jayhesselberth
    Collaborator

    This should be fixed now with the release of 1.6.40, see #2828

  15. added a commit that references this issue on Jan 3, 2025
    4519ca0
  16. cderv commented on Jan 6, 2025

    @cderv
    Contributor

    Glad it works ok now. I don't know if CRAN will update their version, but if they do follow release then they may do it. We'll see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions