diff --git a/documentation/c10-classdesign.sil b/documentation/c10-classdesign.sil index 6038fdf11..eb99e2930 100644 --- a/documentation/c10-classdesign.sil +++ b/documentation/c10-classdesign.sil @@ -468,7 +468,7 @@ Infonodes work on a per-page basis, so if we want to save them throughout the wh table. In order to be useful, we also need to make sure we store their page numbers. -\note{SILE provides the \code{SILE.scratch} variable for you to store global information in. +\autodoc:note{SILE provides the \code{SILE.scratch} variable for you to store global information in. You should use a portion of this table namespaced to your class or package.} Here is a routine we can call at the end of each page to move the TOC nodes: diff --git a/documentation/macros.sil b/documentation/macros.sil index 43adc92f7..c31988a57 100644 --- a/documentation/macros.sil +++ b/documentation/macros.sil @@ -17,7 +17,6 @@ \use[module=packages.simpletable] % Autodoc-related shims \define[command=examplefont]{\autodoc:example{\process}} -\define[command=note]{\autodoc:note{\process}} % Document fonts \define[command=sectionsfont]{\font[weight=600,family=Roboto Condensed]{\process}} \define[command=tableofcontents:headerfont]{\font[weight=600,size=22pt,family=Roboto Condensed]{\process}} @@ -29,7 +28,7 @@ % Custom commands \define[command=terminal]{\verbatim{\set[parameter=document.lskip,value=36pt]\process\smallskip}} \define[command=changed]{ -\note{\strong{The material in this section has changed significantly since the previous release of SILE.}} +\autodoc:note{\strong{The material in this section has changed significantly since the previous release of SILE.}} } \define[command=sup]{\raise[height=0.6ex]{\font[size=0.8em]{\process}}} \end{document} diff --git a/packages/autodoc/init.lua b/packages/autodoc/init.lua index 1026926a7..fb8ba28d2 100644 --- a/packages/autodoc/init.lua +++ b/packages/autodoc/init.lua @@ -14,7 +14,8 @@ local theme = { bracketed = "#656565", -- some grey package = "#172557", -- saturated space blue note = "#525257", -- some asphalt grey hue - class = "#6a2c54" -- some dark shaded magenta + class = "#6a2c54", -- some dark shaded magenta + codeblock = "#303040" -- dark grey with a hint of blue } local colorWrapper = function (ctype, content) @@ -333,15 +334,19 @@ function package:registerCommands () SILE.settings:set("shaper.variablespaces", false) SILE.settings:set("document.language", "und") SILE.typesetter:leaveHmode() - SILE.call("color", { color = "#303040" }, function () + colorWrapper("codeblock", function () SILE.call("bigskip") - SILE.call("autodoc:line") + colorWrapper("note", function () + SILE.call("autodoc:line") + end) SILE.typesetter:pushVglue(-0.6*ex) SILE.call("novbreak") SILE.process(content) SILE.call("novbreak") SILE.typesetter:pushVglue(1.4*ex) - SILE.call("autodoc:line") + colorWrapper("note", function () + SILE.call("autodoc:line") + end) SILE.call("smallskip") end) end) @@ -368,7 +373,7 @@ function package:registerCommands () local innerindent = SILE.measurement("1em"):absolute() SILE.settings:temporarily(function () SILE.settings:set("document.lskip", leftindent) - SILE.settings:set("document.rskip", SILE.nodefactory.glue()) + SILE.settings:set("document.rskip", leftindent) SILE.call("noindent") colorWrapper("note", function () @@ -378,10 +383,11 @@ function package:registerCommands () SILE.call("hrule", { width = 3 * linedimen, height = linethickness }) SILE.call("hrule", { width = linethickness, height = linethickness, depth = linedimen }) + SILE.call("noindent") SILE.call("novbreak") SILE.settings:temporarily(function () SILE.settings:set("document.lskip", SILE.nodefactory.glue(leftindent + innerindent)) - SILE.settings:set("document.rskip", SILE.nodefactory.glue(innerindent)) + SILE.settings:set("document.rskip", SILE.nodefactory.glue(leftindent + innerindent)) SILE.call("font", { size = "0.95em", style = "italic "}, content) SILE.call("novbreak") end) diff --git a/packages/dropcaps/init.lua b/packages/dropcaps/init.lua index fbd1aa8b8..764de53df 100644 --- a/packages/dropcaps/init.lua +++ b/packages/dropcaps/init.lua @@ -92,13 +92,13 @@ To tweak the position of the dropcap, measurements may be passed to the \autodoc Other options passed to \autodoc:command{\dropcap} will be passed through to \autodoc:command{\font} when drawing the initial letter(s). This may be useful for passing OpenType options or other font preferences. -\begin{note} +\begin{autodoc:note} One caveat is that the size of the initials is calculated using the default linespacing mechanism. If you are using an alternative method from the \autodoc:package{linespacing} package, you might see strange results. Set the \autodoc:setting{document.baselineskip} to approximate your effective leading value for best results. If that doesn't work set the size manually. Using \code{SILE.setCommandDefaults()} can be helpful for so you don't have to set the size every time. -\end{note} +\end{autodoc:note} \end{document} ]] diff --git a/packages/image/init.lua b/packages/image/init.lua index 156bcbcd6..9d4285dfe 100644 --- a/packages/image/init.lua +++ b/packages/image/init.lua @@ -45,9 +45,9 @@ If the size parameters are not given, then the image will be output at its “na The command also supports a \autodoc:parameter{page=} option, to specify the selected page in formats supporting several pages (such as PDF). -\begin{note} +\begin{autodoc:note} With the libtexpdf backend (the default), the images can be in JPEG, PNG, EPS, or PDF formats. -\end{note} +\end{autodoc:note} Here is a 200x243 pixel image output with \autodoc:command{\img[src=documentation/gutenberg.png]}. The image has a claimed resolution of 100 pixels per inch, so ends up being two inches (144pt) wide on the page:\par diff --git a/packages/specimen/init.lua b/packages/specimen/init.lua index 7665782e4..83f631ac6 100644 --- a/packages/specimen/init.lua +++ b/packages/specimen/init.lua @@ -49,6 +49,7 @@ function package:registerCommands () local w = 0 for j= 1,#tokens do w = w + tokens[j].width end local ratio = width.length / w + SILE.call("noindent") SILE.call("font", {size = fontOptions.size * ratio}, function() SILE.process({line.string}) SILE.call("par")