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

top-level H1 should become titles when no other title is provided as metadata #11660

Open
cderv opened this issue Dec 11, 2024 · 0 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Dec 11, 2024

This change was intended by

mainly as a fix for breadcrumbs when no title

but also as a first step (HTML only right now) to have h1 considered as title when no title provided.

Citing @cscheid from #11618 (comment) below


We do intend for top-level H1's to become titles.

H1's inside other elements are a different story. I would like to (gently) nudge document authors to use H2s instead of H1s, but mostly because this would make some downstream tooling easier to write. With that said, I don't think we would ever want an "inner" H1 like the one in your document to be interpreted as the document title.

In concrete examples, we want the following two documents to be equivalent to each other:

Document 1:

---
format: html
title: A title
---

Some content

Document 2:

---
format: html
---

# A title

Some content

However, these should not be equivalent to the following Document 3:

---
format: html
---

::: {#a-div}
# A title
:::

Some content

However the change in #11224 has been a bit too agressive and caused undesired regression

So we reverted to apply it only for website right now (#11640)

This is issue is tracking the utlimate aim to have h1 behave as title in the right situations.

Consideration from previous work and discussions

  • title is a metadata that pandoc will use in Pandoc's template. Mainly through our title-block partials. So we probably need to handle this h1 to title promotion in Lua
  • Especially because we manage several different title-block partials that applies in different situation (website, manuscript, bootstrap or not, title banner or not). So doing h1 promotion as post processing (like in add title canonicalization html postprocessor #11224 ) can be tricky or at least requires conditionals.
@cderv cderv added the enhancement New feature or request label Dec 11, 2024
@cderv cderv added this to the Future milestone Dec 11, 2024
@mcanouil mcanouil marked this as a duplicate of #11686 Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant