Skip to content

Commit

Permalink
Merge pull request #70 from r-devel/pdf-download
Browse files Browse the repository at this point in the history
add pdf epub options
  • Loading branch information
SaranjeetKaur authored Sep 26, 2022
2 parents c4e2961 + 4595ce6 commit 6cabeca
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/deploy_bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion 01-Introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
8 changes: 8 additions & 0 deletions _output.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ bookdown::gitbook:
<img src="img/Rlogo.png" style="width:150px;padding:10px 0px 0px 10px;display: block;margin:auto;"></img>
after: |
<li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
download: ["pdf", "epub"]
bookdown::pdf_book:
includes:
in_header: preamble.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
bookdown::epub_book: default
Binary file added img/edit_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6cabeca

Please sign in to comment.