From 50a1c1edac61bab191a8808a252ba0bb21538f0e Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 4 Mar 2024 10:49:47 +0100 Subject: [PATCH] Fix typos (#1458) --- NEWS.md | 2 +- R/html.R | 2 +- inst/examples/03-formats.Rmd | 2 +- inst/examples/krantz.cls | 4 +-- .../gitbook/css/plugin-highlight.css | 2 +- inst/resources/gitbook/js/app.js | 30 +++++++++---------- inst/rmarkdown/lua/custom-environment.lua | 2 +- inst/templates/default.html | 2 +- tests/testit/test-html.R | 2 +- tests/testit/test-utils.R | 4 +-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/NEWS.md b/NEWS.md index ccd5d57d7..4e611c79b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ # CHANGES IN bookdown VERSION 0.38 -- Fixed a bug that `gitbook()` may geneate an empty search index on certain platforms (thanks, @UlvHare, #1454). +- Fixed a bug that `gitbook()` may generate an empty search index on certain platforms (thanks, @UlvHare, #1454). # CHANGES IN bookdown VERSION 0.37 diff --git a/R/html.R b/R/html.R index e5298ec4a..3de2b9c2a 100644 --- a/R/html.R +++ b/R/html.R @@ -704,7 +704,7 @@ parse_fig_labels = function(content, global = FALSE) { # there could be multiple labels on the same line, but their types must be # the same (https://github.com/rstudio/bookdown/issues/538) if (length(unique(type)) != 1) stop( - 'There are mutiple types of labels on one line: ', paste(labs, collapse = ', ') + 'There are multiple types of labels on one line: ', paste(labs, collapse = ', ') ) type = type[1] num = arry[lab] diff --git a/inst/examples/03-formats.Rmd b/inst/examples/03-formats.Rmd index b15e31232..ac72d161f 100644 --- a/inst/examples/03-formats.Rmd +++ b/inst/examples/03-formats.Rmd @@ -317,7 +317,7 @@ description: | The `bs4_book()` format builds upon the Bootstrap CSS framework ([version 4](https://getbootstrap.com/docs/4.0/)), an open source library of reusable chunks of HTML, CSS, and JavaScript code. The Bootstrap framework allows for easy customization of colors and fonts via the **bslib** R package. -You can use the `theme` option to add a `primary` color in [hexidecimal format,](https://en.wikipedia.org/wiki/Web_colors) which will change the color of all links in your book and the background color of the footer. +You can use the `theme` option to add a `primary` color in [hexadecimal format,](https://en.wikipedia.org/wiki/Web_colors) which will change the color of all links in your book and the background color of the footer. ```yaml bookdown::bs4_book: diff --git a/inst/examples/krantz.cls b/inst/examples/krantz.cls index d2456699d..ebe8bd574 100755 --- a/inst/examples/krantz.cls +++ b/inst/examples/krantz.cls @@ -237,7 +237,7 @@ \newdimen\tempa \newdimen\tempdimen % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Parameter Initializaton %%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Parameter Initialization %%%%%%%%%%%%%%%%%%%%%%%%%% % \newdimen\htrim \newdimen\vtrimtop @@ -1145,7 +1145,7 @@ \else \@cons{\@authors}{, \last@author}\fi\fi \stepcounter{numauthors}% -%%%%%%% commented and deleted below the second part to aviod inaccessible error % shashi % September-2008 +%%%%%%% commented and deleted below the second part to avoid inaccessible error % shashi % September-2008 %% \gdef\last@author{#1 {\rm\fontsize{9\p@}{11\p@}\selectfont #2}} \gdef\last@author{#1} } diff --git a/inst/resources/gitbook/css/plugin-highlight.css b/inst/resources/gitbook/css/plugin-highlight.css index 2aabd3deb..02c018910 100644 --- a/inst/resources/gitbook/css/plugin-highlight.css +++ b/inst/resources/gitbook/css/plugin-highlight.css @@ -133,7 +133,7 @@ .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { /* -Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull +Original Style from ethanschoonover.com/solarized (c) Jeremy Hull */ /* Solarized Green */ diff --git a/inst/resources/gitbook/js/app.js b/inst/resources/gitbook/js/app.js index dc70f58ad..830ea3f93 100644 --- a/inst/resources/gitbook/js/app.js +++ b/inst/resources/gitbook/js/app.js @@ -439,7 +439,7 @@ * Used by `_.sortByOrder` to compare multiple properties of a value to another * and stable sort them. * - * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise, + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * a value is sorted in ascending order if its corresponding order is "asc", and * descending if "desc". * @@ -923,7 +923,7 @@ * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. + * @param {Array} [actions=[]] Actions to perform to resolve the unwrapped value. */ function LodashWrapper(value, chainAll, actions) { this.__wrapped__ = value; @@ -2761,7 +2761,7 @@ * * @private * @param {*} value The unwrapped value. - * @param {Array} actions Actions to peform to resolve the unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { @@ -5571,7 +5571,7 @@ /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurence of each element + * for equality comparisons, in which only the first occurrence of each element * is kept. Providing `true` for `isSorted` performs a faster search algorithm * for sorted arrays. If an iteratee function is provided it is invoked for * each element in the array to generate the criterion by which uniqueness @@ -12448,7 +12448,7 @@ /** * this is a mapping of keys that require shift on a US keypad - * back to the non shift equivelents + * back to the non shift equivalents * * this is so you can use keyup events with these keys * @@ -12504,7 +12504,7 @@ /** * loop through the f keys, f1 to f19 and add them to the map - * programatically + * programmatically */ for (var i = 1; i < 20; ++i) { _MAP[111 + i] = 'f' + i; @@ -12634,7 +12634,7 @@ } /** - * stops propogation for this event + * stops propagation for this event * * @param {Event} e * @returns void @@ -12952,7 +12952,7 @@ * actually calls the callback function * * if your callback function returns false this will use the jquery - * convention - prevent default and stop propogation on the event + * convention - prevent default and stop propagation on the event * * @param {Function} callback * @param {Event} e @@ -13669,7 +13669,7 @@ process.nextTick = function (fun) { } }; -// v8 likes predictible objects +// v8 likes predictable objects function Item(fun, array) { this.fun = fun; this.array = array; @@ -14671,7 +14671,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (!ipv6Hostname) { // IDNA Support: Returns a puny coded representation of "domain". // It only converts the part of the domain name that - // has non ASCII characters. I.e. it dosent matter if + // has non ASCII characters. I.e. it doesn't matter if // you call it with a domain that already is in ASCII. var domainArray = this.hostname.split('.'); var newOut = []; @@ -14981,8 +14981,8 @@ Url.prototype.resolveObject = function(relative) { // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); - //occationaly the auth can get stuck only in host - //this especialy happens in cases like + //occasionally the auth can get stuck only in host + //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; @@ -15063,8 +15063,8 @@ Url.prototype.resolveObject = function(relative) { if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; - //occationaly the auth can get stuck only in host - //this especialy happens in cases like + //occasionally the auth can get stuck only in host + //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; @@ -15444,7 +15444,7 @@ var platform = require('./platform'); var state = require('./state'); -// Toggle sidebar with or withour animation +// Toggle sidebar with or without animation function toggleSidebar(_state, animation) { if (state != null && isOpen() == _state) return; if (animation == null) animation = true; diff --git a/inst/rmarkdown/lua/custom-environment.lua b/inst/rmarkdown/lua/custom-environment.lua index 57b01da66..c6081385f 100644 --- a/inst/rmarkdown/lua/custom-environment.lua +++ b/inst/rmarkdown/lua/custom-environment.lua @@ -148,7 +148,7 @@ Div = function (div) table.insert(div.content[#div.content].content, pandoc.RawInline('tex', '\n' .. endEnv)) else if (div.content[1].t ~= "Para") then - -- required trick to get correct alignement + -- required trick to get correct alignment beginEnv = beginEnv.."\\leavevmode" end table.insert(div.content, 1, pandoc.RawBlock('tex', beginEnv)) diff --git a/inst/templates/default.html b/inst/templates/default.html index f92306961..5be47e799 100644 --- a/inst/templates/default.html +++ b/inst/templates/default.html @@ -133,7 +133,7 @@ height: auto; } /* show arrow before summary tag as in bootstrap -TODO: remove if boostrap in updated in html_document (rmarkdown#1485) */ +TODO: remove if bootstrap in updated in html_document (rmarkdown#1485) */ details > summary { display: list-item; cursor: pointer; diff --git a/tests/testit/test-html.R b/tests/testit/test-html.R index 6fa4178de..543765a74 100644 --- a/tests/testit/test-html.R +++ b/tests/testit/test-html.R @@ -13,7 +13,7 @@ assert("parse figure reference correctly", { (!grepl("(#tab:foo)", res$content, fixed = TRUE)) }) -assert("biblio references section is correcly found", { +assert("biblio references section is correctly found", { # with a csl like https://www.zotero.org/styles/nature # reference div have more attributes html = c('
', diff --git a/tests/testit/test-utils.R b/tests/testit/test-utils.R index e560032dd..de32ba206 100644 --- a/tests/testit/test-utils.R +++ b/tests/testit/test-utils.R @@ -52,12 +52,12 @@ assert('prepend_chapter_title() adds the chapter title to the page title', { 'chapter one | asdf qwer') }) -assert('source_files() handles several configurations correcly', { +assert('source_files() handles several configurations correctly', { get_files = function(files = NULL, dirs = NULL, ...) { source_files(config = list(rmd_files = files, rmd_subdir = dirs), ...) } - # create dummy projet + # create dummy project dir.create(project <- tempfile()) old = setwd(project) files = c(