mirror of
https://github.com/benjaminion/upgrading-ethereum-book.git
synced 2026-01-09 22:47:55 -05:00
Updates for pandoc 3.1.13
This commit is contained in:
@@ -11,7 +11,7 @@ local logging = require 'logging'
|
|||||||
local website = 'https://eth2book.info'
|
local website = 'https://eth2book.info'
|
||||||
|
|
||||||
local links, targets = {}, {}
|
local links, targets = {}, {}
|
||||||
local skip = { ["contents"] = true, ["annotated-spec"] = true }
|
local skip = { ["/contents/"] = true, ["/annotated-spec/"] = true }
|
||||||
|
|
||||||
-- Check that there are no duplicate targets
|
-- Check that there are no duplicate targets
|
||||||
local function check_target(id)
|
local function check_target(id)
|
||||||
@@ -24,7 +24,7 @@ end
|
|||||||
-- Check that every link has a target
|
-- Check that every link has a target
|
||||||
local function check_links()
|
local function check_links()
|
||||||
for link, v in pairs(links) do
|
for link, v in pairs(links) do
|
||||||
if not skip[link] and not targets[link] then
|
if not skip['/' .. link .. '/'] and not targets[link] then
|
||||||
print('Links filter: link "' .. link .. '" points to nothing')
|
print('Links filter: link "' .. link .. '" points to nothing')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -86,7 +86,9 @@ local function update_links(block, page)
|
|||||||
-- External link
|
-- External link
|
||||||
t = s
|
t = s
|
||||||
end
|
end
|
||||||
return pandoc.Link(link.content, t, link.title, link.attr)
|
if not skip[s] then
|
||||||
|
return pandoc.Link(link.content, t, link.title, link.attr)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -139,13 +139,37 @@ $endif$
|
|||||||
\ifPDFTeX\else
|
\ifPDFTeX\else
|
||||||
% xetex/luatex font selection
|
% xetex/luatex font selection
|
||||||
$if(mainfont)$
|
$if(mainfont)$
|
||||||
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
|
$if(mainfontfallback)$
|
||||||
|
\ifLuaTeX
|
||||||
|
\usepackage{luaotfload}
|
||||||
|
\directlua{luaotfload.add_fallback("mainfontfallback",{
|
||||||
|
$for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$
|
||||||
|
})}
|
||||||
|
\fi
|
||||||
|
$endif$
|
||||||
|
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}
|
||||||
$endif$
|
$endif$
|
||||||
$if(sansfont)$
|
$if(sansfont)$
|
||||||
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
|
$if(sansfontfallback)$
|
||||||
|
\ifLuaTeX
|
||||||
|
\usepackage{luaotfload}
|
||||||
|
\directlua{luaotfload.add_fallback("sansfontfallback",{
|
||||||
|
$for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$
|
||||||
|
})}
|
||||||
|
\fi
|
||||||
|
$endif$
|
||||||
|
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$}
|
||||||
$endif$
|
$endif$
|
||||||
$if(monofont)$
|
$if(monofont)$
|
||||||
\setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
|
$if(monofontfallback)$
|
||||||
|
\ifLuaTeX
|
||||||
|
\usepackage{luaotfload}
|
||||||
|
\directlua{luaotfload.add_fallback("monofontfallback",{
|
||||||
|
$for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$
|
||||||
|
})}
|
||||||
|
\fi
|
||||||
|
$endif$
|
||||||
|
\setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$}
|
||||||
$endif$
|
$endif$
|
||||||
$for(fontfamilies)$
|
$for(fontfamilies)$
|
||||||
\newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
|
\newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
|
||||||
@@ -297,6 +321,15 @@ $-- also used for underline
|
|||||||
\usepackage[soul]{lua-ul}
|
\usepackage[soul]{lua-ul}
|
||||||
\else
|
\else
|
||||||
\usepackage{soul}
|
\usepackage{soul}
|
||||||
|
$if(beamer)$
|
||||||
|
\makeatletter
|
||||||
|
\let\HL\hl
|
||||||
|
\renewcommand\hl{% fix for beamer highlighting
|
||||||
|
\let\set@color\beamerorig@set@color
|
||||||
|
\let\reset@color\beamerorig@reset@color
|
||||||
|
\HL}
|
||||||
|
\makeatother
|
||||||
|
$endif$
|
||||||
$if(CJKmainfont)$
|
$if(CJKmainfont)$
|
||||||
\ifXeTeX
|
\ifXeTeX
|
||||||
% soul's \st doesn't work for CJK:
|
% soul's \st doesn't work for CJK:
|
||||||
@@ -380,7 +413,7 @@ $if(babel-lang)$
|
|||||||
$if(mainfont)$
|
$if(mainfont)$
|
||||||
\ifPDFTeX
|
\ifPDFTeX
|
||||||
\else
|
\else
|
||||||
\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
|
\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}
|
||||||
\fi
|
\fi
|
||||||
$endif$
|
$endif$
|
||||||
$endif$
|
$endif$
|
||||||
@@ -425,7 +458,7 @@ $endif$
|
|||||||
$if(csquotes)$
|
$if(csquotes)$
|
||||||
\usepackage{csquotes}
|
\usepackage{csquotes}
|
||||||
$endif$
|
$endif$
|
||||||
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
|
\usepackage{bookmark}
|
||||||
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
|
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
|
||||||
\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}
|
\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}
|
||||||
$if(links-as-notes)$
|
$if(links-as-notes)$
|
||||||
|
|||||||
Reference in New Issue
Block a user