Skip to content

Commit

Permalink
Merge pull request #50 from Omikhleia/2.1a
Browse files Browse the repository at this point in the history
2.1-alpha
  • Loading branch information
Omikhleia authored Aug 17, 2023
2 parents f56ae98 + 73157ce commit 60a71d6
Show file tree
Hide file tree
Showing 50 changed files with 3,340 additions and 946 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This collection offers:
- Highly configurable table of contents, headers, footers, footnotes and sectioning environments,
- And other useful features, from cross-references to advanced captioned figure and table environments, and more…
- A great parity with Markdown, including many Pandoc-like extensions.
- A “master document” format, for easily assembling your content.
- A lightweight “résumé” class, for you to produce a colorful and yet professional-looking _curriculum vitæ_.

## Installation
Expand All @@ -24,15 +25,14 @@ These packages require SILE v0.14 or upper.

Installation relies on the **luarocks** package manager.

To install the latest development version and all its dependencies (see below),
To install the latest version and all its dependencies (see below),
you may use the provided “rockspec”:

```
luarocks --lua-version 5.4 install --server=https://luarocks.org/dev resilient.sile
luarocks install resilient.sile
```

(Adapt to your version of Lua, if need be, and refer to the SILE manual for more
detailed 3rd-party package installation information.)
(Refer to the SILE manual for more detailed 3rd-party package installation information.)

## Usage

Expand Down
48 changes: 2 additions & 46 deletions classes/resilient/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,13 @@
-- 2023, Didier Willis
-- License: MIT
--
require("silex")

local parent = require("classes.plain")
local class = pl.class(parent)
class._name = "resilient.base"
class.styles = nil

require("resilient.hacks") -- Global SILE hacks for resilient

-- BEGIN HACK FOR PARINDENT ISSUE
function class.newPar (typesetter)
local parindent = SILE.settings:get("current.parindent") or SILE.settings:get("document.parindent")
-- See https://github.com/sile-typesetter/sile/issues/1361
-- The parindent *cannot* be pushed non-absolutized, as it may be evaluated
-- outside the (possibly temporary) setting scope where it was used for line
-- breaking.
-- Early absolutization can be problematic sometimes, but here we do not
-- really have the choice.
-- As of problematic cases, consider a parindent that would be defined in a
-- frame-related unit (%lw, %fw, etc.). If a frame break occurs and the next
-- frame has a different width, the parindent won't be re-evaluated in that
-- new frame context. However, defining a parindent in such a unit is quite
-- unlikely. And anyway pushback() has plenty of other issues.
typesetter:pushGlue(parindent:absolute()) -- HACK
SILE.settings:set("current.parindent", nil)
local hangIndent = SILE.settings:get("current.hangIndent")
if hangIndent then
SILE.settings:set("linebreak.hangIndent", hangIndent)
end
local hangAfter = SILE.settings:get("current.hangAfter")
if hangAfter then
SILE.settings:set("linebreak.hangAfter", hangAfter)
end
end
-- END HACK FOR PARINDENT ISSUE

function class:_init (options)
parent._init(self, options)

Expand All @@ -56,22 +29,6 @@ end
-- For overriding in subclass
function class.registerStyles (_) end

-- BEGIN HACKS FOR MULTIPLE INSTANTION SIDE EFFECTS
function class:loadPackage (packname, options)
local pack = require(("packages.%s"):format(packname))
if type(pack) == "table" and pack.type == "package" then -- new package
-- I beg to disagree with SILE here
if self.packages[pack._name] then
return SU.debug("resiient", "Already load into class (hack) "..pack._name)
end
self.packages[pack._name] = pack(options)
else -- legacy package
SU.warn("CLASS: legacy package "..pack._name)
self:initPackage(pack, options)
end
end
-- END HACKS FOR MULTIPLE INSTANTION SIDE EFFECTS

function class:declareOptions ()
parent.declareOptions(self)

Expand All @@ -88,7 +45,6 @@ function class:registerRawHandlers ()

end


function class:registerCommands ()
parent.registerCommands(self)

Expand Down
Loading

0 comments on commit 60a71d6

Please sign in to comment.