Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[queen-attack] SVG chess board #2284

Merged
merged 16 commits into from
Dec 13, 2023
Merged

Conversation

habere-et-dispertire
Copy link
Contributor

I'm unsure how best to use a text fallback in markdown so I reached for HTML. I started with picture and source but that appears to handle alternate image formats and sizes without a final text fallback.

I ended up duplicating it in a figcaption. Open to suggestions.

@habere-et-dispertire habere-et-dispertire requested a review from a team as a code owner June 5, 2023 11:27
@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Jun 5, 2023
@habere-et-dispertire habere-et-dispertire changed the title SVG chess board image with ASCII art fallback [queen-attack] SVG chess board Jun 5, 2023
@iHiD iHiD reopened this Jun 6, 2023
@iHiD
Copy link
Member

iHiD commented Jun 6, 2023

Thanks for this. I see it as an improvement. I'd like to remove the ascii-art altogether though. I don't see much reason to have both.

Files live in https://github.com/exercism/images/tree/main/images/exercises so this would need a PR there. The path would then be https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/.... See https://github.com/exercism/elixir/blob/main/exercises/concept/paint-by-number/.docs/instructions.md for an example

@habere-et-dispertire
Copy link
Contributor Author

habere-et-dispertire commented Jun 6, 2023

Thanks. Image uploaded :

exercism/images#12

I'll adjust this PR when I can reference the image.

@IsaacG
Copy link
Member

IsaacG commented Jun 6, 2023

Does this (base) image need need attributions/licensing, based on where it came from? Or is this all original work or work with matching licensing?

Note: I thought I already commented, but I don't see my prior comment.

@habere-et-dispertire
Copy link
Contributor Author

Does this (base) image need need attributions/licensing, based on where it came from? Or is this all original work or work with matching licensing?

Hello IsaacG, o/

Out of curiosity, where did the base image come from

Assembled by yours truly.
😀

and is there any licensing/copyright issues?

Tex and the packages used appear to be both published under terms of the LaTeX Project Public License. The main package is chessboard by Ulrike Fischer :

%% texlive/2023/texmf-dist/tex/latex/chessboard/chessboard.sty
%%
%% This file can be redistributed and/or modified under the terms of
%% the LaTeX Project Public License distributed from CTAN archives in
%% the directory macros/latex/base/lppl.txt; either version 1 of the
%% License, or (at your option) any later version.

Is an attribution needed?

I've added them to the description.md. Thank you for the reminder.

🏷 habere-et-dispertire

Note: I thought I already commented, but I don't see my prior comment.

Different repo : exercism/images#12

@ee7
Copy link
Member

ee7 commented Jun 10, 2023

The image looks nice, and seems like a good improvement when solving the exercise in the browser.

I'd like to remove the ascii-art altogether though. I don't see much reason to have both.

Does removing the ASCII board excessively hinder a CLI user? Do we have a policy for tradeoffs between browser and CLI users?

@habere-et-dispertire
Copy link
Contributor Author

My understanding is that screen readers don't do well with ASCII art. We should consider using aria-hidden="true" on all ASCII art ( ping @SleeplessByte ) :

<pre aria-hidden="true">
  0 1 2 3 4 5 6 7
0 - - * - - * - - 8
1 * - * - * - - - 7
2 - * * * - - - - 6
3 * * W * * * * * 5
4 - * * * - - - - 4
5 * - * - * - - - 3
6 - - * - - B - - 2
7 - - * - - - * - 1
  a b c d e f g h
</pre>

Exercism does not appear to provide PNG fallback for SVGs -- I imagine over concern with increased bandwidth.

Alternate representations can provide a layered understanding much like different approachs. With it we can "see" that g1 here is also a possible square to consider while not so in the proposed SVG.

One consideration which avoids a double depiction for sighted users is to put the ASCII art behind a <detail> . lynx automatically shows me just the ASCII art then :

<figure>
    <picture>
        <source srcset="queen-capture.svg" type="image/svg+xml">
        <source srcset="queen-capture.png" type="image/png">
        <img src="queen-capture.svg" alt="">
    </picture>

    <figcaption>A chessboard with two queens. Lines emanating from the queen at <var>c5</var> indicate possible directions of capture along file, rank and diagonal.
        <details>
            <summary>Alternate chessboard as ASCII art</summary>
            <pre aria-hidden="true">
  0 1 2 3 4 5 6 7
0 - - * - - * - - 8
1 * - * - * - - - 7
2 - * * * - - - - 6
3 * * W * * * * * 5
4 - * * * - - - - 4
5 * - * - * - - - 3
6 - - * - - B - - 2
7 - - * - - - * - 1
  a b c d e f g h</pre>
        </details>
    </figcaption>
</figure>

@habere-et-dispertire
Copy link
Contributor Author

CC @exercism/reviewers

@IsaacG IsaacG merged commit eec49c8 into exercism:main Dec 13, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants