lzim / teampsd

Team PSD is using GitHub, R and RMarkdown as part of our free and open science workflow.
GNU General Public License v3.0
9 stars 23 forks source link

2024_08: determine image link+alt text syntax to use in .md files #3231

Closed ljmoody closed 1 week ago

ljmoody commented 1 month ago

~July 25: broken image links identified in Team PSD Manual Chap 12 (instructions to authors)

@lijenn's July 24 post on research repo card 550:

We need to use the raw image file link for all Bookdown/Manual markdown files (Team PSD and MTL Manual).

image

@ljmoody Can you confirm if this is where we'd use Find and Replace in GitHub Actions Workflow? Or is it only for the Sim UI SD models?

image

If we could find all instances of https://github.com/lzim/teampsd/blob/ and replace it with https://raw.githubusercontent.com/lzim/teampsd/ it would fix all existing broken images in both manuals.

ljmoody commented 1 month ago

@lijenn, I can't confirm re: Find & Replace question above because I haven't used that F&R function before. I'm only familiar with the F&R capability within each markdown file.

Re: the syntax, I'm confused about which is correct because of the following. Should we meet and discuss? Whatever we change should be a blanket instruction for all .png files; I'd like to be sure we're on the same page so whatever we do moving forward is consistent--and works!

These two images are not rendering in the Team PSD Manual:

image

This image is rendering in the Team PSD Manual:

image

Here's the syntax from Chap 13 for the two images you updated last week:

image

Instructions I've been following for images: image

All of this together makes me think it might not be the "blob" or "raw.githubusercontent" part of the code that makes images render correctly. Is it possible that both the raw.githubusercontent tag and/or the png image tag with raw=true at the end both accomplish the same thing?

lijenn commented 1 month ago

@ljmoody Nice catch! Thanks for the reminder. It's tough when not all the images use the same style and formatting. Not sure if we have the bandwidth for this or if we could somehow use FNR to standardize the markdown code for all images (@matthewtomo could provide support on this?), but I agree with you that we need blanket instructions for fixing them.

It might be easier to add the raw=true, but we need to test it out on other broken images/the code. Do you want to test it out to see if that fixes the broken images in Ch 13 in the Team PSD Manual (Ch 12 in the GH-pages branch)?

Lmk if I understood your concern and if we need to hop on a call.

ljmoody commented 1 month ago

8/1/24 @lijenn & @ljmoody met to discuss making image syntax consistent throughout both manuals.

Option 1: <img src = "https://github.com/lzim/teampsd/blob/ghpages/images/ch7_s1_manuscript_workflow.PNG?raw=true">

Option 2: ![Make a manuscript contribution workflow] (https://raw.githubusercontent.com/lzim/teampsd/gh-pages/images/ch7_s1_manuscript_workflow.PNG)

lijenn commented 1 month ago

Discussed sim_ui_workflow 8/7:

ljmoody commented 1 month ago
matthewtomo commented 2 weeks ago

This issue was addressed in #3246

Discussed 8/20/24 @matthewtomo @jamesmrollins @lijenn ...

  • For images make sure to use following format to include alt text properly: <img alt="Alt Text" src="Path/URL to Image">
    • Make sure to include "?raw=true" at the end of the url to just get the image and not the link to the image in GitHub
    • Example: <img alt="An image of our registration page" src="https://github.com/lzim/mtl/blob/gh-pages/images/self_registration_popup_team_name.png?raw=true">
matthewtomo commented 1 week ago

Discussed 8/20/24 @matthewtomo @jamesmrollins @lijenn

  • Bookdown currently does not properly render all images (issue appears intermittently).

    • Appears that this can be resolved by deleting and re-adding the source of an image to trick bookdown into re-rendering it
  • For images make sure to use following format to include alt text properly: <img alt="Alt Text" src="Path/URL to Image"> where "Path/URL to Image" takes the format "https://raw.githubusercontent.com/OWNER/REPO/gh-pages/PATH_TO_IMAGE_IN_REPO" or looks like "https://raw.githubusercontent.com/lzim/mtl/gh-pages/images/self_registration_login_screen.png"

    • ~Make sure to include "?raw=true" at the end of the url to just get the image and not the link to the image in GitHub~ Update: the "?raw=true" format was the cause of images sometimes failing to render. DO NOT USE THAT FORMAT.
    • Example: ~<img alt="An image of our registration page" src="https://github.com/lzim/mtl/blob/gh-pages/images/self_registration_popup_team_name.png?raw=true">~ <img alt="An image of our registration page" src="https://raw.githubusercontent.com/lzim/mtl/gh-pages/images/self_registration_popup_team_name.png">

fyi: @ljmoody

fyi: @jamesmrollins @ljmoody @lijenn @matthewtomo

#ADJUDICATE_MEMO