Skip to content

Commit

Permalink
docs: remove deprecated use of SILE.registerCommand() in documentatio…
Browse files Browse the repository at this point in the history
…n and examples
  • Loading branch information
Omikhleia authored and Didier Willis committed Jul 11, 2023
1 parent e318136 commit a9c8c75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/lefevre-tuor-idril.sil
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
% as it has a fixed height not taking into account the effect of that stretchability.
% We therefore wrap the concerned paragraph in a temporary environment where the
% stretchability is canceled...
\script{
\lua{
local class = SILE.documentState.documentClass
class:registerCommand("initial", function (options, content)
SILE.settings:temporarily(function()
Expand Down
11 changes: 6 additions & 5 deletions packages/resilient/poetry/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,21 @@ As can be seen, verses are automatically numbered, by default. This feature can
with the \autodoc:parameter{numbering} option set to false. The \autodoc:parameter{start} option
may also be provided, to define the number of the initial verse, would it be
different from one. Quoting \em{Beowulf}, chapter XI, starting at verse 710:
\script{
\lua{
-- Conditional in this documentation
local class = SILE.documentState.documentClass
if SILE.Commands["label"] and SILE.Commands["ref"] then
SILE.registerCommand("conditional:label", function(options, content)
class:registerCommand("conditional:label", function(options, content)
SILE.call("label", options, content)
end)
SILE.registerCommand("conditional:ref", function(options, content)
class:registerCommand("conditional:ref", function(options, content)
SILE.call("ref", options, content)
end)
else
SILE.registerCommand("conditional:label", function(options, content)
class:registerCommand("conditional:label", function(options, content)
-- ignore
end)
SILE.registerCommand("conditional:ref", function(options, content)
class:registerCommand("conditional:ref", function(options, content)
SILE.typesetter:typeset("[reference not available]")
end)
end
Expand Down

0 comments on commit a9c8c75

Please sign in to comment.