diff --git a/.github/workflows/deploy_bookdown.yml b/.github/workflows/deploy_bookdown.yml index 73aeba2..7c518f7 100644 --- a/.github/workflows/deploy_bookdown.yml +++ b/.github/workflows/deploy_bookdown.yml @@ -11,14 +11,19 @@ jobs: name: Render-Book runs-on: macOS-latest steps: - - uses: actions/checkout@v1 - - uses: r-lib/actions/setup-r@v1 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-tinytex@v2 - name: Install rmarkdown run: Rscript -e 'install.packages(c("rmarkdown","bookdown"))' - - name: Render Book - run: Rscript -e 'bookdown::render_book("index.Rmd")' - - uses: actions/upload-artifact@v1 + - name: Render HTML + run: Rscript -e 'bookdown::render_book("index.Rmd", "gitbook")' + - name: Render PDF + run: Rscript -e 'bookdown::render_book("index.Rmd", "pdf_book")' + - name: Render ePub + run: Rscript -e 'bookdown::render_book("index.Rmd", "epub_book")' + - uses: actions/upload-artifact@v3 with: name: docs path: docs/ diff --git a/01-Introduction.Rmd b/01-Introduction.Rmd index 6588e68..df53817 100644 --- a/01-Introduction.Rmd +++ b/01-Introduction.Rmd @@ -6,7 +6,7 @@ This guide is heavily influenced by the [Python Developer Guide](https://devguid This guide is built using bookdown which makes editing it easier, provided you have a GitHub account (sign-up at [github.com](https://github.com/)). After you log-in to GitHub, click on the ‘Edit’ icon highlighted with a red ellipse in the image below. This will take you to an editable version of the the source R Markdown file that generated the page you are on: -![](https://user-images.githubusercontent.com/28556616/122679827-03314a80-d20a-11eb-9714-06ae588127f0.png) +![Screenshot of the toolbar in the HTML version of the guide, with the Edit button (pencil and paper icon) circled in red.](img/edit_icon.png) Use the [issue tracker](https://github.com/forwards/rdevguide/issues) to raise an issue about the guide’s content or to make a feature request. diff --git a/README.md b/README.md index c6904fd..a979108 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,11 @@ You can also suggest changes by editing the .Rmd files that are at the root of t You can push directly to `master` for small fixes. Please use PRs to `master` for discussing larger updates - try to limit to one section or at least one chapter in each PR, so that changes are easier to review. +## Editing notes + +* Images must be included in the source, not provided as URLs, for the PDF book to compile. +* Images should have alt text for accessibility - note this is shown as a caption in the EPUB version. + ## Technical details Deployment is done via Travis CI: @@ -33,7 +38,7 @@ If you want to render the guide locally, you need to install `bookdown`. Then us ```bookdown::render_book('index.Rmd', 'bookdown::gitbook')``` -and the book will be generated in the `docs` folder. You can open the guide on the command line via `open docs/index.html`. +and the book will be generated in the `docs` folder. You can open the guide on the command line via `open docs/index.html`. To preview the PDF or EPUB versions locally, replace `'bookdown::gitbook'` with `'bookdown::pdf_book'` or `'bookdown::epub_book`' as appropriate. ## Code of Conduct diff --git a/_output.yml b/_output.yml index 11d8e3f..7eeeb1b 100644 --- a/_output.yml +++ b/_output.yml @@ -13,3 +13,11 @@ bookdown::gitbook: after: |
  • Published with bookdown
  • + download: ["pdf", "epub"] +bookdown::pdf_book: + includes: + in_header: preamble.tex + latex_engine: xelatex + citation_package: natbib + keep_tex: yes +bookdown::epub_book: default diff --git a/img/edit_icon.png b/img/edit_icon.png new file mode 100644 index 0000000..b1f07da Binary files /dev/null and b/img/edit_icon.png differ