Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chunk names to load code sideloading #2158

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading