Skip to content

Commit 947822c

Browse files
authored
Merge pull request #55 from segmentio/install-premonition
add Premonition note blocks
2 parents 6a97ba8 + 8ce06c5 commit 947822c

File tree

7 files changed

+81
-1
lines changed

7 files changed

+81
-1
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ end
1313
group :jekyll_plugins do
1414
gem 'jekyll-sitemap'
1515
gem 'jekyll-redirect-from'
16+
gem "premonition", "~> 2.0.0"
1617
end
1718

1819
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ GEM
4848
multipart-post (2.1.1)
4949
pathutil (0.16.2)
5050
forwardable-extended (~> 2.6)
51+
premonition (2.0.0)
5152
public_suffix (3.1.1)
5253
rake (12.3.3)
5354
rb-fsevent (0.10.3)
@@ -77,6 +78,7 @@ DEPENDENCIES
7778
jekyll (~> 3.8.6)
7879
jekyll-redirect-from
7980
jekyll-sitemap
81+
premonition (~> 2.0.0)
8082
rake
8183
tzinfo (~> 1.2)
8284
tzinfo-data

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ Swiftype is set up as a script in `_layouts/default.html`
106106
We're using Rouge, set in the `_config.yml`. It's now default for Jekyll 3 and later, so 🎉.
107107
A list of the cues Rouge accepts can be found [here](https://github.com/rouge-ruby/rouge/wiki/list-of-supported-languages-and-lexers).
108108

109+
# Note Blocks
110+
We're using [Premonition](https://github.com/lazee/premonition) for our Note blocks. This is stock right now, with four styles: `note`, `info`, `warning`, and `error`. We might build more later.
111+
112+
You'd write a block like this:
113+
```md
114+
> warning "I am a warning"
115+
> The body of the warning goes here. Premonition allows you to write any `Markdown` inside the block.
116+
```
117+
109118

110119
# Frontmatter
111120

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ defaults:
2828
plugins:
2929
- jekyll-sitemap
3030
- jekyll-redirect-from
31+
- premonition
3132

3233
# Exclude from processing.
3334
# The following items will not be processed, by default. Create a custom list

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<meta class="swiftype" name="title" data-type="string" content="{{page.title}}" />
2626
<meta class="swiftype" name="priority" data-type="integer" content="2" />
2727
{% endif %}
28+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
2829

2930
<link rel="icon" sizes="192x192" href="https://segment.com/build/public/public/images/touch-icon.png">
3031
<link rel="apple-touch-icon" href="https://segment.com/build/public/public/images/touch-icon.png">

_sass/segment/_layout.scss

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,68 @@ footer > #data-collection a {
518518
margin-bottom: 0;
519519
}
520520
}
521+
522+
.premonition {
523+
$default-color: #5bc0de;
524+
$default-light-color: #e3edf2;
525+
$info-color: #50af51;
526+
$info-light-color: #f3f8f3;
527+
$warning-color: #f0ad4e;
528+
$warning-light-color: #fcf8f2;
529+
$error-color: #d9534f;
530+
$error-light-color: #fdf7f7;
531+
$content-color: rgba(0,0,0,0.5);
532+
533+
display: grid;
534+
grid-template-columns: 43px auto;
535+
padding-top: 13px;
536+
padding-bottom: 6px;
537+
margin: 30px 0 30px 0;
538+
background-color: $default-light-color;
539+
border-left: 4px solid $default-color;
540+
color: $default-color;
541+
542+
code {
543+
background-color: #fff;
544+
color: $default-color;
545+
}
546+
547+
.header {
548+
font-weight: 700;
549+
font-size: 15px;
550+
color: $default-color;
551+
}
552+
553+
.fa {
554+
font-size: 18px;
555+
opacity: .3;
556+
padding-top: 2px;
557+
padding-left: 20px;
558+
}
559+
560+
.content {
561+
color: $content-color;
562+
padding-right: 40px;
563+
}
564+
565+
@mixin box-type($c, $lc) {
566+
background-color: $lc;
567+
color: $c;
568+
border-color: $c;
569+
570+
a {
571+
color: $c;
572+
text-decoration: underline;
573+
}
574+
code {
575+
color: $c;
576+
}
577+
.header {
578+
color: $c;
579+
}
580+
}
581+
582+
&.info { @include box-type($info-color, $info-light-color); }
583+
&.warning { @include box-type($warning-color, $warning-light-color); }
584+
&.error { @include box-type($error-color, $error-light-color); }
585+
}

test.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ redirect_from:
1414
- /guides/testing
1515
---
1616

17+
> note "This is a note"
18+
> Some note text foo bar baz
1719
18-
{% include content/connection-modes.md %}
1920

2021
Welcome to the documentation test page!
2122

0 commit comments

Comments
 (0)