tikz-gallery-generator

Custum build of stapix for tikz.pablopie.xyz

Commit
eac829ed8c87322ec8b7f59cdb1daaa3cdba0fa1
Parent
c088cc722558075ae9eb80877604784a866ed07d
Author
Pablo <pablo-escobar@riseup.net>
Date

Added an aria-label to the figures in the gallery

See https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Text_labels_and_names#figures_with_optional_captions_should_be_labeled for further details

Diffstat

1 file changed, 3 insertions, 3 deletions

Status File Name N° Changes Insertions Deletions
Modified src/main.rs 6 3 3
diff --git a/src/main.rs b/src/main.rs
@@ -1,6 +1,5 @@
 use crossterm::style::Stylize;
-use image::io::Reader as ImageReader;
-use image::DynamicImage;
+use image::{DynamicImage, io::Reader as ImageReader};
 use std::{
     env,
     fmt::{self, Display},
@@ -322,7 +321,8 @@ fn render_pic_page(pic: &Picture) -> io::Result<()> {
     write_nav(&mut f)?;
 
     writeln!(f, "<main>")?;
-    writeln!(f, "<figure>")?;
+    writeln!(f, "<figure aria-label=\"{name}\">",
+             name = Escaped(&pic.file_name))?;
     writeln!(f, "<div id=\"picture-container\">")?;
     writeln!(
         f,