Per this comment and following, the relationship between settings and typesetters is a bit conflated. I think we should refactor it entirely. This issue is just a placeholder, but we have a jumble of:
SILE.documentState, very assorted
SILE.typesetter.state (has stack)
frame.state (includes direction)
SILE.settings (has stack)
assorted completely independent state vars
For starters, I don't think we should have a single global SILE.typesetter, we should be able to have several instances of this easily without using a function shuffle dance every time.
Next I think the things in settings need to be scoped somehow such that the stack could be managed by scope (document.* should be scoped to documentState, most of the settings defined in typesetter.lua should be scoped to the typesetter instance state, etc.
Per this comment and following, the relationship between settings and typesetters is a bit conflated. I think we should refactor it entirely. This issue is just a placeholder, but we have a jumble of:
SILE.documentState
, very assortedSILE.typesetter.state
(has stack)frame.state
(includes direction)SILE.settings
(has stack)For starters, I don't think we should have a single global
SILE.typesetter
, we should be able to have several instances of this easily without using a function shuffle dance every time.Next I think the things in settings need to be scoped somehow such that the stack could be managed by scope (
document.*
should be scoped to documentState, most of the settings defined intypesetter.lua
should be scoped to the typesetter instance state, etc.