Skip to content

Conversation

mcanouil
Copy link
Collaborator

This PR updates the reference options for. number-offset which is an HTML only option.

Related to #6842.
Until Pandoc uses the option on other formats, it is better to not wrongly display it in all formats.

@mcanouil mcanouil added the documentation Doc improvements & quarto-web label Nov 29, 2023
@cderv
Copy link
Collaborator

cderv commented Nov 29, 2023

@mcanouil I believe we are supposed to handle number-offset directly in Quarto through Lua, and this is part of Crossref feature.

const kCrossrefFilterParams = [kListings, kNumberSections, kNumberOffset];

local numberOffset = pandoc.List(param("number-offset", {}))

-- chapter entry
if refType(chapterId) == "sec" and param("number-offset") ~= nil then
local chapterEntry = {
key = chapterId,
parent = nil,
order = {
number = 1,
section = crossref.index.numberOffset
}
}
index.entries:insert(chapterEntry)
end
end

This could be look for commit history to understand the background.

That would be worth looking why this is does not work anymore as it should have been. It seems deeper than just a documentation change.

Or maybe it has never worked... 🤷‍♂️ Would be worth looking in the history

We do have a Lua filter for this numbering feature in R Markdown (https://github.com/rstudio/rmarkdown/blob/main/inst/rmarkdown/lua/number-sections.lua) so I would assume this would have been ported over

Anyhow, worth looking deeper (Did not do it, just sharing this info for now)

@mcanouil
Copy link
Collaborator Author

Thanks @cderv I tried few versions of Quarto and if it ever worked it was a long time ago^^

@cderv
Copy link
Collaborator

cderv commented Nov 29, 2023

Ok thanks for trying. Then the question should be raised in the team discussion for historical behavior. It may has been lost over version because not well tracked, and indeed not Pandoc supported. This would have been an addition from Quarto.

For 1.4 this indeed seems to be a documentation update we need to confirm, and probably worth reinserting the feature properly (or debug) for later. (not sure about the timing).

@mcanouil
Copy link
Collaborator Author

mcanouil commented Nov 29, 2023

@dragonstyle added the 1.5 milestone to the original issue, thus this PR might only be for 1.4 time being (and possibly at most).

Quick note: the few lines from Lua filter here seems to be for PDF books not simple PDF.

@mcanouil mcanouil added the needs-discussion Issues that require a team-wide discussion before proceeding further label Nov 29, 2023
@cscheid cscheid added this to the v1.6 milestone Jun 27, 2024
@cscheid cscheid modified the milestones: v1.6, v1.7 Nov 22, 2024
@cscheid
Copy link
Collaborator

cscheid commented Mar 14, 2025

(I'm still chasing old notifications, sorry for the delayed response) I'll wait to review when this passes tests.

@mcanouil
Copy link
Collaborator Author

I fixed the typo... (early days on the codebase^^)

@cscheid
Copy link
Collaborator

cscheid commented Apr 7, 2025

I tried to merge against main and rebuild the build-js resources but I don't know where my push ended up 🤷. @mcanouil Can you merge against main, run quarto build-js and push again? Thanks.

@cscheid
Copy link
Collaborator

cscheid commented Apr 8, 2025

This looks good, thanks. I don't think we need a changelog entry.

@cscheid cscheid merged commit fcb7761 into quarto-dev:main Apr 8, 2025
49 checks passed
@mcanouil mcanouil deleted the docs/number-offset-html-only branch July 15, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Doc improvements & quarto-web needs-discussion Issues that require a team-wide discussion before proceeding further

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants