=== User story
If a user wants to print a URL onto business cards or poster they may want a QR code in addition to a short URL. This could happen automatically.
=== Acceptance Criteria
* code goes in the UrlShortener extension
* add a "Download QR code" link to the toolbox which will download an SVG
** Use the [[ https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/download | download ]] property (?)
** //Deduced from reading the designs:// In the [[ https://www.mediawiki.org/wiki/Extension:Collection | Collection extension ]], rename the "Print/export" heading to "Print/export/share" and put the "Download QR code" link under it (?)
* Use [[ https://github.com/endroid/qr-code | endroid/qr-code ]] to generate the QR codes server-side
** It was noted that it's cheaper to send the QR code than the JavaScript module to generate it
** Requires security review and addition to mediawiki/libs repo (?)
* if the URL is very long (//how long?//), generate a short URL first so that the QR code isn't too high of density
* Add an API endpoint to get the QR code. This could accept a format of PNG or SVG, as the library provides
* Also show SVG of QR code at Special:UrlShortener (?)
=== Design
{F37105021}
{F37105060}
| [[ https://www.figma.com/file/NxqZiyHD6o2DrajNKdItEs/QR-code---T329973?type=design&node-id=2970-26223 | Design proposal in this Figma file ]] |