add_html_page: Create a page on Google Sites

Description Usage Arguments Source Examples

View source: R/wrappers.R

Description

This function takes metadata and a file path to an HTML document and pushes that HTML up to a Google Site

Usage

1
2
3
4
add_html_page(page_xhtml_source, page_parent_page_title = "",
  page_template_id = "", page_title = "", page_custom_url = "",
  overwrite = TRUE, site_domain = getOption("googlesites.site_domain"),
  site_name = getOption("googlesites.site_name"))

Arguments

page_xhtml_source

A string representing the path to a local HTML file that can be successfully read into R as XML. Google SItes data must be valid XML so this check is performed by xml2::read_xml()

page_parent_page_title

A string (optional) with the title of a webpage on the existing Google Site where this particular post will be created as a subpage

page_template_id

A string (optional) with id of a template on the existing Google Site that this particular post will inherit

page_title

A string (optional) that will be used as the page Title on the created post. If not specified, then the title will be the same as the HTML file name, excluding .html and santitized to only include letters, numbers, hypens, or underscores.

page_custom_url

A string (optional) that will be used as the page URL on the created post. If not specified, then the url will be the same as the HTML file name, excluding .html and santitized to only include letters, numbers, hypens, or underscores.

overwrite

A logical indicating whether to overwrite any existing pages on the Google Site with the same title or url. Matches on url are prioritized above matches with same title, meaning that if a page with the same title and another page with the same url are found, then we will overwrite the one with the same url since, technically, Google Sites pages with the same title are allowed, even though we would prefer to keep those unique under each parent page

site_domain

A string representing 'site' or the domain of your Google Apps hosted domain (e.g. example.com)

site_name

A string representing the webspace name of your site; found in the Site's URL (e.g. myCoolSite)

Source

utils.R

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# add a page
test_html <- system.file("inst", "test.html", package="googlesites")
add_html_page(page_xhtml_source = test_html)

# add a page and overwrite the existing one in event it already exists
sample_html <- system.file("extdata", "sample-doc.html", package="googlesites")
add_html_page(page_xhtml_source = sample_html,
              page_title = 'Post with GIF',
              page_custom_url = 'post-with-gif', 
              overwrite=TRUE)

## End(Not run)

ReportMort/googlesites documentation built on May 6, 2019, 10:12 a.m.