Fix images and alt tags, fix #621, fix #622

- Change all `.. figure::` elements to `.. image::`
- Add empty `:alt:` so it is clear to screen readers that the images are decorative and don’t duplicate content
- Update styleguide with that info

Signed-off-by: Jan C. Borchardt <hey@jancborchardt.net>
This commit is contained in:
Jan C. Borchardt
2021-04-15 20:18:39 +02:00
parent 0a3465200b
commit 444d91253e
65 changed files with 999 additions and 839 deletions

View File

@@ -104,7 +104,7 @@ foreach($icons as $class => $icon) {
$outPath = $destinationDirectory . 'img/' . $path . '.png';
// filling the rst file
$rst .= ".. figure:: img/$path.*\n";
$rst .= ".. image:: img/$path.*\n";
if ($isWhite) {
$rst .= " :class: white-icon\n";
}
@@ -118,7 +118,7 @@ foreach($icons as $class => $icon) {
print(" - creating dir $dir \n");
mkdir($dir, 0777, true);
}
// ! can't use svg in rst
// copy original icon
// if (!@copy($sourceDirectory . $icon . '.svg', $destinationDirectory . 'img/' . $path . '.svg')) {
@@ -159,7 +159,5 @@ print(" - done! \n");
// path = path.split('/')
// localpath = '/'.join(path[3:5])
// result += ".. figure:: img/" + localpath + ".*\n :height: 32\n :width: 32\n\n " + icon[1:] + "\n\n"
// result += ".. image:: img/" + localpath + ".*\n :height: 32\n :width: 32\n\n " + icon[1:] + "\n\n"
// os.system('inkscape -z img/' + localpath + '.svg -e img/' + localpath + '.png')