Title: | Build And Highlight Package Documentation With Customized Templates |
---|---|
Description: | Helps creating company visual identity. Build your templates for your package vignettes, reports with {bookdown}, package presentation with {pkgdown}. Highlight your documentation in your projects. Allow for code folding. |
Authors: | Sébastien Rochette [aut, cre] |
Maintainer: | Sébastien Rochette <[email protected]> |
License: | GPL-3 |
Version: | 0.0.1.9000 |
Built: | 2024-10-31 16:33:54 UTC |
Source: | https://github.com/ThinkR-open/papillon |
Build book from vignettes
build_book( path = "inst/report", path.v = "vignettes", output_format = c("bookdown::gitbook", "bookdown::pdf_document2"), clean_before = TRUE, clean_after = TRUE, keep_rmd = "index\\.Rmd$|zzz-references\\.Rmd$", clean = TRUE )
build_book( path = "inst/report", path.v = "vignettes", output_format = c("bookdown::gitbook", "bookdown::pdf_document2"), clean_before = TRUE, clean_after = TRUE, keep_rmd = "index\\.Rmd$|zzz-references\\.Rmd$", clean = TRUE )
path |
Path of the book |
path.v |
Path to vignettes folder to copy in the book folder |
output_format |
Output format of the book. "bookdown::gitbook", "bookdown::pdf_document2" |
clean_before |
Logical. Whether to remove all Rmd (except keep_rmd) before build |
clean_after |
Logical. Whether to remove all Rmd (except keep_rmd) after build |
keep_rmd |
Regex to list Rmd filenames to keep if clean_before or clean_after is TRUE. You'd better keep index.Rmd. |
clean |
Whether to delete the possible output files. If |
If "docs" is not in "inst" folder, it will not be available to the users
build_pkgdown( move = TRUE, clean_before = TRUE, clean_after = TRUE, yml, favicon, preview = NA, ... )
build_pkgdown( move = TRUE, clean_before = TRUE, clean_after = TRUE, yml, favicon, preview = NA, ... )
move |
Logical. Whether to move the "docs" folder in "inst" to be kept in the package |
clean_before |
Logical. Whether to empty the "docs" and "inst/docs" prior to build site |
clean_after |
Logical. Whether to remove the original "docs" folder at the root of the project |
yml |
path to custom "_pkgdown.yml" file |
favicon |
path to favicon |
preview |
If |
... |
Other parameters needed by |
Create bibliography md file from a vector of packages
create_biblio_file( packages, out.dir, output = c("packages", "references"), to = c("html", "markdown"), custom.md, edit = TRUE )
create_biblio_file( packages, out.dir, output = c("packages", "references"), to = c("html", "markdown"), custom.md, edit = TRUE )
packages |
vector of packages names |
out.dir |
Directory where to save output md file |
output |
Vector with "packages" (list of packages as bullet points), "references" (list of citation references) or both "packages" and "references" |
to |
Format to convert to. "html", "markdown" or "raw" text |
custom.md |
Vector of markdown text to add to the document before rendering |
edit |
Logical. Whether to open output md file for manual edition |
packages <- c("rmarkdown", "attachment") create_biblio_file(packages, out.dir = tempdir())
packages <- c("rmarkdown", "attachment") create_biblio_file(packages, out.dir = tempdir())
Create a directory for a book
create_book(path = "inst/report", clean = FALSE, template)
create_book(path = "inst/report", clean = FALSE, template)
path |
Book directory |
clean |
Logical. Whether to remove Chapter Rmd files. |
template |
A folder with personal template files for a bookdown site |
## Not run: book_folder <- tempdir() create_book(path = book_folder, clean = TRUE) ## End(Not run)
## Not run: book_folder <- tempdir() create_book(path = book_folder, clean = TRUE) ## End(Not run)
Create bibliography md file from a package DESCRIPTION file
create_pkg_biblio_file( path = "DESCRIPTION", out.dir, output = c("packages", "references"), to = c("html", "markdown"), custom.md, edit = TRUE )
create_pkg_biblio_file( path = "DESCRIPTION", out.dir, output = c("packages", "references"), to = c("html", "markdown"), custom.md, edit = TRUE )
path |
Path to DESCRIPTION file |
out.dir |
Directory where to save output md file |
output |
Vector with "packages" (list of packages as bullet points), "references" (list of citation references) or both "packages" and "references" |
to |
Format to convert to. "html", "markdown" or "raw" text |
custom.md |
Vector of markdown text to add to the document before rendering |
edit |
Logical. Whether to open output md file for manual edition |
Create package description file
create_pkg_desc_file( path = "DESCRIPTION", source = c("archive", "github", "git"), url, out.dir, to = c("html", "markdown", "raw"), edit = TRUE )
create_pkg_desc_file( path = "DESCRIPTION", source = c("archive", "github", "git"), url, out.dir, to = c("html", "markdown", "raw"), edit = TRUE )
path |
Path to description file |
source |
Will the package be delivered as archive, from github or from another git? |
url |
url of the repository if not in URL in DESCRIPTION. Used when source is github or git. |
out.dir |
Path to save output file |
to |
Format to convert to. "html", "markdown" or "raw" text |
edit |
Logical. Whether to open file for edition |
Create and update a custom README.Rmd with installation instructions
generate_readme_rmd( base_path = usethis::proj_get(), parts = c("description", "installation"), source = c("archive", "github", "git"), edit = TRUE, url )
generate_readme_rmd( base_path = usethis::proj_get(), parts = c("description", "installation"), source = c("archive", "github", "git"), edit = TRUE, url )
base_path |
Path of the package to generate Readme from |
parts |
Parts to modify in the Readme: c("description", "installation") |
source |
Will the package be delivered as archive, from github or from another git? |
edit |
Logical. Whether to open README.Rmd |
url |
url of the repository if not in URL in DESCRIPTION. Used when source is github or git. |
A README.Rmd file
## Not run: generate_readme_rmd() ## End(Not run)
## Not run: generate_readme_rmd() ## End(Not run)
Create a function inside R folder in your package to open userguide
open_guide_function(path = "inst/report")
open_guide_function(path = "inst/report")
path |
Path to the guide inside your package |
Create a function inside R folder in your package to open pkgdown website
open_pkgdown_function(path = "inst/docs")
open_pkgdown_function(path = "inst/docs")
path |
Path to the pkgdown inside your package |
write output in utf8
out_from_lines( out_lines, to = c("html", "markdown", "raw"), out.dir, filename = "file", edit = TRUE )
out_from_lines( out_lines, to = c("html", "markdown", "raw"), out.dir, filename = "file", edit = TRUE )
out_lines |
vector of html lines to write |
to |
Format to convert to. "html", "markdown" or "raw" text |
out.dir |
Directory where to save output md file |
filename |
filename without extentions |
edit |
Logical. Whether to open file for edition |
Render Rmd in a script external to the current session
render_external( input, output_format = "rmarkdown::html_document", output_file, output_options, warn = -1 )
render_external( input, output_format = "rmarkdown::html_document", output_file, output_options, warn = -1 )
input |
The input file to be rendered. This can be an R script (.R), an R Markdown document (.Rmd), or a plain markdown document. |
output_format |
The R Markdown output format to convert to. The option
|
output_file |
The name of the output file. If using |
output_options |
List of output options that can override the options
specified in metadata (e.g. could be used to force |
warn |
sets the handling of warning messages. -1 or 0 |