Skip to content

Commit

Permalink
docs: Fix typos in documentation an in-code comments
Browse files Browse the repository at this point in the history
Found via `codespell -L oint,equest,ges,simle -S lua-libraries` and `typos --hidden --format brief`
  • Loading branch information
kianmeng authored and Didier Willis committed Nov 26, 2024
1 parent 4c31290 commit 65f5dd9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ files["lua-libraries/djot"] = {
"utf8",
},
ignore = {
-- usually bad but used in compatiblity shims...
-- usually bad but used in compatibility shims...
"121", -- setting a read-only global variable
-- usually questionable but weird use in constructors...
"312", -- value of argument self is overwritten before use
Expand Down
2 changes: 1 addition & 1 deletion examples/lightweight-markup.dj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Beyond technical considerations, it's also worth examining the functionality of
## On the book document class

The converters included in this module try to play fair with SILE's *book* document class, via the provision of a set of "fallback" commands and environments.
Theses serve as wrappers, using those provided by the document class whenever possible, or implementing simpler and more basic versions as fallbacks, when not available.
These serve as wrappers, using those provided by the document class whenever possible, or implementing simpler and more basic versions as fallbacks, when not available.

In simpler terms, by installing the _re·sil·ient_ collection, users gain access to more comprehensive and enhanced versions.
The degraded fallbacks ensure that users still have access to functional alternatives when using other document classes that lack these features.
Expand Down
2 changes: 1 addition & 1 deletion examples/sile-and-djot.dj
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ Well, Djot has the notion of a "symbol", a keyword surrounded by colon signs (§
Although it was initially provisioned for "emojis", the default interpretation is now left to the rendering engine.

This converter for SILE is focussed on producing print-quality books, where so-called emojis play little part.
We are thefore going to use those symbols in a non-conventional way.
We are therefore going to use those symbols in a non-conventional way.
Back to our initial question, what if you could just type `:pumpernickel:` and have it automatically expanded?

Since it's possible to have unused footnote definitions, let's craft one as shown hereafter, with its reference identifier being the same as our targeted variable.
Expand Down
4 changes: 2 additions & 2 deletions examples/sile-and-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ For instance, the following code produces $e^{i\pi}=-1$.
```
:::

There is an important constraint, though: you have to restrict yourself to the syntax subset supported by SILE. This being said, some nice fomulas may be achieved.
There is an important constraint, though: you have to restrict yourself to the syntax subset supported by SILE. This being said, some nice formula may be achieved.
$$\pi=\sum_{k=0}^\infty\frac{1}{16^k}(\frac{4}{8k+1} − \frac{2}{8k+4} − \frac{1}{8k+5} − \frac{1}{8k+6})$$


Expand Down Expand Up @@ -492,7 +492,7 @@ A footnote call[^markdown-some-fn] is marked...
[^markdown-some-fn]: An example footnote.

Another Pandoc-inspired extension is the possibility to direct inline footnotes.
They are introduced with directly with the caret `^`, immediatelly followed by the footnote content in square brackets, as in the following example.^[Direct footnote.]
They are introduced with directly with the caret `^`, immediately followed by the footnote content in square brackets, as in the following example.^[Direct footnote.]

::: {custom-style=CodeBlock}
```
Expand Down
2 changes: 1 addition & 1 deletion inputters/djot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ function Renderer:symbol (node)

if node_fake_metadata then
if #node_fake_metadata.c > 1 and not node._standalone_ then
SU.error("Cannot use multi-paragraph metatada "..label.." as inline content")
SU.error("Cannot use multi-paragraph metadata "..label.." as inline content")
end
local content = self:getUserDefinedSymbol(label, node_fake_metadata)
if node.attr then
Expand Down
4 changes: 2 additions & 2 deletions inputters/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ local function SileAstWriter (writerOps, renderOps)
-- The lunamark "AST" is made of "ropes":
-- "A rope is an array whose elements may be ropes, strings, numbers,
-- or functions."
-- The default implementation flattens that to a string, so we overrride it,
-- The default implementation flattens that to a string, so we override it,
-- in order to extract the AST and convert it to the SILE AST.
--
-- The methods that were overriden above actually started to introduce SILE
-- The methods that were overridden above actually started to introduce SILE
-- AST command structures in place of some ropes. Therefore, we now walk
-- these "extended" ropes merge the output, flattened to some degree, into
-- a final SILE AST that we can process.
Expand Down
2 changes: 1 addition & 1 deletion inputters/pandocast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local Pandoc = {
}

local function checkAstSemver(version)
-- IMPLEMENTATON NOTE: Kept simple for now, and naive.
-- IMPLEMENTATION NOTE: Kept simple for now, and naive.
-- We shouldn't care the patch level.
-- The Pandoc AST may change upon "minor" updates, though.
-- We assume min and current versions have the same major version.
Expand Down
14 changes: 7 additions & 7 deletions packages/markdown/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- direct mapping to existing commands or packages.
--
-- Split in a standalone package so that it can be reused and
-- generalized somewhat independently from the undelying parsing code.
-- generalized somewhat independently from the underlying parsing code.
--
-- @copyright License: MIT (c) 2022-2024 Omikhleia, Didier Willis
-- @module packages.markdown.commands
Expand Down Expand Up @@ -130,7 +130,7 @@ function package:_init (_)
-- load the djot package, cause you want to use Djot.
-- load the markdown package, cause you want to use Markdown too.
-- Both load the markdown.commands package.
-- Guess what? The markdown.commands package is instanciated twice.
-- Guess what? The markdown.commands package is instantiated twice.
-- It's supposed to be a SILE feature...
SILE.scratch._markdown_commands = {}
end
Expand Down Expand Up @@ -399,7 +399,7 @@ Please consider using a resilient-compatible class!]])
cascade:call("language", { main = options.lang })
end
if options["custom-style"] then
-- The style (or the hook) is reponsible for paragraphing
-- The style (or the hook) is responsible for paragraphing
cascade:call("markdown:custom-style:hook", { name = options["custom-style"], scope = "block" })
else
cascade:call("markdown:internal:paragraph")
Expand Down Expand Up @@ -520,7 +520,7 @@ Please consider using a resilient-compatible class!]])
SILE.call("label", { marker = options.id })
end
if uri:sub(1,1) == "#" then
-- local hask link
-- local hash link
local dest = uri:sub(2)
if hasLinkContent(content) then
content = wrapLinkContent(options, content)
Expand Down Expand Up @@ -552,7 +552,7 @@ Please consider using a resilient-compatible class!]])
-- The reasons for NOT loading a package for this high-level structure
-- is that the class or other packages may provide their own implementation
-- (e.g. formatted differently, changed to endnotes, etc.).
-- So we only do it as a fallback if mising, to degrade gracefully.
-- So we only do it as a fallback if missing, to degrade gracefully.
SU.warn("Trying to enforce fallback for unavailable \\footnote command")
self:loadAltPackage("resilient.footnotes", "footnotes")
end
Expand Down Expand Up @@ -753,7 +753,7 @@ Please consider using a resilient-compatible class!]])
end, "Default line block in Markdown (internal)")

self:registerCommand("markdown:internal:math", function (options, content)
-- NOTE: The following didnt't work: SILE.call("math", options, content)
-- NOTE: The following didn't work: SILE.call("math", options, content)
-- Let's go for a lower-level AST construct instead.
SILE.process({
createCommand("math", options, SU.ast.contentToString(content))
Expand Down Expand Up @@ -781,7 +781,7 @@ Please consider using a resilient-compatible class!]])
end
local title = removeFromTree(content, "caption")

if self.hasCommandSupport.epigraph then -- asssuming the implementation from resilient.epigraph.
if self.hasCommandSupport.epigraph then -- assuming the implementation from resilient.epigraph.
if title then
-- Trick: Put the extract title back as "\source"
title.command = "source"
Expand Down

0 comments on commit 65f5dd9

Please sign in to comment.