Skip to content

Commit

Permalink
add trailing slashes to URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Dec 11, 2023
1 parent 1822137 commit 71b2839
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion R/parser.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ parse_params = function(params, label = TRUE) {
eval(parse_only(paste('alist(', quote_label(params), ')'))),
error = function(e) {
message('(*) NOTE: I saw chunk options "', params,
'"\n please go to https://yihui.org/knitr/options',
'"\n please go to https://yihui.org/knitr/options/',
'\n (it is likely that you forgot to quote "character" options)')
})

Expand Down
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dev2ext = function(options) {
for (i in x[idx]) dev_get(i)
stop2(
'cannot find appropriate filename extensions for device ', x[idx], '; ',
"please use chunk option 'fig.ext' (https://yihui.org/knitr/options)"
"please use chunk option 'fig.ext' (https://yihui.org/knitr/options/)"
)
}
unname(res)
Expand Down
2 changes: 1 addition & 1 deletion R/utils-rd2html.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ knit_rd = function(pkg, links = tools::findHTMLlinks(), frame = TRUE) {
unlink('figure/', recursive = TRUE)
toc = sprintf('- <a href="%s" target="content">%s</a>', paste0(topics, '.html'), topics)
toc = c(paste0('# ', pkg), '', toc, '',
paste('Generated with [knitr](https://yihui.org/knitr) ', packageVersion('knitr')))
paste('Generated with [knitr](https://yihui.org/knitr/) ', packageVersion('knitr')))
markdown::mark_html(text = toc, output = '00frame_toc.html', meta = list(
title = paste('R Documentation of', pkg), css = 'R.css'
))
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ color_def = function(col, variable = 'shadecolor') {
x = switch(variable, shadecolor = rep(.97, 3), fgcolor = rep(0, 3))
warning("the color '", col, "' is invalid;",
'using default color...',
'see https://yihui.org/knitr/options')
'see https://yihui.org/knitr/options/')
}
}
if (length(x) != 3L) stop('invalid color:', col)
Expand Down
2 changes: 1 addition & 1 deletion inst/examples/knitr-listings.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ to \LaTeX{} users.

You should be able to compile the \TeX{} document and get a PDF file
like this one: \url{https://github.com/yihui/knitr/releases/download/doc/knitr-listings.pdf}.
For more information about out hooks, see \url{https://yihui.org/knitr/hooks}.
For more information about out hooks, see \url{https://yihui.org/knitr/hooks/}.
\end{document}
2 changes: 1 addition & 1 deletion inst/examples/knitr-listings.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ status collapsed

\begin_layout Plain Layout

https://yihui.org/knitr/hooks
https://yihui.org/knitr/hooks/
\end_layout

\end_inset
Expand Down
24 changes: 12 additions & 12 deletions inst/examples/knitr-manual.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ library(knitr)
opts_chunk$set(fig.path='figure/manual-', cache.path='cache/manual-', fig.align='center', fig.show='hold', par=TRUE)
## I use = but I can replace it with <-; set code/output width to be 68
options(formatR.arrow=TRUE, width=68, digits=4)
## tune details of base graphics (https://yihui.org/knitr/hooks)
## tune details of base graphics (https://yihui.org/knitr/hooks/)
knit_hooks$set(par=function(before, options, envir){
if (before && options$fig.show!='none') par(mar=c(4,4,.1,.1),cex.lab=.95,cex.axis=.9,mgp=c(2,.7,0),tcl=-.3)
})
Expand Down Expand Up @@ -116,10 +116,10 @@ such as the support to a wide range of graphics devices and cache.
Below is a brief description of the process:
\begin{enumerate}
\item \textbf{knitr} takes an input file and automatically determines an
appropriate set of \href{https://yihui.org/knitr/patterns}{patterns}
appropriate set of \href{https://yihui.org/knitr/patterns/}{patterns}
to use if they are not provided in advance (e.g. \textsf{file.Rnw}
will use \texttt{knit\_patterns\$get('rnw')});
\item a set of output \href{https://yihui.org/knitr/hooks}{hooks} will
\item a set of output \href{https://yihui.org/knitr/hooks/}{hooks} will
also be set up automatically according to the filename extension (e.g.
use \LaTeX{} environments or HTML elements to wrap up R results);
\item the input file is read in and split into pieces consisting of R code
Expand All @@ -138,7 +138,7 @@ really evaluating the chunk; if cached results exist and this code
chunk has not been changed since last run (use MD5 sum to verify),
the cached results will be (lazy-) loaded, otherwise new cache will
be built; if a cached chunk depends on other chunks (see the \texttt{dependson}
\href{https://yihui.org/knitr/options}{option}) and any one of these
\href{https://yihui.org/knitr/options/}{option}) and any one of these
chunks has changed, this chunk must be forcibly updated (old cache
will be purged)
\item there are six types of possible output from \textbf{evaluate}, and
Expand Down Expand Up @@ -199,7 +199,7 @@ progress bar is provided when knitting a file so we roughly know how
long we still need to wait; output from inline R code (e.g. \texttt{\textbackslash{}Sexpr\{x{[}1{]}\}})
is automatically formatted in \TeX{} math notation (like \Sexpr{123456789})
if the result is numeric. You may check out a number of specific manuals
dedicated to specific features such as graphics in the website: \url{https://yihui.org/knitr/demos}.
dedicated to specific features such as graphics in the website: \url{https://yihui.org/knitr/demo/}.

\subsection{Code Decoration}

Expand Down Expand Up @@ -389,16 +389,16 @@ $\mathrm{d}\mathbf{x}_{t}=\alpha[(\theta-\mathbf{x}_{t})\mathrm{d}t+4]\mathrm{d}
in R graphics:

<<math-expr-R, eval=FALSE>>=
qplot(1:10, 1:10) + opts(title = substitute(paste(d *
bolditalic(x)[italic(t)] == alpha * (theta - bolditalic(x)[italic(t)]) *
d * italic(t) + lambda * d * italic(B)[italic(t)]), list(lambda = 4)))
qplot(1:10, 1:10) + opts(title = substitute(paste(d *
bolditalic(x)[italic(t)] == alpha * (theta - bolditalic(x)[italic(t)]) *
d * italic(t) + lambda * d * italic(B)[italic(t)]), list(lambda = 4)))
@

With the tikz device, it is both straightforward and more beautiful:
With the tikz device, it is both straightforward and more beautiful:

<<math-expr-tikz, dev='tikz', fig.width=5, fig.height=3, out.width='.55\\linewidth', cache=TRUE, message=FALSE>>=
library(ggplot2)
qplot(1:10, 1:10) +
qplot(1:10, 1:10) +
labs(title = sprintf('$\\mathrm{d}\\mathbf{x}_{t} = \\alpha[(\\theta - \\mathbf{x}_{t})\\mathrm{d}t + %d]\\mathrm{d}B_{t}$', 4))
@

Expand Down Expand Up @@ -629,15 +629,15 @@ Then we only have to set the chunk option \texttt{rgl=TRUE}:

<<fancy-rgl, rgl=TRUE, dev='png', fig.width=5, fig.height=5, out.width='2in', message=FALSE, warning=FALSE, cache=TRUE>>=
library(rgl)
demo('bivar', package='rgl', echo=FALSE)
demo('bivar', package='rgl', echo=FALSE)
par3d(zoom=.7)
@

Due to the flexibility of output hooks, \textbf{knitr} supports several
different output formats. The implementation is fairly easy, e.g.,
for \LaTeX{} we put R output in \texttt{verbatim} environments, and
in HTML, it is only a matter of putting output in \texttt{div} layers.
These are simply character string operations. Many demos in \url{https://yihui.org/knitr/demos}
These are simply character string operations. Many demos in \url{https://yihui.org/knitr/demo/}
show this idea clearly. This manual did not cover all the features
of \textbf{knitr}, and users are encouraged to thumb through the website
to know more possible features.
Expand Down
10 changes: 5 additions & 5 deletions inst/examples/knitr-manual.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ knitr
\begin_inset CommandInset href
LatexCommand href
name "patterns"
target "https://yihui.org/knitr/patterns"
target "https://yihui.org/knitr/patterns/"

\end_inset

Expand All @@ -488,7 +488,7 @@ a set of output
\begin_inset CommandInset href
LatexCommand href
name "hooks"
target "https://yihui.org/knitr/hooks"
target "https://yihui.org/knitr/hooks/"

\end_inset

Expand Down Expand Up @@ -544,7 +544,7 @@ dependson
\begin_inset CommandInset href
LatexCommand href
name "option"
target "https://yihui.org/knitr/options"
target "https://yihui.org/knitr/options/"

\end_inset

Expand Down Expand Up @@ -809,7 +809,7 @@ status collapsed

\begin_layout Plain Layout

https://yihui.org/knitr/demos
https://yihui.org/knitr/demo/
\end_layout

\end_inset
Expand Down Expand Up @@ -2712,7 +2712,7 @@ status collapsed

\begin_layout Plain Layout

https://yihui.org/knitr/demos
https://yihui.org/knitr/demo/
\end_layout

\end_inset
Expand Down

0 comments on commit 71b2839

Please sign in to comment.