-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify many notice styles to a single include
And update the documentation accordingly. See #35.
- Loading branch information
Showing
88 changed files
with
405 additions
and
533 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{%- comment -%} | ||
Adds a stylized notice. | ||
{%- endcomment -%} | ||
|
||
{%- assign content = include.content | markdownify -%} | ||
{%- assign icon = include.icon -%} | ||
{%- assign glyph = include.glyph -%} | ||
{%- assign glyph-classes = include.class | default: "" -%} | ||
{%- assign background-color = include.background-color -%} | ||
{%- assign highlight-color = include.highlight-color -%} | ||
|
||
{%- comment -%} Infer glyph from common icons. {%- endcomment -%} | ||
{%- unless glyph -%} | ||
{%- capture glyph -%} | ||
{%- case icon -%} | ||
{%- when "tip" -%} 💡 | ||
{%- endcase -%} | ||
{%- endcapture -%} | ||
{%- endunless -%} | ||
|
||
{%- comment -%} Infer background color from common icons. {%- endcomment -%} | ||
{%- unless background-color -%} | ||
{%- capture background-color -%} | ||
{%- case icon -%} | ||
{%- when "info" -%} #ebf2f8 | ||
{%- when "tip" -%} #dedede | ||
{%- when "warning" -%} #ffcccb | ||
{%- else -%} #e6e6e6 | ||
{%- endcase -%} | ||
{%- endcapture -%} | ||
{%- endunless -%} | ||
|
||
{%- comment -%} Infer highlight color from common icons. {%- endcomment -%} | ||
{%- unless highlight-color -%} | ||
{%- capture highlight-color -%} | ||
{%- case icon -%} | ||
{%- when "android" -%} #a4c639 | ||
{%- when "fiji" -%} #65a4e3 | ||
{%- when "imagej" -%} #fadd8d | ||
{%- when "imagej1" -%} #fadd8d | ||
{%- when "imagej2" -%} #fadd8d | ||
{%- when "info" -%} #67a1fe | ||
{%- when "linux" -%} black | ||
{%- when "tech" -%} #bdbdbd | ||
{%- when "tip" -%} #7e7e7e | ||
{%- when "warning" -%} #f57900 | ||
{%- when "windows" -%} #00adef | ||
{%- else -%} gold | ||
{%- endcase -%} | ||
{%- endcapture -%} | ||
{%- endunless -%} | ||
|
||
<div class="notice" style="background: {{background-color}}; border-left: 10px solid {{highlight-color}}"> | ||
{%- if glyph != "" or glyph-classes != "" -%} | ||
<div class="notice-icon"><span class="{{glyph-classes}}">{{glyph}}</span></div> | ||
{%- elsif icon and icon != "" -%} | ||
{%- capture src -%} {%- include util/find-icon path=icon -%} {%- endcapture -%} | ||
{%- assign extension = src | slice: -4, 4 | downcase -%} | ||
{%- if extension == '.svg' -%} | ||
{%- comment -%} Vector images need an explicit width. {%- endcomment -%} | ||
<div class="notice-icon"><img src="{{src}}" width="32"></div> | ||
{%- else -%} | ||
<div class="notice-icon"><img src="{{src}}"></div> | ||
{%- endif -%} | ||
{%- endif -%} | ||
<div class="notice-content">{{content}}</div> | ||
</div> | ||
|
||
{%- comment -%} | ||
# vi:syntax=liquid | ||
{%- endcomment -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{% include warning-box content="This page or section is a WORK IN PROGRESS, and still unfinished!" %} | ||
{% include notice icon="warning" content="This page or section is a WORK IN PROGRESS, and still unfinished!" %} | ||
|
||
{%- comment -%} | ||
# vi:syntax=liquid | ||
{%- endcomment -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.