From 1886475fbd507a04bc539416493085211e97ab7b Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 3 Nov 2023 16:57:44 +0300 Subject: [PATCH] feat(packages): Adjust \book:numbering override to handle Fluent messages like SILE --- packages/cabook-commands.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/cabook-commands.lua b/packages/cabook-commands.lua index f01bef6a..e816eb32 100644 --- a/packages/cabook-commands.lua +++ b/packages/cabook-commands.lua @@ -166,12 +166,17 @@ function package:registerCommands () if SILE.Commands["book:chapter:precounter"] then SILE.call("book:chapter:precounter") end SILE.call(options.prenumber) end - SILE.call("show-multilevel-counter", { - id = "sectioning", - display = options.display, - minlevel = level, - level = level - }) + if options.msg then + local number = SU.formatNumber(counters.value[level], options.display) + SILE.call("fluent", { number = number }, { options.msg }) + else + SILE.call("show-multilevel-counter", { + id = "sectioning", + display = options.display, + minlevel = level, + level = level + }) + end if options.postnumber and SILE.Commands[options.postnumber] then SILE.call(options.postnumber) end