-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from USFWS/emma-dev
Emma dev
- Loading branch information
Showing
25 changed files
with
17,237 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
title: embedpdf | ||
author: Jeffrey Girard | ||
version: 0.4.1 | ||
quarto-required: ">=1.3.0" | ||
contributes: | ||
shortcodes: | ||
- embedpdf.lua | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
function pdf(args, kwargs) | ||
local data = pandoc.utils.stringify(args[1]) or pandoc.utils.stringify(kwargs['file']) | ||
local width = pandoc.utils.stringify(kwargs['width']) | ||
local height = pandoc.utils.stringify(kwargs['height']) | ||
local border = pandoc.utils.stringify(kwargs['border']) | ||
local class = pandoc.utils.stringify(kwargs['class']) | ||
local image = pandoc.utils.stringify(kwargs['image']) | ||
local image_force = pandoc.utils.stringify(kwargs['image_force']) | ||
local image_width = pandoc.utils.stringify(kwargs['image_width']) | ||
local image_height = pandoc.utils.stringify(kwargs['image_height']) | ||
local image_border = pandoc.utils.stringify(kwargs['image_border']) | ||
local image_class = pandoc.utils.stringify(kwargs['image_class']) | ||
|
||
if width ~= '' then | ||
width = 'width="' .. width .. '" ' | ||
end | ||
|
||
if height ~= '' then | ||
height = 'height="' .. height .. '" ' | ||
end | ||
|
||
if border ~= '' then | ||
border = 'border="' .. border .. '" ' | ||
end | ||
|
||
if class ~= '' then | ||
class = 'class="' .. class .. '" ' | ||
end | ||
|
||
if image_width ~= '' then | ||
image_width = 'width="' .. image_width .. '" ' | ||
end | ||
|
||
if image_height ~= '' then | ||
image_height = 'height="' .. image_height .. '" ' | ||
end | ||
|
||
if image_border ~= '' then | ||
image_border = 'border="' .. image_border .. '" ' | ||
end | ||
|
||
if image_class ~= '' then | ||
image_class = 'class="' .. image_class .. '" ' | ||
end | ||
|
||
-- detect html | ||
if quarto.doc.isFormat("html:js") then | ||
if image_force == 'TRUE' then | ||
return pandoc.RawInline('html', '<a href="' .. data .. '" download><img src="' .. image .. '" ' .. image_width .. image_height .. image_class .. image_border .. ' /></a>') | ||
end | ||
if image ~= '' then | ||
return pandoc.RawInline('html', '<object data="' .. data .. '" type="application/pdf"' .. width .. height .. class .. border .. '><a href="' .. data .. '" download><img src="' .. image .. '" ' .. image_width .. image_height .. image_class .. image_border .. ' /></a></object>') | ||
else | ||
return pandoc.RawInline('html', '<object data="' .. data .. '" type="application/pdf"' .. width .. height .. class .. border .. '><a href="' .. data .. '" download>Download PDF file.</a></object>') | ||
end | ||
else | ||
return pandoc.Null() | ||
end | ||
|
||
end | ||
|
||
-- Add alias shortcode | ||
function embedpdf(...) | ||
return pdf(...) | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function highlight(line_number) | ||
local highlighter = { | ||
CodeBlock = function(block) | ||
if block.classes:includes('highlight') then | ||
block.classes:insert('has-line-highlights') | ||
block.attributes["code-line-numbers"] = line_number | ||
return block | ||
end | ||
end | ||
} | ||
return highlighter | ||
end | ||
|
||
|
||
function Div(el) | ||
if FORMAT == 'revealjs' then | ||
if el.classes:includes('cell') then | ||
line_number = tostring(el.attributes["output-line-numbers"]) | ||
return el:walk(highlight(line_number)) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters