cis-ds / course-site

Course site for Computing for Information Science (INFO 5940)
43 stars 41 forks source link

Image embeds #286

Closed djanvier closed 2 years ago

djanvier commented 3 years ago

Was finally able to replace all the image embeds with knitr::include_graphics()! Some notes:

bensoltoff commented 3 years ago

@djanvier just be sure to pull the branch to your local computer before further editing so you are in-sync with the server.

djanvier commented 3 years ago

This looks great! I pushed a couple of commits resolving some merge conflicts and fixing a couple of typos.

  • I wasn't able to change the image embed for the headshot included on the Home page. I just couldn't find it anywhere.

I had to remove it due to issues with the upgrade for Hugo

  • I also wasn't able to make changes to the Shiny notes page, as apparently the "File is binary rather than text so cannot be opened by the source editor."

Not sure where that came from. I was able to incorporate include_graphics() for those images

  • I didn't know how to conserve the captions you included for most of the images, so I just omitted them. However, I tried to make the chunk names resemble the captions as much as possible

You can use the fig.cap option in each knitr chunk to assign captions to the figure. Something like

```{r fig.cap = "Name of the figure"}
...


For any images where there was a caption before, please incorporate them into the new code chunk. Note that you cannot use Markdown formatting within `fig.cap`, so just stick to plain text. If images didn't already have captions, leave it blank (and you can ignore all the references to Allison Horst - we changed those references to acknowledgments at the bottom of the page #285).

Just to clarify, would I need to add a caption with fig.cap if the image had a caption that was never rendered on the website? I may be mixing up captions and alt text in this case

bensoltoff commented 3 years ago

With the Markdown syntax ![](), the alt text is supposed to also be the caption. But with the website it never rendered the caption. If you use fig.cap, it should properly render it as both alt text and the caption.