Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ All changes included in 1.9:

- ([#13414](https://github.com/quarto-dev/quarto-cli/issues/13414)): Be more forgiving when Confluence server returns malformed JSON response. (author: @m1no)

## Lua API

- ([#13763](https://github.com/quarto-dev/quarto-cli/issues/13763)): Add `quarto.paths.pandoc()` to expose the path to the Pandoc binary. (author: @mcanouil)

## Other fixes and improvements

- ([#13402](https://github.com/quarto-dev/quarto-cli/issues/13402)): `nfpm` (<https://nfpm.goreleaser.com/>) is now used to create the `.deb` package, and new `.rpm` package. Both Linux packages are also now built for `x86_64` (`amd64`) and `aarch64` (`arm64`) architectures.
Expand Down
3 changes: 2 additions & 1 deletion src/command/render/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import { QuartoFilterSpec } from "./types.ts";
import { Metadata } from "../../config/types.ts";
import { kProjectType } from "../../project/types.ts";
import { bibEngine } from "../../config/pdf.ts";
import { rBinaryPath, resourcePath } from "../../core/resources.ts";
import { rBinaryPath, resourcePath, pandocBinaryPath } from "../../core/resources.ts";
import { crossrefFilterActive, crossrefFilterParams } from "./crossref.ts";
import { layoutFilterParams } from "./layout.ts";
import { pandocMetadataPath } from "./render-paths.ts";
Expand Down Expand Up @@ -204,6 +204,7 @@ async function quartoEnvironmentParams(_options: PandocOptions) {
"paths": {
"Rscript": await rBinaryPath("Rscript"),
"TinyTexBinDir": tinyTexBinDir(), // will be undefined if no tinytex found and quarto will look in PATH
"Pandoc": pandocBinaryPath(),
},
};
}
Expand Down
8 changes: 8 additions & 0 deletions src/resources/lua-types/quarto/paths.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ Returns the path to the `TinyTeX` bin directory that `quarto install tinytex` in
]]
---@return string|nil # Path to `TinyTeX` bin directory
function quarto.paths.tinytex_bin_dir() end

--[[
Returns the path to the Pandoc binary that Quarto itself would use for rendering documents.
This will be the value of the QUARTO_PANDOC environment variable if set, or the path to the
Pandoc binary bundled with Quarto.
]]
---@return string # Path to Pandoc binary
function quarto.paths.pandoc() end
3 changes: 3 additions & 0 deletions src/resources/pandoc/datadir/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@ quarto = {
tinytex_bin_dir = function()
return param('quarto-environment', nil).paths.TinyTexBinDir
end,
pandoc = function()
return param('quarto-environment', nil).paths.Pandoc
end,
},
json = json,
base64 = base64,
Expand Down
7 changes: 7 additions & 0 deletions tests/docs/smoke-all/2025/12/06/pandoc-path-api.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function pandoc_path()
return quarto.paths.pandoc()
end

return {
["pandoc"] = pandoc_path
}
12 changes: 12 additions & 0 deletions tests/docs/smoke-all/2025/12/06/pandoc-path-api.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
format: html
shortcodes:
- pandoc-path-api.lua
_quarto:
tests:
html:
ensureFileRegexMatches:
- ["<p>The Pandoc path is <code>.+pandoc</code>.</p>"]
---

The Pandoc path is `{{< pandoc >}}`.
Loading