Omikhleia / silex.sile

Extension layer for SILE and resilient
MIT License
6 stars 1 forks source link

silex.sile

license Luacheck Luarocks

A silex is a kind of hard stone.

This is sile·x, a common layer for re·sil·ient and other modules: Some common bricks and blocks, compatility features, opinionated hacks, and eXperimental eXpansions, hence the name.

:warning: sile·x overrides several SILE internals when fully enabled, and may therefore break some of your packages and classes.

Installation and removal

Install with Luarocks:

luarocks install silex.sile

Uninstall:

luarocks remove silex.sile

Obviously, modules needing it (and therefore also intalling it as a dependency), such as markdown.sile and resilient.sile (amongst others) will not work without it.

Features

classes and typesetters :warning: Opinionated departure from SILE 0.14.

Modified implementation of the base typesetter and class.

outputters and packages :warning: In-advance adoption of features.

Modified implementation of the PDF outputter and of several packages depending on it.

Rationale: Early adoption of SILE PR 1853

The corresponding changes are planned to be available in SILE 0.15 (in development).

silex.lang

This module overrides the language support in SILE to accept and resolve BCP47 language tags, such as en-GB, es-MX, fr-CH, etc. In other layman's terms, it changes the behavior of SILE's \language command. This implementation does not change how SILE's \font[language=...] command works.

Rationale: See SILE PR 1641 for details and more complete proposal. We cannot wait forever for SILE to implement this: Markdown and Djot need to be able to support qualified language names, notably for smart quotes to work adequately.

silex.fixes :warning: Opinionated departure from SILE 0.14.

This modules implements some additions and changes which should be provided by SILE in my humble opinion...

silex.fork :warning: Opinionated departure from SILE 0.14.

The module cancels the multiple package instantiation model introduced in SILE 0.13-0.14. Packages are no longer re-instantiated when loaded multiple times.

Rationale: I struggled too many times with this issue in August 2021 (initial effort porting my 0.12.5 packages to 0.14.x) and afterwards. See SILE issue 1531 for some details. I can't make any sense of this half-baked "feature", which introduces unintended side-effects and problems impossible to decently address, making the life of package and class developers real harder. So I'm moving on and cancelling it. The very few cases where this could have been interesting can be addressed in other ways...

Some of the issues are supposed to be fixed in SILE 0.15 (in development).

silex.ast

A library of common SILE AST utilities.

Rationale: The need for such functions kept popping up in my packages and inputters, so I decided to factor them out, to ease maintenance and avoid code duplication. In my humble opinion, SILE should eventually provide these functions in the core distribution (and clean up or refactor some of its existing methods on that occasion)...

These utilities are planned to be available in SILE 0.15 (in development).

silex.compat

Compatibility layer providing some fixes also proposed to SILE and possibly integrated in a release. This is obviously not exhaustive, and it only covers issues I backported for my own packages to work with the then-current SILE releases.

Rationale: Official release dates are not predictable, and may moreover take some time to reach the users, but normally you do not need to use this module if you are using the latest SILE release.

silex.override

When loaded, this layer enforces using silex-modified versions of some packages and components, overriding the original ones.

Affected modules

If you use packages or classes from the following modules, some features of silex will be loaded globally. Your documents using them may therefore be impacted from that point.

As noted, some global changes are also introduced in the typesetter and base document class. Side-effects are therefore possible on some workflows.

Future directions

The plan: SILE + sile·x + re·sil·ient = SILE as it should be.

Did I say this was opinionated? Whatever you may think, expect some more breaking changes and furious experiments in the future...

License

All code is under the MIT License.