Module resilient.adapters.frameset

Lightweight frameset parser/solver.

Aimed at resolving a master frameset so as to render it graphically, etc.

The logic is mostly taken from SILE's core frame.

MIT licensed (c) Simon Cozens / The SILE Organization.

But the frames and frameParser in that implementation rely on several side effects and global variables. I extracted and refactored the minimal code for solving frame specifications independently, so as to be able to resolve a full master layout and draw it.

Info:

  • Copyright: (c) 2023-2025 Omikhkeia / Didier Willis
  • License: MIT

Class frameAdapter

frameAdapter:_init (spec, frameParser) (Constructor) Create a new frameAdapter instance.
frameAdapter:constrain (method, dimension) Constrain a dimension of the frame.
frameAdapter:reifyConstraint (solver, method, stay) Reify a constraint into the solver.
frameAdapter:addWidthHeightDefinitions (solver) Add width and height definitions to the solver.

Class framesetAdapter

framesetAdapter:_init (frames) (Constructor) Create a new framesetAdapter instance.
framesetAdapter:initFrameParser () Initialize the frame parser.
framesetAdapter:solve () Solve the frameset.


Class frameAdapter

Lightweight frame class.

Adapted from SILE core.frame.

Lightweight re-implementation of a frame.

frameAdapter:_init (spec, frameParser)
(Constructor) Create a new frameAdapter instance.

Parameters:

  • spec table Frame specification
  • frameParser Frame parser instance
frameAdapter:constrain (method, dimension)
Constrain a dimension of the frame.

Parameters:

  • method string The dimension to constrain
  • dimension string, number or SILE.measurement The dimension specification
frameAdapter:reifyConstraint (solver, method, stay)
Reify a constraint into the solver.

Parameters:

  • solver cassowary.SimplexSolver Cassowary solver instance
  • method string The dimension to reify
  • stay boolean Whether to add a "stay" constraint
frameAdapter:addWidthHeightDefinitions (solver)
Add width and height definitions to the solver.

Parameters:

  • solver cassowary.SimplexSolver Cassowary solver instance

Class framesetAdapter

Lightweight frameset class.

It provides methodes for parsing and solving a frameset specification.

Adapted from SILE core.frameparser.

Lightweight re-implementation of a "master" frameset.

framesetAdapter:_init (frames)
(Constructor) Create a new framesetAdapter instance.

Parameters:

  • frames table Frameset specification
framesetAdapter:initFrameParser ()
Initialize the frame parser.
framesetAdapter:solve ()
Solve the frameset.

Adapted from the constrain solver in SILE core.frame.

Returns:

    table Table of resolved frames
generated by LDoc 1.5.0 Last updated 2025-09-14 22:28:52