InseeFr / Lunatic

Library of questionnaire components
https://inseefr.github.io/Lunatic/
MIT License
20 stars 21 forks source link

Label: replace with an image ? #237

Closed AnneHuSKa closed 4 months ago

AnneHuSKa commented 2 years ago

For Business Outlook Surveys, most of the labels are replaced by arrows. In DDI, we have for instance :

<l:Generation>
 <r:OtherMaterial>
  <r:Agency>fr.insee</r:Agency> <r:ID>INSEE-COMMUN-OM-hausse_stable_baisse-3</r:ID>
<r:Version>1</r:Version>
<r:TypeOfMaterial controlledVocabularyID="INSEE-TOM-CV">image</r:TypeOfMaterial>
<r:ExternalURLReference>stable.jpg</r:ExternalURLReference></r:OtherMaterial>
</l:Generation> 

What can be done in Lunatic ?

romaintailhurat commented 1 year ago

We are using https://github.com/remarkjs/react-markdown for parsing markdown in Lunatic. This lib is based on remark which enables the use of plugins.

So, we could use for example https://github.com/rhysd/remark-emoji to produce "images".

A emblematic use case is the use of ↗️ , ➡️ and ↘️ in forecast surveys, which would be supported out-of-the-box. 😄

ddecrulle commented 1 year ago

And if you want some other picture, use markdown syntaxe ![](links)

romaintailhurat commented 1 year ago

Yes, we talked about this possibility on a previous occasion, but the logistics are more complicated.

Here, using emojis means a self sustained solution.

ddecrulle commented 1 year ago

We have revert this feature due to a technical issue

Grafikart commented 4 months ago

It is fixed for v3.0