Skip to content

Commit

Permalink
docs(manual): Restyle code blocks with extra margins
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Nov 26, 2024
1 parent 938f5a9 commit 162f710
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/autodoc/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@ function package:registerCommands ()
-- we trim it off here.
content = SU.ast.trimSubContent(content)
SILE.typesetter:leaveHmode()
local lskip = SILE.settings:get("document.lskip") or SILE.types.node.glue()
local rskip = SILE.settings:get("document.rskip") or SILE.types.node.glue()
local parindent = SILE.settings:get("document.parindent"):absolute()
local lskip = (SILE.settings:get("document.lskip") or SILE.types.node.glue()).width:absolute() + parindent
local rskip = (SILE.settings:get("document.rskip") or SILE.types.node.glue()).width:absolute() + parindent
SILE.settings:temporarily(function ()
-- Note: We avoid using the verbatim environment and simplify things a bit
-- (and try to better enforce novbreak points of insertion)
Expand All @@ -394,8 +395,8 @@ function package:registerCommands ()
end
SILE.settings:set("typesetter.parseppattern", "\n")
SILE.settings:set("typesetter.obeyspaces", true)
SILE.settings:set("document.lskip", SILE.types.node.glue(lskip.width.length))
SILE.settings:set("document.rskip", SILE.types.node.glue(rskip.width.length))
SILE.settings:set("document.lskip", SILE.types.node.glue(lskip))
SILE.settings:set("document.rskip", SILE.types.node.glue(rskip))
SILE.settings:set("document.parindent", SILE.types.node.glue())
SILE.settings:set("document.parskip", SILE.types.node.vglue())
SILE.settings:set("document.spaceskip", SILE.types.length("1spc"))
Expand All @@ -407,8 +408,8 @@ function package:registerCommands ()
SILE.call("novbreak")
pushline("1ex")
end)
SILE.typesetter:leaveHmode()
end)
SILE.typesetter:leaveHmode()
end, "Outputs its content as a standardized block of code")

self:registerCommand("autodoc:example", function (_, content)
Expand Down

0 comments on commit 162f710

Please sign in to comment.