feat(code): Add docx landscape shortcodes
This commit is contained in:
parent
092b8d29c8
commit
b0f7f49ebc
2 changed files with 26 additions and 0 deletions
6
_extensions/docx-landscape/_extension.yml
Normal file
6
_extensions/docx-landscape/_extension.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
title: docx-landscape
|
||||||
|
author: Marty Oehme
|
||||||
|
version: 0.1.0
|
||||||
|
contributes:
|
||||||
|
shortcodes:
|
||||||
|
- landscape.lua
|
20
_extensions/docx-landscape/landscape.lua
Normal file
20
_extensions/docx-landscape/landscape.lua
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
return {
|
||||||
|
["landscape"] = function(args, kwargs, meta)
|
||||||
|
if quarto.doc.isFormat("docx") then
|
||||||
|
return pandoc.RawBlock(
|
||||||
|
"openxml",
|
||||||
|
'<w:p><w:pPr><w:sectPr> <w:pgSz w:w="16848" w:h="11905" w:orient="landscape" /> <w:pgMar w:top="720" w:right="720" w:bottom="720" w:left="720" w:header="720" w:footer="851" w:gutter="0"/></w:sectPr></w:pPr></w:p>'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
return pandoc.Para({ pandoc.Str("\f") })
|
||||||
|
end,
|
||||||
|
["portrait"] = function(args, kwargs, meta)
|
||||||
|
if quarto.doc.isFormat("docx") then
|
||||||
|
return pandoc.RawBlock(
|
||||||
|
"openxml",
|
||||||
|
'<w:p><w:pPr><w:sectPr> <w:pgSz w:w="11905" w:h="16848" w:orient="portrait" /> </w:sectPr></w:pPr></w:p>'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
return pandoc.Para({ pandoc.Str("\f") })
|
||||||
|
end,
|
||||||
|
}
|
Loading…
Reference in a new issue