Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lab2godata: logo in package readme appearing over-sized when created from .Rmd #14

Open
AmyMikhail opened this issue Oct 5, 2022 · 0 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@AmyMikhail
Copy link
Contributor

Reported by:

@sarahollis

Problem statement:

When the readme was transferred to an R markdown document to make formatting of code easier, adding the logo as an image file in the .Rmd body resulted in a huge image which could not be justified, despite attempting to alter settings in the R setup chunk.

Attempts to include the image by creating a base-64 encoded html version and using css code in the body of the R markdown did not display the image once the .md file was pushed to Github.

Solution:

The css code to fetch the image can simply be added directly to the title of the R markdown document in the YAML header, as shown below. When the file is knit to github_document, the logo appears in the correct size and alignment, and also appears correctly in Github (see branch):

---
title: "godataR: easier wrangling with the Go.Data API <img src='inst/images/godataR_logo.png' align='centre' height='20%' width='20%'/>"
date: "`r format(Sys.time(), '%d %B %Y')`"
output: github_document
---

I have changed the alignment to centre (which for some reason appears left-justified, but on its own below the main title and above the date, whereas align='right' or align='left' allows the text to flow around the image to the left or right of it, respectively. There are no options that put the logo on the same level as the title (but I think this is just because the title itself is too long for most page widths to display it this way). I think it looks neater this way, but feel free @sarahollis and @jamesfuller-cdc to change it to right-aligned and see what you think.

Here is how it looks now:
logo_is_on_github

@AmyMikhail AmyMikhail self-assigned this Oct 5, 2022
@AmyMikhail AmyMikhail added bug Something isn't working documentation Improvements or additions to documentation labels Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant