Skip to content

Commit

Permalink
chore(core): Add chunk names to side-loaded code
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Oct 23, 2024
1 parent 3b62dab commit 4bd9571
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inputters/lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function inputter.appropriate (round, filename, doc)
end

function inputter.parse (_, doc)
local result, err = load(doc)
local result, err = load(doc, SILE.currentlyProcessingFile)
if not result then
SU.error(err)
end
Expand Down
5 changes: 3 additions & 2 deletions packages/tableofcontents/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ function package.readToc (_)
-- already loaded
return SILE.scratch._tableofcontents
end
local tocfile, _ = io.open(pl.path.splitext(SILE.input.filenames[1]) .. ".toc")
local tocfile_name(pl.path.splitext(SILE.input.filenames[1]) .. ".toc")
local tocfile, _ = io.open(tocfile_name)
if not tocfile then
return false -- No TOC yet
end
local doc = tocfile:read("*all")
local toc = assert(load(doc))()
local toc = assert(load(doc), tocfile_name)()
SILE.scratch._tableofcontents = toc
return SILE.scratch._tableofcontents
end
Expand Down

0 comments on commit 4bd9571

Please sign in to comment.