vignettes/share-on-a-github-website.Rmd
share-on-a-github-website.Rmd
You write R scripts and you would like to share them with other users, in a sustainable and maintainable way. You already know how to write a notebook (Rmarkdown or Quarto) and share its HTML output, but you do not like to present the outputs along with how to use the functions in the same web page.
If you plan on sharing your package on GitHub,
fusen::init_share_on_github()
creates all necessary files
in your project and send them on your GitHub account to create the
website of the package documentation. Then, you can focus on the
content.
Follow the steps below and you’ll see your public website documentation
in no time!
Create a new project with {fusen} using git
Follow the “dev/0-dev_history.Rmd” to describe your project
fusen::fill_description()
function with your identity as
below
# Describe your project
fusen::fill_description(
pkg = here::here(),
fields = list(
Title = "Share Your Project Following Good Development Practices From a Rmarkdown File",
Description = "Use Rmarkdown First method. Strengthen your work with documentation and tests. Everything can be set from a Rmarkdown file in your project.",
`Authors@R` = c(
person("John", "Doe", email = "john@email.me", role = c("aut", "cre"), comment = c(ORCID = "0000-0000-0000-0000"))
)
)
)
# Define License with use_*_license()
usethis::use_mit_license("John Doe")
function
from the example
and
test
chunksinflate()
the flat template to build the proper
structure of the project
fusen::inflate(flat_file = "dev/flat_full.Rmd", vignette_name = "Get started")
usethis::create_github_token()
,
then gitcreds::gitcreds_set()
before, if you do not have a
registered GitHub token yet.
#' \dontrun{
#' # This modifies the current directory and send it on GitHub
init_share_on_github()
#' }
In a few minutes, you’ll be able to see and share your project
website.
You won’t have to run this command line again. Each time you push new
commits to the main branch on GitHub, your website will be updated
thanks to GitHub Actions.
init_share_on_github()
runs multiple steps to be able to
share a proper package on GitHub: