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

[references] Add tabsets among the flag for HTML features #9916

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Jun 7, 2024

When settings minimal: true, some features can be re-enabled as mentioned in documentation https://quarto.org/docs/output-formats/html-basics.html#minimal-html

Tabsets is among those.

However it was not documented in our references because not in schema.

This PR adds this

YAML header example:

---
title: test
format: html
minimal: true
tabsets: true
---

For reference, those features that are disable are here in the code

function htmlFormatFeatureDefaults(
format: Format,
): HtmlFormatFeatureDefaults {
const bootstrap = formatHasBootstrap(format);
const minimal = format.metadata[kMinimal] === true;
return {
tabby: !minimal && !bootstrap,
copyCode: !minimal,
anchors: !minimal,
hoverCitations: !minimal,
hoverFootnotes: !minimal,
figResponsive: !minimal,
codeAnnotations: !minimal,
hoverXrefs: !minimal,
};
}

And can be renable individually

// apply defaults
if (featureDefaults.tabby) {
options.tabby = format.metadata[kTabsets] !== false;
} else {
options.tabby = format.metadata[kTabsets] || false;
}
if (featureDefaults.copyCode) {
options.copyCode = format.metadata[kCodeCopy] !== false;
} else {
options.copyCode = format.metadata[kCodeCopy] || false;
}
if (featureDefaults.anchors) {
options.anchors = format.metadata[kAnchorSections] !== false;
} else {
options.anchors = format.metadata[kAnchorSections] || false;
}
if (featureDefaults.hoverCitations) {
options.hoverCitations = format.metadata[kCitationsHover] !== false;
} else {
options.hoverCitations = format.metadata[kCitationsHover] || false;
}
if (featureDefaults.hoverFootnotes) {
options.hoverFootnotes = format.metadata[kFootnotesHover] !== false;
} else {
options.hoverFootnotes = format.metadata[kFootnotesHover] || false;
}
// Books don't currently support hover xrefs (since the content to preview in the xref
// is likely to be on another page and we don't want to do a full fetch of that page
// to get the preview)
if (featureDefaults.hoverXrefs) {
options.hoverXrefs = format.metadata[kXrefsHover] !== false;
} else {
options.hoverXrefs = format.metadata[kXrefsHover] || false;
}
if (featureDefaults.figResponsive) {
options.figResponsive = format.metadata[kFigResponsive] !== false;
} else {
options.figResponsive = format.metadata[kFigResponsive] || false;
}
if (featureDefaults.codeAnnotations) {
options.codeAnnotations = format.metadata[kCodeAnnotations] || true;
} else {
options.codeAnnotations = format.metadata[kCodeAnnotations] || false;
}

@cderv cderv merged commit b398fdf into main Jun 10, 2024
47 checks passed
@cderv cderv deleted the references/tabsets branch June 10, 2024 13:33
@cscheid
Copy link
Collaborator

cscheid commented Jun 10, 2024

(Sorry I missed this earlier) Changelog entry?

@cderv
Copy link
Collaborator Author

cderv commented Jun 10, 2024

This is not a new feature, it was just no showing in the reference page and autocompletion. But it was already available.
Do we add changelog for YAML schema updates or fix ?

I definitely can, just didn't think it was needed.

@cscheid
Copy link
Collaborator

cscheid commented Jun 10, 2024

Do we add changelog for YAML schema updates or fix ?

Yes, because it affects (eg) quarto.org, yaml completions, yaml validation, etc.

@cderv
Copy link
Collaborator Author

cderv commented Jun 10, 2024

Ok. I'll remember for next time (and so add for this one).

Thanks for the reminder !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants