summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.scm12
-rw-r--r--filters/toc.lua9
2 files changed, 13 insertions, 8 deletions
diff --git a/Makefile.scm b/Makefile.scm
index 5975a17..7c0efea 100644
--- a/Makefile.scm
+++ b/Makefile.scm
@@ -74,12 +74,14 @@ exec chibi-scheme -A utils/ $0 $@
"--to=html"
"-o" (make-path outpath "web-simple.html")
"--standalone"
- "--self-contained"
+ "--embed-resources"
+ ;"--self-contained" ; Old way to do --embed-resources
"--mathml"
"--no-highlight"
"--data-dir=."
(string-append "--resource-path=" input)
- "--base-header-level=2" ;"--shift-heading-level-by=-1" is the new way
+ ; "--base-header-level=2" This is the old way
+ "--shift-heading-level-by=-1" ;is the new way
"--template=web-simple.html"
"--lua-filter=toc.lua"
"--lua-filter=anchored-h.lua"
@@ -102,8 +104,10 @@ exec chibi-scheme -A utils/ $0 $@
"-o" (make-path outpath "web.html")
"--standalone"
"--mathml"
- "--self-contained"
- "--base-header-level=2" ;"--shift-heading-level-by=-1" is the new way
+ "--embed-resources"
+ ;"--self-contained" ; Old way to do --embed-resources
+ ; "--base-header-level=2" This is the old way
+ "--shift-heading-level-by=-1" ;is the new way
"--data-dir=."
(string-append "--resource-path=./templates/web/:"
"./templates:"
diff --git a/filters/toc.lua b/filters/toc.lua
index 102ac83..a1bc33e 100644
--- a/filters/toc.lua
+++ b/filters/toc.lua
@@ -48,7 +48,7 @@ if FORMAT:match 'html' then
end
i = i + 1
end
- else
+ else
-- toc_depth not set so get the max_level from the contents
for i, v in ipairs(links) do
if v[1] > max_level then max_level = v[1] end
@@ -60,7 +60,7 @@ if FORMAT:match 'html' then
local i = 1
local tmp = {}
while i <= #links do
- local level = links[i][1] -- Element's level
+ local level = links[i][1] -- Element's level
if level == max_level then -- Found group
-- If group is found, it usually has a parent
local parent = links[i-1]
@@ -110,9 +110,10 @@ if FORMAT:match 'html' then
end
function Meta(m)
- local toc_depth
+ local toc_depth = -1
+
if m["toc-depth"] ~= nil then
- toc_depth = tonumber(m["toc-depth"][1]["c"])
+ toc_depth = tonumber(m["toc-depth"][1].text)
else
toc_depth = -1
end