Skip to content

Commit 19dd852

Browse files
stmiodacap
authored andcommitted
Link to view GIFs in browser
1 parent 545eda6 commit 19dd852

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.github/workflows/md-to-pdf.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
-f markdown_github
2121
--include-in-header ./.github/workflows/pdf/header.tex
2222
--include-before-body ./.github/workflows/pdf/title.tex
23+
--lua-filter ./.github/workflows/pdf/link-gifs.lua
2324
--file-scope
2425
--table-of-contents
2526
--number-sections
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
function Image(img)
2+
if img.src:match("^.+(%..+)$") == ".gif" then
3+
local link
4+
5+
if string.find(img.src, "www") then
6+
-- Image source is already a URL
7+
link = "https:" .. img.src
8+
else
9+
-- Image source is a local file
10+
link = "https://aseprite.org/docs/" .. img.src
11+
end
12+
13+
return pandoc.Link(
14+
pandoc.Image(img.caption, img.src, img.title, img.attr),
15+
link
16+
)
17+
else
18+
return img
19+
end
20+
end

.github/workflows/pdf/title.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
\maketitle
33
\lhead{Aseprite Documentation}
44
\rhead{\today}
5+
\begin{center}
6+
This is the PDF version of the \href{https://aseprite.org/docs/}{online Aseprite documentation}.
7+
The latest version of this document can be downloaded from the \href{https://github.com/aseprite/docs/}{docs GitHub repository}.
8+
9+
Some images in this document are GIF animations, which can not be played when embedded in a PDF.
10+
GIFs are linked to their online counterpart, so you can click the image to view the animation in your browser.
11+
\end{center}

0 commit comments

Comments
 (0)