bird-team / brisbane-bird-atlas

Atlas of the Birds of Brisbane: Community bird atlas for Brisbane, Australia
https://brisbanebirds.com
GNU General Public License v3.0
3 stars 0 forks source link

inserting images #97

Closed jeffreyhanson closed 6 years ago

jeffreyhanson commented 6 years ago

I noticed that the build for the pdf version of the atlas was failing. This is because thebrisbane-environment.Rmd file contains markdown syntax for inserting images that are referenced using a web address. Although you can insert images using standard markdown formatting for files in the repository (e.g. assets/misc/missing.png), this doesn't work for files that are referenced using web addresses (e.g. https://c1.staticflickr.com/5/4844/32017618618_e7419de4c1_b_d.jpg).

To address this, I've created a render_image function that can be used to insert images (and also captions). This function can handle images that are stored in the repository (e.g. assets/misc/missing.png) and also images that are accessed via a web address (e.g. https://c1.staticflickr.com/5/4844/32017618618_e7419de4c1_b_d.jpg). Moving forward, I would recommend that all images be referenced using this function (with exception to species profile images that should continue to be inserted using the dedicated render_species_profile function). I've also updated the brisbane-environment.Rmd file so that it now uses this to refer to the images (e.g. render_image("https://c1.staticflickr.com/5/4844/32017618618_e7419de4c1_b_d.jpg", caption = "Typical dense rainforest habitat. Photo by Louis Backstrom, Lawton Rd, 8 Apr 2018")). Note that, similar to the render_species_profile function, this will need to be specified usig three backticks (see here for example).

Does that make sense? If not, please let me know if you have any questions. I don't have time to do this right now, but if someone could please update the wiki with this information that would be fantastic.

dbl3raf commented 6 years ago

Brilliant @jeffreyhanson, many thanks - I've added this to the Content and formatting commands wiki