diff --git a/packages/fancytoc/init.lua b/packages/fancytoc/init.lua index fd79f3b..e10bd86 100644 --- a/packages/fancytoc/init.lua +++ b/packages/fancytoc/init.lua @@ -5,6 +5,8 @@ -- Only processes 2 levels, e.g. parts (level 0) and chapters (level 1) -- and display them as some braced content. -- +require("silex.types") -- Compatibility shims + local base = require("packages.base") local package = pl.class(base) @@ -91,8 +93,8 @@ function package:registerCommands () end SILE.settings:temporarily(function() - SILE.settings:set("current.parindent", SILE.nodefactory.glue()) - SILE.settings:set("document.parindent", SILE.nodefactory.glue()) + SILE.settings:set("current.parindent", SILE.types.node.glue()) + SILE.settings:set("document.parindent", SILE.types.node.glue()) cancelFragile(function () -- Quick and dirty for now... @@ -102,7 +104,7 @@ function package:registerCommands () SILE.call("medskip") if #v.children > 0 then SILE.call("parbox", { valign = "middle", width = "20%lw" }, function () - SILE.settings:set("document.parindent", SILE.nodefactory.glue()) + SILE.settings:set("document.parindent", SILE.types.node.glue()) SILE.call("raggedright", {}, function () SILE.call("fancytoc:level1", { style = "fancytoc-level1" }, v.item.label) end) @@ -110,12 +112,12 @@ function package:registerCommands () SILE.call("hfill") SILE.call("bracebox", { bracewidth = "0.8em"}, function() SILE.call("parbox", { valign = "middle", width = "75%lw" }, function () - SILE.settings:set("document.parindent", SILE.nodefactory.glue()) + SILE.settings:set("document.parindent", SILE.types.node.glue()) for _, c in ipairs(v.children) do SILE.call("parbox", { valign = "top", strut = "rule", minimize = true, width = "80%lw" }, function () - SILE.settings:set("document.lskip", SILE.length("1em")) - SILE.settings:set("document.rskip", SILE.nodefactory.hfillglue()) - SILE.settings:set("document.parindent", SILE.length("-0.5em")) + SILE.settings:set("document.lskip", SILE.types.length("1em")) + SILE.settings:set("document.rskip", SILE.types.node.hfillglue()) + SILE.settings:set("document.parindent", SILE.types.length("-0.5em")) SILE.call("fancytoc:level2", { style = "fancytoc-level2" }, c.label) end) SILE.call("dotfill") @@ -128,7 +130,7 @@ function package:registerCommands () end) else SILE.call("parbox", { valign = "top", width = "20%lw" }, function () - SILE.settings:set("document.parindent", SILE.nodefactory.glue()) + SILE.settings:set("document.parindent", SILE.types.node.glue()) SILE.call("raggedright", {}, function () SILE.call("fancytoc:level1", { style = "fancytoc-level1" }, v.item.label) end) diff --git a/fancytoc.sile-1.0.0-1.rockspec b/rockspecs/fancytoc.sile-1.0.0-1.rockspec similarity index 100% rename from fancytoc.sile-1.0.0-1.rockspec rename to rockspecs/fancytoc.sile-1.0.0-1.rockspec diff --git a/fancytoc.sile-1.0.1-1.rockspec b/rockspecs/fancytoc.sile-1.0.1-1.rockspec similarity index 100% rename from fancytoc.sile-1.0.1-1.rockspec rename to rockspecs/fancytoc.sile-1.0.1-1.rockspec diff --git a/rockspecs/fancytoc.sile-1.1.0-1.rockspec b/rockspecs/fancytoc.sile-1.1.0-1.rockspec new file mode 100644 index 0000000..06dcba1 --- /dev/null +++ b/rockspecs/fancytoc.sile-1.1.0-1.rockspec @@ -0,0 +1,26 @@ +rockspec_format = "3.0" +package = "fancytoc.sile" +version = "1.1.0-1" +source = { + url = "git+https://github.com/Omikhleia/fancytoc.sile.git", + tag = "v1.1.0", +} +description = { + summary = "Some fancy table of contents for the SILE typesetting system.", + detailed = [[ + This package for the SILE typesetter provides an altenative and fancy two-level presentation + with curly braces for a table of contents. + ]], + homepage = "https://github.com/Omikhleia/fancytoc.sile", + license = "MIT", +} +dependencies = { + "lua >= 5.1", + "ptable.sile >= 3.1.0", +} +build = { + type = "builtin", + modules = { + ["sile.packages.fancytoc"] = "packages/fancytoc/init.lua", + } +} diff --git a/fancytoc.sile-dev-1.rockspec b/rockspecs/fancytoc.sile-dev-1.rockspec similarity index 100% rename from fancytoc.sile-dev-1.rockspec rename to rockspecs/fancytoc.sile-dev-1.rockspec