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

docs: number-offset is HTML only option #7703

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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
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.

None yet

2 participants