Update label syntax #1914

Merged
jonah merged 10 commits from better-badges into master 2020-05-14 13:18:37 +00:00
Owner

Completely changes badges, so now I have to go through and swap them all out.

New syntax will in theory look like:

    labels="color==warning::link==https://rocket.chat/docs/user-guides/end-to-end-encryption/::text==Experimental E2EE::tooltip==Regarding E2EE their documentation states 'This feature is currently in alpha. It's also not yet supported on mobile'. There is no forward secrecy so compromised decryption password would leak all messages. Federation was also added afterwards, potentially causing room for mistakes.|color==success::VoIP"

Instead of the old syntax (for comparison)

    labels="warning:<a href=//rocket.chat/docs/user-guides/end-to-end-encryption/>Experimental E2EE</a>:Regarding E2EE their documentation states 'This feature is currently in alpha. It's also not yet supported on mobile'. There is no forward secrecy so compromised decryption password would leak all messages. Federation was also added afterwards, potentially causing room for mistakes.|success:VoIP"
labels="color==[color]::link==[link]::text==<text>::icon==[icon]::tooltip==[tooltip]|color==[color]::link==[link]::text==<text>::icon==[icon]::tooltip==[tooltip]"

Color: optional, defaults to info
Link: optional external link
Text: required actually this should be optional now, if we want icon-only badges
Icon: optional, defaults to far fa-question-circle for labels with tooltips, fas fa-external-link-alt for links (without tooltips), and disabled for labels without tooltips or links
Tooltip: optional, provides hover text

Separator between labels: |
Separators between attributes: :: (changed so that we can use https:// in a label despite it having a :)
Separator between attribute keys and values: ==


This PR also adds badge.html to _includes, which can be used like this anywhere, so we can get the non-cardv2 badges switched as well.

{% include badge.html
link=link
color=color
text=text
icon=icon
tooltip=tooltip
%}
_Completely_ changes badges, so now I have to go through and swap them all out. New syntax will in theory look like: ``` labels="color==warning::link==https://rocket.chat/docs/user-guides/end-to-end-encryption/::text==Experimental E2EE::tooltip==Regarding E2EE their documentation states 'This feature is currently in alpha. It's also not yet supported on mobile'. There is no forward secrecy so compromised decryption password would leak all messages. Federation was also added afterwards, potentially causing room for mistakes.|color==success::VoIP" ``` Instead of the old syntax (for comparison) ``` labels="warning:<a href=//rocket.chat/docs/user-guides/end-to-end-encryption/>Experimental E2EE</a>:Regarding E2EE their documentation states 'This feature is currently in alpha. It's also not yet supported on mobile'. There is no forward secrecy so compromised decryption password would leak all messages. Federation was also added afterwards, potentially causing room for mistakes.|success:VoIP" ``` ``` labels="color==[color]::link==[link]::text==<text>::icon==[icon]::tooltip==[tooltip]|color==[color]::link==[link]::text==<text>::icon==[icon]::tooltip==[tooltip]" ``` **Color**: optional, defaults to info **Link**: optional external link **Text**: ~~required~~ actually this should be optional now, if we want icon-only badges **Icon**: optional, defaults to `far fa-question-circle` for labels with tooltips, `fas fa-external-link-alt` for links (without tooltips), and disabled for labels without tooltips or links **Tooltip**: optional, provides hover text Separator between labels: `|` Separators between attributes: `::` (changed so that we can use `https://` in a label despite it having a `:`) Separator between attribute keys and values: `==` --- This PR also adds `badge.html` to `_includes`, which can be used like this *anywhere*, so we can get the non-cardv2 badges switched as well. ``` {% include badge.html link=link color=color text=text icon=icon tooltip=tooltip %} ```
dngray (Migrated from github.com) approved these changes 2020-05-14 13:00:04 +00:00
dngray (Migrated from github.com) left a comment
Author
Owner

Had a good look in a local build at all pages.

I don't think you've missed anything that I could see.

I wonder if at some point we could use this in some way instead for warnings next to worth mentioning recommendations etc or should we do something like this?

Had a good look in a local build at all pages. I don't think you've missed anything that I could see. I wonder if at some point we could use this in some way instead for warnings next to worth mentioning recommendations etc or should we do something [like this](https://getbootstrap.com/docs/4.4/components/badge/#links)?
blacklight447 (Migrated from github.com) approved these changes 2020-05-14 13:02:32 +00:00
This repo is archived. You cannot comment on pull requests.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: privacyguides/privacytools.io#1914
No description provided.