pkgdown | Generate static html documentation for an R package | Data Visualization library
kandi X-RAY | pkgdown Summary
kandi X-RAY | pkgdown Summary
pkgdown is designed to make it quick and easy to build a website for your package. You can see pkgdown in action at this is the output of pkgdown applied to the latest version of pkgdown. Learn more in vignette("pkgdown") or ?build_site.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pkgdown
pkgdown Key Features
pkgdown Examples and Code Snippets
Community Discussions
Trending Discussions on pkgdown
QUESTION
When I run the following code interactively, the expected testFig.html
is produced and functions correctly.
ANSWER
Answered 2022-Apr-11 at 17:06As noted in the comments to the question, the solution to the question asked is to put the file produced in a folder in the vignette directory. This protects the necessary files from being deleted when using buildVignette
. However, this approach does not work when building and checking a package. I will ask a separate question on that.
QUESTION
I added a pkgdown
site to my vcdExtra
package and cannot figure out how to control the size of the package hex logo that appears on the main page built by pkgdown, https://friendly.github.io/vcdExtra/index.html
The README.md
file contains a line to insert the image at 200 pixels
ANSWER
Answered 2022-Feb-21 at 11:43The height in the style property has precedence, and pkgdown
sets it to "auto"
, whereas it looks as though Github leaves it unset. Your HTML has
QUESTION
I am having trouble understanding how to implement the docsearch snippet into my github pages (I am using bootstrap 3).
From the package documentation:
Once you have published your pkgdown website, submit the pkgdown site URL to Docsearch. DONE
Put the value of the apiKey and indexName parameters into your site _pkgdown.yml. DONE
Given my lack of knowledge, I am now having hard time understanding this.
The Docsearch\Algolia emailed me:
...CSS
Copy this snippet at the end of the HTML
head
tag
ANSWER
Answered 2022-Feb-13 at 14:31According to the documentation, the best way to include custom HTML like this is to add it to your _pkgdown.yml
file under these options:
QUESTION
I'm writing an R package using roxygen2
for documentation. I'm using the @includeRmd
tag to reduce duplication, and this works well to generate consistent documentation across the help files, vignette, and pkgdown
website.
My only issue is that, when I use the tag to insert examples, R CMD check
gives me a nasty warning. Here is my setup:
R/adder.R
... source code for function with roxygen2
block
ANSWER
Answered 2022-Jan-22 at 01:03Your usage of the @includeRmd
tag does not appear to be supported. You can use it to generate a Description or (sub)sections of Details, but not Examples. The documentation states:
It is currently not possible to document function arguments, return values, etc. in external Rmd documents.
That isn't too surprising, for a couple of reasons:
R CMD check
expects the\examples{}
block to contain verbatim R code, not Markdown, so injecting Markdown into the block without preprocessing is doomed to fail. Due to the chunk header and footer, the following is not valid R code:
QUESTION
I want to create a Rmarkdown html report with the downcute
(chaos) theme from the package rmdformats
. Now everything works except for the toc_depth
argument in my yaml
header. The table of contents will only show h1
and h2
's.
ANSWER
Answered 2021-Dec-28 at 15:50Unfortunately rmdformats::downcute()
only works with toc_depth
2 or less out of the box. There are plenty of issues on rmdformats GitHub page where this is discussed for different themes.
However, based on one answer for this issue, you can get toc_depth: 5
by pasting this into the start of your R Markdown file:
QUESTION
I used the pkgdown package to create a new website of my package that will be hosted on Github.
I ran the following codes:
ANSWER
Answered 2021-Nov-04 at 01:48For reasons I don't totally understand, by default use_pkgdown()
adds the docs/ folder to the .gitignore file. That's why it's not showing up in your commit panel. Open up the .gitignore file and delete the reference to docs (should be at the bottom), the docs folder should now appear in your .gitignore and you can commit and push it to your repo.
Perhaps someone from pkgdown
can explain why the docs folder is ignored when the instructions say to use it as the GitHub pages source?
QUESTION
I have some data which looks like this:
...ANSWER
Answered 2021-Nov-01 at 12:22Since the question asks how to group by both sign and newspaper, let me answer that one first.
QUESTION
I recently got a new laptop with Windows 11 (despite my sessionInfo()
stating Windows 10) and I'm trying to build a pkgdown
site for an R package that I'm developing. This is not an issue that I have encountered in the past. Running the command pkgdown::build_site()
does not correctly link my custom logo to the HTML sites for this R package.
Custom logo png below, for posterity: brConnectR logo
The man/figures/logo.png
file was generated with usethis::use_logo("path/to/logo.png")
and the favicons were generated as part of the pkgdown::build_site()
process, however, the resulting docs/index.html
fails to capture any logo. Below is my sessionInfo()
:
ANSWER
Answered 2021-Oct-29 at 22:06I resolved this issue following the Package Logo section of the pkgdown::build_home()
reference page:
If you have a package logo, you can include it at the top of your README in a level-one heading:
# pkgdown
init_site() will also automatically create a favicon set from your package logo.
In addition to the above, I installed the development version of pkgdown
and this fixed a cryptic warning that I was getting when running pkgdown::build_site()
("WARNING Deprecated: markdown_github. Use gfm").
To install the dev version from GitHub: devtools::install_github("r-lib/pkgdown")
QUESTION
I have a R package that I am trying to setup pkgdown
for. I'm following the instructions here, and am running build_site()
to generate the docs directory. When running this command, I get the error
ANSWER
Answered 2021-May-22 at 07:24The error is fairly informative; it tells you that
QUESTION
The pkgdown
autolinking vignette goes into some detail about how the package creates links in websites, both to other pages within the site itself and to documentation for other packages. I would like to know if there is an easy means of replicating this. E.g. is there a function that can be run within when building a site, something like generate_pkgdown_link("my_function")
that will create such a link. This would be very useful, e.g. for creating HTML flow-charts etc that describe the package structure.
Note that it is relatively straightforward to look at an automatically generated link and produce something that looks the same. The main difficulty is in generating a link that works regardless of where the site is hosted - e.g. whether it be hosted locally or on an RStudio Connect server.
...ANSWER
Answered 2021-Apr-09 at 12:06For anyone trying to answer the same question, there is a documented solution which I somehow missed when writing this question - use downlit::downlit_html_no()
, e.g.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pkgdown
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page