mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-07 10:08:50 -05:00
[GH-ISSUE #899] Fixing inject_crossrefs.lua #4239
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @profvjreddi on GitHub (Jul 22, 2025).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/899
Originally assigned to: @hzeljko on GitHub.
I have been working on using the
margin-connectioncallout, which works great based on what you did — where we manually insert the callout.However, I wanted to automatically generate them from a JSON file, like we did for quizzes. So, I wrote an
inject_crossrefs.luascript to accomplish this. It reads data from the data/ directory and then attempts to inject the references. Don't worry about how I generate them, there is a file inscripts/cross_refs.py.One issue is that the first callout shows up red for some reason.
From the second callout onward, it works perfectly (ignore the ??? missing — it uses \ref{...} and does build correctly. It’s not building because I disabled and commented out the other files).
The issue seems to be related to how much information I’m including in the
\marginparyou defined inmargin-connection.Second issue is when I use
data/cross_refs.json, it fails. But when I use the same file without the explanation JSON field, it works fine. There are two files in data/ that you can take a look at.Can you please debug this issue? Maybe we can't put explanations :(