Skip to content

Commit

Permalink
Merge pull request #2158 from alerque/add-names-to-loaded-chunks
Browse files Browse the repository at this point in the history
Add chunk names to load code sideloading
  • Loading branch information
alerque authored Nov 4, 2024
2 parents 84f0d78 + f69fb61 commit 77f08d0
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, "r")()
SILE.scratch._tableofcontents = toc
return SILE.scratch._tableofcontents
end
Expand Down

0 comments on commit 77f08d0

Please sign in to comment.