Skip to content

Commit

Permalink
Merge pull request #10840 from quarto-dev/chore/1.6-pandoc-update
Browse files Browse the repository at this point in the history
Chore: Update to Pandoc 3.4
cscheid authored Sep 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 1bc1695 + dbe086c commit 6b363d9
Showing 30 changed files with 173 additions and 75 deletions.
2 changes: 1 addition & 1 deletion configuration
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
export DENO=v1.41.0
# TODO figure out where 0.1.41 apple silicon libs are available
export DENO_DOM=v0.1.35-alpha-artifacts
export PANDOC=3.2
export PANDOC=3.4
export DARTSASS=1.70.0
export ESBUILD=0.19.12
export TYPST=0.11.0
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ _quarto:
html:
ensureHtmlElements:
-
- 'table.table'
- 'table'
- []
typst:
ensureTypstFileRegexMatches:
6 changes: 4 additions & 2 deletions dev-docs/update-pandoc-checklist.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## Updating the bundled version of Pandoc

- [ ] If needed, ask JJ to upgrade our archives
- [ ] Run `./package/src/quarto-bld update-pandoc PANDOC_VERSION`
Carlos needs to run this:

- [ ] Ensure archives are upgraded
- [ ] Run `AWS_PROFILE=... ./package/src/quarto-bld update-pandoc PANDOC_VERSION`
- [ ] look at `git diff`, specifically for changes in Pandoc templates, and adjust as needed.

## Manual steps
3 changes: 1 addition & 2 deletions src/resources/formats/html/_quarto-rules.scss
Original file line number Diff line number Diff line change
@@ -227,8 +227,7 @@ tr.header > th > p:last-of-type {
margin-bottom: 0px;
}

table,
table.table {
table {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
5 changes: 5 additions & 0 deletions src/resources/formats/html/pandoc/html.styles
Original file line number Diff line number Diff line change
@@ -144,7 +144,12 @@ table {
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
$if(table-caption-below)$
caption-side: bottom;
margin-top: 0.75em;
$else$
margin-bottom: 0.75em;
$endif$
}
tbody {
margin-top: 0.5em;
3 changes: 0 additions & 3 deletions src/resources/formats/html/pandoc/html.template
Original file line number Diff line number Diff line change
@@ -27,9 +27,6 @@ $for(header-includes)$
$header-includes$
$endfor$
$if(math)$
$if(mathjax)$
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
$endif$
$math$
$endif$
</head>
Original file line number Diff line number Diff line change
@@ -91,6 +91,11 @@ $if(article.funding-statement)$
<funding-statement>$article.funding-statement$</funding-statement>
</funding-group>
$endif$
$if(supplementary-material)$
<supplementary-material>
$supplementary-material$
</supplementary-material>
$endif$
</article-meta>
</front>
<body>
3 changes: 3 additions & 0 deletions src/resources/formats/pdf/pandoc/doc-class.tex
Original file line number Diff line number Diff line change
@@ -13,6 +13,9 @@
$if(aspectratio)$
aspectratio=$aspectratio$,
$endif$
$if(babel-lang)$
$babel-lang$,
$endif$
$endif$
$for(classoption)$
$classoption$$sep$,
20 changes: 11 additions & 9 deletions src/resources/formats/pdf/pandoc/graphics.tex
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
$if(graphics)$
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
$endif$
$endif$
38 changes: 23 additions & 15 deletions src/resources/formats/pdf/pandoc/latex.template
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@ $endif$
$if(aspectratio)$
aspectratio=$aspectratio$,
$endif$
$if(babel-lang)$
$babel-lang$,
$endif$
$endif$
$for(classoption)$
$classoption$$sep$,
@@ -57,13 +60,13 @@ $if(section-titles)$
}
\setbeamertemplate{section page}{
\centering
\begin{beamercolorbox}[sep=12pt,center]{part title}
\begin{beamercolorbox}[sep=12pt,center]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\setbeamertemplate{subsection page}{
\centering
\begin{beamercolorbox}[sep=8pt,center]{part title}
\begin{beamercolorbox}[sep=8pt,center]{subsection title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
}
@@ -299,15 +302,17 @@ $endif$
$if(graphics)$
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
$endif$
@@ -440,13 +445,15 @@ $endfor$
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
$if(selnolig-langs)$
\ifLuaTeX
\usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures
\fi
$endif$
$endif$
$for(header-includes)$
$header-includes$
$endfor$
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
$if(dir)$
\ifPDFTeX
\TeXXeTstate=1
@@ -534,7 +541,7 @@ $if(institute)$
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
$endif$
$if(titlegraphic)$
\titlegraphic{\includegraphics{$titlegraphic$}}
\titlegraphic{\includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif${$titlegraphic$}}
$endif$
$if(logo)$
\logo{\includegraphics{$logo$}}
@@ -571,7 +578,8 @@ $if(beamer)$
$if(toc-title)$
\frametitle{$toc-title$}
$endif$
\tableofcontents[hideallsubsections]
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
\end{frame}
$else$
{
10 changes: 6 additions & 4 deletions src/resources/formats/pdf/pandoc/template.tex
Original file line number Diff line number Diff line change
@@ -39,13 +39,13 @@
}
\setbeamertemplate{section page}{
\centering
\begin{beamercolorbox}[sep=12pt,center]{part title}
\begin{beamercolorbox}[sep=12pt,center]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\setbeamertemplate{subsection page}{
\centering
\begin{beamercolorbox}[sep=8pt,center]{part title}
\begin{beamercolorbox}[sep=8pt,center]{subsection title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
}
@@ -344,10 +344,12 @@
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
$endif$
$if(selnolig-langs)$
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures
\fi
$endif$
$endif$
$if(dir)$
\ifPDFTeX
\TeXXeTstate=1
3 changes: 1 addition & 2 deletions src/resources/formats/pdf/pandoc/title.tex
Original file line number Diff line number Diff line change
@@ -20,8 +20,7 @@
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
$endif$
$if(titlegraphic)$
\titlegraphic{\includegraphics{$titlegraphic$}}
$endif$
\titlegraphic{\includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif${$titlegraphic$}}$endif$
$if(logo)$
\logo{\includegraphics{$logo$}}
$endif$
3 changes: 2 additions & 1 deletion src/resources/formats/pdf/pandoc/toc.tex
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@
$if(toc-title)$
\frametitle{$toc-title$}
$endif$
\tableofcontents[hideallsubsections]
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
\end{frame}
$else$
{
2 changes: 1 addition & 1 deletion src/resources/formats/revealjs/quarto.scss
Original file line number Diff line number Diff line change
@@ -669,7 +669,7 @@ $panel-sidebar-padding: 0.5em;

// https://github.com/quarto-dev/quarto-cli/issues/3380

div.cell-output-display div.pagedtable-wrapper table.table {
div.cell-output-display div.pagedtable-wrapper table {
font-size: 0.6em;
}

3 changes: 3 additions & 0 deletions src/resources/formats/typst/pandoc/quarto/typst-show.typ
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ $if(title-font)$
title-font: ("$title-font$",),
$endif$
$endif$
$if(subtitle)$
subtitle: [$subtitle$],
$endif$
$if(by-author)$
authors: (
$for(by-author)$
18 changes: 17 additions & 1 deletion src/resources/formats/typst/pandoc/template.typst
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#let content-to-string(content) = {
if content.has("text") {
content.text
} else if content.has("children") {
content.children.map(content-to-string).join("")
} else if content.has("body") {
content-to-string(content.body)
} else if content == [ ] {
" "
}
}
#let conf(
title: none,
subtitle: none,
authors: (),
keywords: (),
date: none,
@@ -16,7 +28,7 @@
) = {
set document(
title: title,
author: authors.map(author => author.name),
author: authors.map(author => content-to-string(author.name)),
keywords: keywords,
)
set page(
@@ -34,6 +46,10 @@
if title != none {
align(center)[#block(inset: 2em)[
#text(weight: "bold", size: 1.5em)[#title]
#(if subtitle != none {
parbreak()
text(weight: "bold", size: 1.25em)[#subtitle]
})
]]
}

29 changes: 20 additions & 9 deletions src/resources/formats/typst/pandoc/typst.template
Original file line number Diff line number Diff line change
@@ -14,25 +14,40 @@ $definitions.typst()$
stroke: none
)

#show figure.where(
kind: table
): set figure.caption(position: $if(table-caption-position)$$table-caption-position$$else$top$endif$)

#show figure.where(
kind: image
): set figure.caption(position: $if(figure-caption-position)$$figure-caption-position$$else$bottom$endif$)

$if(template)$
#import "$template$": conf
$else$
$template.typst()$
$endif$

$for(header-includes)$
$header-includes$

$endfor$
#show: doc => conf(
$if(title)$
title: [$title$],
$endif$
$if(subtitle)$
subtitle: [$subtitle$],
$endif$
$if(author)$
authors: (
$for(author)$
$if(author.name)$
( name: "$author.name$",
affiliation: "$author.affiliation$",
email: "$author.email$" ),
( name: [$author.name$],
affiliation: [$author.affiliation$],
email: [$author.email$] ),
$else$
( name: "$author$",
( name: [$author$],
affiliation: "",
email: "" ),
$endif$
@@ -43,7 +58,7 @@ $if(keywords)$
keywords: ($for(keywords)$$keyword$$sep$,$endfor$),
$endif$
$if(date)$
date: "$date$",
date: [$date$],
$endif$
$if(lang)$
lang: "$lang$",
@@ -73,10 +88,6 @@ $endif$
doc,
)

$for(header-includes)$
$header-includes$

$endfor$
$for(include-before)$
$include-before$

2 changes: 1 addition & 1 deletion src/resources/lua-types/pandoc/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Generated by hand by inspecting https://github.com/jgm/pandoc/commits/main/doc/lua-filters.md

Up to date to commit https://github.com/jgm/pandoc/commit/928dde57b968066366b567201961dba6441d89e2
Up to date to commit https://github.com/jgm/pandoc/commit/790abcf4147fa2a097b1f29c845182675d90ccc3

TODO:

Loading

0 comments on commit 6b363d9

Please sign in to comment.