Closed schanzer closed 1 year ago
@schanzer nudging you to add the following to the spec above:
@ds26gte please implement this on the image
branch so that I can confirm that my changes are working as expected. Thanks!
@retabak @schanzer
@schanzer is it intentional that the page "Do NYC Schools reflect the City's diversity?" was removed from the bar and pie chart lesson?
Ninja Cat Images created for Bootstrap by Colleen Murphy
@schanzer Flagging that the coordinates lesson includes images that are linked to with @link… not sure how this will work with the image infrastructure. Seems these could be pdfs instead of pngs linked to with @handout?
@flannery-denny good call! I've implemented that change and pushed.
@schanzer There are sometimes images that only exist in slides. Do we want to describe them, too? for an example, see functions for character animation, which only has one image, and it's only used in slides.
@flannery-denny No need to describe them (this includes china-code.png in the defining values lesson)
Does that mean we should leave them out of lesson-images.json
or make a commented section of that file that says images only used in slides
or list them in the file with "slides"
in the 3 required fields?
Leave them out.
(Also FYI - you can't add comments to a .json
file)
@ds26gte
Thanks for volunteering to populate lesson-images.json
files from information in the @image
directives in lesson plans and workbook pages.
Any image created by us can get the following attribution.
"source" : "Created by the Bootstrap Team" "license" : "Creative Commons 4.0 - NC - SA"
Please do not fill in bogus information for images that we did not create, such as images of food in @schanzer's combinatorics lesson.
Please reach out for help if you run into stuff that feels unclear!
@schanzer Thanks for agreeing to take on the computing needs all voices lesson. Encouraging you to also look at the comments I made in the comment with the checkboxes above about images I had questions about the provenance of, as I expect Dorai will also not know what to do about them.
@schanzer @ds26gte Had a chance to check out the image
branch.
Here are some things I have questions about:
"dollar-infographic-mona-chalabi.png" : { "caption" : "Made by Data Designer @link{https://www.instagram.com/monachalabi/, Mona Chalabi}", "description" : "Infographic: For every dollar a white man earns... visual shows parts of dollar bills corresponding to the comparable earning of other groups including (from highest to lowest earnings): Asian Men, Asian Women, White Women, Black Men, Native American Men, Black Women, Hispanic Men, Native American Women, Hispanic Women", "source" : "https://www.instagram.com/monachalabi/", "license" : "Used with permission from the creator." },
"ethics-privacy-and-bias": { "AtomicBomb.png" : { "caption" : "", "description" : "Mushroom cloud from an atomic bomb", "source" : "", "license" : "" }
images.js
file gets built from other files, which means it's pointless for authors to edit it. Can we make that clear within the file somehow? I found myself feeling tempted to fix things when I looked at it.@ds26gte before we close this issue, let's add something about these files to the README doc, including wording standards for authors.
The Problem
Demands on our use of images have grown a LOT since 2020:
Dorai has heroically extended the
@image{...}
directive with optional arguments this whole time. But each argument adds a layer of complexity and an opportunity for mistakes. (QUICK! What is the size and description of the following image:@image{images/box-n-whisker-plot.png, 300, "A sample box-and-whisker plot"}
-- lmfao no ur wrong the caption is "300" silly!)We've also accumulated some technical debt, with zero standardization on where image files live within a lesson. Sometimes they're in a dedicated
images/
directory, but sometimes they're in thepages/
directory. And sometimes they're in both!With the addition of image citations coming down the pike in 2023, it's time to address this problem.
Proposed Solution
images
folder within the lesson plan (just like thepages
directory).lesson-images.json
file, which acts as a dictionary for all the relevant lesson information@image
directives include nothing more than the image path and (optionally) the size of the image. For example:@image{image1.png, 300}
would yield the following HTML:With this implementation, we can use CSS to ensure that empty captions aren't rendered. Screenreaders will always vocalize using the label first, then the description. Visually-impaired users will hear "distribution of US Income in 2003, a box plot showing a right skew". Sighted users will see the image, with the text "distribution of US Income in 2003, retrieved from data.gov on April 15th, 2022".
When including an image, we can just use the standard @image tag, with arguments solely for filename and size. The build script can compare the filename to the dictionary, and include proper captions, alt text, etc. It can also produce a warning if an image isn't in the dictionary. And finally, it could combine all the dictionaries into a single citation page for each pathway, allowing us to show exactly where every piece of media we use came from.
This has the benefit of backwards-compatibility: none of the existing @image tags need to change. Everything will still work! Over time, we can move all the captions out of those tags and into these dictionaries.