Skip to content

Commit

Permalink
Updates for new Roxygen and Gitbook.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbryer committed May 26, 2014
1 parent 7fda770 commit 329a099
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 71 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Expand Up @@ -18,3 +18,4 @@ Imports:
utils,knitr,knitcitations
Suggests:
devtools
Roxygen: list(wrap=FALSE)
2 changes: 2 additions & 0 deletions NAMESPACE
@@ -1,3 +1,5 @@
# Generated by roxygen2 (4.0.0): do not edit by hand

export(buildGitbook)
export(buildRmd)
export(checkForGitbook)
Expand Down
2 changes: 1 addition & 1 deletion Rgitbook.dev.R
Expand Up @@ -14,7 +14,7 @@ installGitbook()
demo('gitbook') # This will create a test project

# Build the Gitbook website
buildGitbook('website')
buildGitbook('website', clean=FALSE)
openGitbook()
publishGitbook('jbryer/Rgitbook')

Expand Down
9 changes: 4 additions & 5 deletions man/Rgitbook-package.Rd
@@ -1,3 +1,4 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\docType{package}
\name{Rgitbook-package}
\alias{Rgitbook-package}
Expand All @@ -6,11 +7,9 @@
Gitbook Projects with R Markdown
}
\details{
This package provides functions for working with
\url{Gitbook.io} projects from within R. Moreover, it
provides support for working with R markdown files using
the \code{knitr} package. Support for MathJax is also
included.
This package provides functions for working with \url{Gitbook.io} projects
from within R. Moreover, it provides support for working with R markdown
files using the \code{knitr} package. Support for MathJax is also included.
}
\author{
\email{jason@bryer.org}
Expand Down
21 changes: 9 additions & 12 deletions man/buildGitbook.Rd
@@ -1,3 +1,4 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{buildGitbook}
\alias{buildGitbook}
\title{This will build a gitbook from the source markdown files.}
Expand All @@ -6,25 +7,21 @@ buildGitbook(source.dir = getwd(), out.dir = paste0(getwd(), "/_book"),
buildRmd = TRUE, format, gitbook.params, ...)
}
\arguments{
\item{source.dir}{location containing the source files.}
\item{source.dir}{location containing the source files.}

\item{out.dir}{location of the built book.}
\item{out.dir}{location of the built book.}

\item{format}{the format of book. Options are pdf or
ebook. If omitted, this will build a website.}
\item{format}{the format of book. Options are pdf or ebook. If omitted,
this will build a website.}

\item{buildRmd}{should \code{\link{buildRmd}} be called
first.}
\item{buildRmd}{should \code{\link{buildRmd}} be called first.}

\item{gitbook.params}{other parameters passed to the
gitbook command.}
\item{gitbook.params}{other parameters passed to the gitbook command.}

\item{...}{other parameters passed to
\code{\link{buildRmd}}.}
\item{...}{other parameters passed to \code{\link{buildRmd}}.}
}
\description{
This function is simply a wrapper to a system call to
\code{gitbook}.
This function is simply a wrapper to a system call to \code{gitbook}.
}
\details{
\url{https://github.com/GitbookIO/gitbook}
Expand Down
30 changes: 13 additions & 17 deletions man/buildRmd.Rd
@@ -1,32 +1,28 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{buildRmd}
\alias{buildRmd}
\title{Builds markdown files from all Rmarkdown files in the given directories.}
\usage{
buildRmd(dir = getwd(), clean = FALSE, log.dir, log.ext = ".txt", ...)
}
\arguments{
\item{dir}{root directory of the gitbook project.}
\item{dir}{root directory of the gitbook project.}

\item{clean}{if TRUE, all Rmd files will be built
regardless of their modification date.}
\item{clean}{if TRUE, all Rmd files will be built regardless of their
modification date.}

\item{log.dir}{if specified, the output from
\code{\link{knitr}} will be saved to a log file in the
given directory.}
\item{log.dir}{if specified, the output from \code{\link{knitr}} will be saved
to a log file in the given directory.}

\item{log.ext}{if log files are saved, the file extension
to use.}
\item{log.ext}{if log files are saved, the file extension to use.}

\item{...}{other parameters passed to
\code{\link{knit}}.}
\item{...}{other parameters passed to \code{\link{knit}}.}
}
\description{
This function will build Rmarkdown files in the given
directory to markdown. The default is to traverse all
subdirectories of the working directory looking for .Rmd
files to process. This function will save a file in the
working directory called \code{.rmdbuild} that contain the
status of the last successful build. This allows the
function to only process changed files.
This function will build Rmarkdown files in the given directory to markdown.
The default is to traverse all subdirectories of the working directory
looking for .Rmd files to process. This function will save a file in the
working directory called \code{.rmdbuild} that contain the status of the
last successful build. This allows the function to only process changed files.
}

9 changes: 4 additions & 5 deletions man/checkForGitbook.Rd
@@ -1,16 +1,15 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{checkForGitbook}
\alias{checkForGitbook}
\title{Check if Gitbook is installed.}
\usage{
checkForGitbook(quiet = FALSE)
}
\arguments{
\item{quiet}{logical indicating whether messages should
be printed.}
\item{quiet}{logical indicating whether messages should be printed.}
}
\description{
If Gitbook is not installed it will try to do so. If the
installion fails or Node.js is not installed, an error will
be thrown.
If Gitbook is not installed it will try to do so. If the installion fails or
Node.js is not installed, an error will be thrown.
}

10 changes: 5 additions & 5 deletions man/gitbookInfo.Rd
@@ -1,3 +1,4 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{gitbookInfo}
\alias{gitbookInfo}
\title{Returns the version information about the currently installed gitbook and
Expand All @@ -6,12 +7,11 @@ what is avaialble from \url{https://www.npmjs.org/}.}
gitbookInfo()
}
\value{
a character vector with two elements,
\code{installed.version} and \code{available.version}.
a character vector with two elements, \code{installed.version} and
\code{available.version}.
}
\description{
Returns the version information about the currently
installed gitbook and what is avaialble from
\url{https://www.npmjs.org/}.
Returns the version information about the currently installed gitbook and
what is avaialble from \url{https://www.npmjs.org/}.
}

10 changes: 5 additions & 5 deletions man/initGitbook.Rd
@@ -1,16 +1,16 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{initGitbook}
\alias{initGitbook}
\title{Create files and folders based on contents of SUMMARY.md.}
\usage{
initGitbook(dir = getwd())
}
\arguments{
\item{dir}{source directory for the Gitbook.}
\item{dir}{source directory for the Gitbook.}
}
\description{
This first calls system command \code{gitbook init} but
then will change the all the file extensions from
\code{.md} to \code{.Rmd} excluding \code{SUMMARY.md} and
\code{README.md}.
This first calls system command \code{gitbook init} but then will change
the all the file extensions from \code{.md} to \code{.Rmd} excluding
\code{SUMMARY.md} and \code{README.md}.
}

14 changes: 7 additions & 7 deletions man/installGitbook.Rd
@@ -1,18 +1,18 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{installGitbook}
\alias{installGitbook}
\title{This will install Gitbook.io.}
\usage{
installGitbook()
}
\description{
This function will install Gitbook from
\url{http://nodejs.org/download/} regardless if the current
version. That is, this function will either update or
install a new version of Gitbook.io.
This function will install Gitbook from \url{http://nodejs.org/download/}
regardless if the current version. That is, this function will either update
or install a new version of Gitbook.io.
}
\details{
On many systems this function will not work as installing
requires root access. The function will print the required
commands for you to copy-and-paste to the terminal.
On many systems this function will not work as installing requires root
access. The function will print the required commands for you to copy-and-paste
to the terminal.
}

7 changes: 4 additions & 3 deletions man/newGitbook.Rd
@@ -1,14 +1,15 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{newGitbook}
\alias{newGitbook}
\title{Initializes a new Gitbook.}
\usage{
newGitbook(dir)
}
\arguments{
\item{dir}{location of the built gitbook.}
\item{dir}{location of the built gitbook.}
}
\description{
This will initalize a new Gitbook in the given directory.
When done, it will also change the working directory.
This will initalize a new Gitbook in the given directory. When done, it will
also change the working directory.
}

8 changes: 4 additions & 4 deletions man/openGitbook.Rd
@@ -1,15 +1,15 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{openGitbook}
\alias{openGitbook}
\title{Open a built gitbook.}
\usage{
openGitbook(out.dir = paste0(getwd(), "/_book"))
}
\arguments{
\item{out.dir}{location of the built gitbook.}
\item{out.dir}{location of the built gitbook.}
}
\description{
This function is a wrapper to the system call of
\code{open} which should open the book in the system's
default web browser.
This function is a wrapper to the system call of \code{open} which should
open the book in the system's default web browser.
}
11 changes: 5 additions & 6 deletions man/publishGitbook.Rd
@@ -1,3 +1,4 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{publishGitbook}
\alias{publishGitbook}
\title{Publish the built gitbook to Github.}
Expand All @@ -6,19 +7,17 @@ publishGitbook(repo, out.dir = paste0(getwd(), "/_book"),
message = "Update built gitbook")
}
\arguments{
\item{repo}{the github repository. Should be of form
username/repository}
\item{repo}{the github repository. Should be of form username/repository}

\item{out.dir}{location of the built gitbook.}
\item{out.dir}{location of the built gitbook.}

\item{message}{commit message.}
\item{message}{commit message.}
}
\description{
Note that this is a wrapper to system \code{git} call.
}
\details{
This function assumes that the repository has already
exists on Github.
This function assumes that the repository has already exists on Github.

Thanks to ramnathv for the shell script.
https://github.com/GitbookIO/gitbook/issues/106#issuecomment-40747887
Expand Down
2 changes: 1 addition & 1 deletion website/installation/gitbookInfo.md
Expand Up @@ -11,7 +11,7 @@ Gitbook.io is under active development. The `gitbookInfo` function will indicate
```

```
gitbook is up-to-date with version 0.4.1
gitbook is up-to-date with version 0.4.6
```


Expand Down

0 comments on commit 329a099

Please sign in to comment.