knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Words of caution: this is still a WIP. Use carefully, and don’t forget to backup your bookdwon before using the app.
The goal of backyard is to provide a visual backend for collaboration on Bookdown projects.
{backyard}
?The main idea is that, with a {backyard}
backend, users can focus on writing and don't have to know anything about Markdown and/or about R & {bookdown}
to get involved in the writing of a bookdown. This would facilitate collaboration between those who use R and those who don't.
Once deployed, a {backyard}
backend is easy to access and use, and is suitable for tech/non-tech people.
There are many situations where you might need {backyard}
. Here are few ideas:
{backyard}
backend.{backyard}
backend organized?backyard::run_book()
(without any parameter filled) opens an invite box that can either be used for creating a new bookdown (point to the folder where you want your bookdown to be saved, and add a folder name), then the default Bookdown template is used, or to point to an Index.Rmd of a bookdown already present on the machine.
You can pass to backyard::run_book()
the location of the index.Rmd (then the app is launched for this bookdown), or the location of your home (for the folder selection invite, default is .
).
By default, the safe_mode
parameter is set to TRUE
. This mode creates, at launch time, a copy (in {path}/backyard_copy
) of your current version of the bookdown folder. That way, if ever you do something wrong during your backyard session, you can still go back to the previous version.
The markdown_only
parameter, set to TRUE
by default, informs if you want to keep only the markdown-compatible tags, and then will only display markdwown compatible buttons in the wysiwyg interface. If turned to FALSE, you'll get more button, but when saved, the .Rmd will contain html tags.
This first page gives you a quick overview of the book. Nothing fancy here.
This tabs has 3 other tabs
Code blocks are, on purpose, not editable in Interactive mode. You should switch to Markdown mode if you want to edit these elements.
The idea of this tab is that non-tech people don't want to enter too many technical details, hence they have "textual" content to see. If you want to dig into the tech, two tabs can be used to do that?
You can install the dev version of backyard with:
# install.packages("remotes") remotes::install_github("ColinFay/backyard")
The best way to collaborate with this is to deploy this app on a server.
Here a minimalist Docker file that can launch a {backyard}
backend:
FROM rocker/tidyverse MAINTAINER Colin FAY "contact@colinfay.me" RUN R -e "install.packages('remotes', repos = 'https://cran.rstudio.com/')" RUN R -e "remotes::install_github('ColinFay/backyard')" # Create a folder just for bookdowns RUN mkdir /usr/home/bookdown EXPOSE 2811 CMD R -e "backyard::run_book(host = '0.0.0.0', home = '/usr/home/bookdown')"
You can find this dockerfile in the inst/ folder of the package.
If you only wants to share one bookdown (assuming the boookdown is in the same dir as the Dockerfile):
FROM rocker/tidyverse MAINTAINER Colin FAY "contact@colinfay.me" RUN R -e "install.packages('remotes', repos = 'https://cran.rstudio.com/')" RUN R -e "remotes::install_github('ColinFay/backyard')" RUN mkdir /usr/local/bookdown COPY bookdown /usr/bookdown/bookdown EXPOSE 2811 CMD R -e "backyard::run_book(indexrmd = '/usr/bookdown/bookdown',host = '0.0.0.0')"
Notes on Docker
{backyard}
is deployed on port 2811. It can be changed in backyard::run_book
.host = '0.0.0.0'
This project is still experimental, so there might be bugs in the interface. Here are some we know of:
Please note that the 'backyard' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.