middleman-hashicorp 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -2
- data/assets/stylesheets/hashicorp/anchor-links.scss +36 -0
- data/assets/stylesheets/hashicorp/mega-nav.scss +23 -3
- data/lib/middleman-hashicorp/partials/_mega.html.erb +1 -1
- data/lib/middleman-hashicorp/redcarpet.rb +24 -0
- data/lib/middleman-hashicorp/version.rb +1 -1
- data/spec/unit/markdown_spec.rb +13 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6e17a35054d12adb10150112bfd766bb05a9323
|
4
|
+
data.tar.gz: 660989c15ec9ecbba9f4fd5b6b4a28fe428bda60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad92925188ac51058bda123c4a0a325e283751239ebc6458d50dd78dfe1e9c7ce71f92706e77c918d3b23db9a7bf9f19a541a65e3d06b857e1d9245de43b1916
|
7
|
+
data.tar.gz: b277f0f8232673bf60ee1a29ed9e9375eec223f52cffa2112a745c64a9328c5fe83119f3bb6d6d2b1319f334c6fc4f441307ba6a20f3ba21e6166e49fdb95cab
|
data/README.md
CHANGED
@@ -67,7 +67,7 @@ Customizations
|
|
67
67
|
- During build, assets are hashed
|
68
68
|
- During build, gzipped assets are also created
|
69
69
|
|
70
|
-
### IE Compatibility
|
70
|
+
### IE Compatibility
|
71
71
|
|
72
72
|
There are bundled things that make IE behave nicely. Include them like this:
|
73
73
|
|
@@ -145,7 +145,7 @@ This extension extends the redcarpet markdown processor to add some additional f
|
|
145
145
|
In addition to "standard markdown", the custom markdown parser supports the following:
|
146
146
|
|
147
147
|
#### Auto-linking Anchor Tags
|
148
|
-
|
148
|
+
Since the majority of HashiCorp's projects use the following syntax to define APIs, this extension automatically converts those to named anchor links:
|
149
149
|
|
150
150
|
```markdown
|
151
151
|
- `api_method` - description
|
@@ -159,6 +159,15 @@ Outputs:
|
|
159
159
|
</ul>
|
160
160
|
```
|
161
161
|
|
162
|
+
#### Auto-linking Header Tags
|
163
|
+
|
164
|
+
Header links will automatically generate linkable hrefs on hover. This can be used to easily link to sub-sections of a page. This _requires_ the following SCSS.
|
165
|
+
|
166
|
+
```scss
|
167
|
+
// assets/stylesheets/application.scss
|
168
|
+
@import 'hashicorp/anchor-links'
|
169
|
+
```
|
170
|
+
|
162
171
|
Any special characters are converted to an underscore (`_`).
|
163
172
|
|
164
173
|
#### Recursive Markdown Rendering
|
@@ -0,0 +1,36 @@
|
|
1
|
+
//
|
2
|
+
// Anchor links must be included to hide/auto-show anchor links.
|
3
|
+
//
|
4
|
+
|
5
|
+
h1 {
|
6
|
+
.anchor {
|
7
|
+
display: none;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
h2,
|
12
|
+
h3,
|
13
|
+
h4,
|
14
|
+
h5,
|
15
|
+
h6 {
|
16
|
+
.anchor {
|
17
|
+
color: inherit !important;
|
18
|
+
float: left;
|
19
|
+
margin-left: -15px;
|
20
|
+
padding-right: 5px;
|
21
|
+
line-height: 1.1;
|
22
|
+
text-decoration: none !important;
|
23
|
+
visibility: hidden;
|
24
|
+
|
25
|
+
&:focus {
|
26
|
+
outline: none;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
&:hover {
|
31
|
+
.anchor {
|
32
|
+
text-decoration: none !important;
|
33
|
+
visibility: visible;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -110,6 +110,16 @@ $mega-nav-sandbox-specificity: 4;
|
|
110
110
|
color: $mega-nav-color-neutral;
|
111
111
|
}
|
112
112
|
|
113
|
+
.mega-nav-banner-logo {
|
114
|
+
opacity: 1;
|
115
|
+
|
116
|
+
&:hover {
|
117
|
+
opacity: 0.7;
|
118
|
+
transition: opacity .25s ease-in-out;
|
119
|
+
-moz-transition: opacity .25s ease-in-out;
|
120
|
+
-webkit-transition: opacity .25s ease-in-out;
|
121
|
+
}
|
122
|
+
}
|
113
123
|
}
|
114
124
|
|
115
125
|
.mega-nav-banner-item {
|
@@ -201,8 +211,16 @@ $mega-nav-sandbox-specificity: 4;
|
|
201
211
|
justify-content: center;
|
202
212
|
line-height: 1;
|
203
213
|
margin-left: 0.3em;
|
214
|
+
outline: none;
|
204
215
|
padding: 0.5em;
|
205
216
|
text-align: center;
|
217
|
+
|
218
|
+
&:active,
|
219
|
+
&:focus,
|
220
|
+
&:hover,
|
221
|
+
&:visited {
|
222
|
+
outline: none;
|
223
|
+
}
|
206
224
|
}
|
207
225
|
|
208
226
|
.mega-nav-body-ct {
|
@@ -528,16 +546,18 @@ $mega-nav-sandbox-specificity: 4;
|
|
528
546
|
.mega-nav-btn {
|
529
547
|
width: auto;
|
530
548
|
}
|
531
|
-
|
532
549
|
}
|
533
550
|
|
534
|
-
|
535
|
-
|
551
|
+
// Display HashiCorp logo at Bootstrap breakpoint of 768px
|
552
|
+
@media (min-width: 768px){
|
536
553
|
.mega-nav-banner-item {
|
537
554
|
&:first-child {
|
538
555
|
display: block;
|
539
556
|
}
|
540
557
|
}
|
558
|
+
}
|
559
|
+
|
560
|
+
@media (min-width: $mega-nav-breakpoint-md) {
|
541
561
|
|
542
562
|
.mega-nav {
|
543
563
|
position: relative;
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<div class="mega-nav-banner">
|
13
13
|
<div class="container">
|
14
14
|
<div class="mega-nav-banner-item">
|
15
|
-
<img src="<%= image_path("mega-nav/logo-hashicorp-wordmark.svg") %>" alt="HashiCorp Logo"
|
15
|
+
<a class="mega-nav-banner-logo" href="https://www.hashicorp.com"><img src="<%= image_path("mega-nav/logo-hashicorp-wordmark.svg") %>" alt="HashiCorp Logo" /></a>
|
16
16
|
</div>
|
17
17
|
<div class="mega-nav-banner-item">
|
18
18
|
<p class="mega-nav-tagline"><span class="visible-xs text-muted">Learn the</span><span class="hidden-xs text-muted">Learn how <%= product.titleize %> fits into the</span> <img src="<%= image_path("mega-nav/logo-hashicorp.svg") %>" alt="HashiCorp Logo" /> <strong>HashiCorp Suite</strong></p>
|
@@ -21,6 +21,30 @@ class Middleman::HashiCorp::RedcarpetHTML < ::Middleman::Renderers::MiddlemanRed
|
|
21
21
|
super(options.merge(REDCARPET_OPTIONS))
|
22
22
|
end
|
23
23
|
|
24
|
+
#
|
25
|
+
# Override headers to add custom links.
|
26
|
+
#
|
27
|
+
def header(title, level)
|
28
|
+
@headers ||= {}
|
29
|
+
|
30
|
+
name = title.downcase.strip.gsub(/\W+/, '-').gsub(/\A\-/, '')
|
31
|
+
|
32
|
+
i = 0
|
33
|
+
permalink = name
|
34
|
+
while @headers.key?(permalink) do
|
35
|
+
i += 1
|
36
|
+
permalink = "#{name}-#{i}"
|
37
|
+
end
|
38
|
+
@headers[permalink] = true
|
39
|
+
|
40
|
+
return <<-EOH.gsub(/^ {6}/, "")
|
41
|
+
<h#{level} id="#{permalink}">
|
42
|
+
<a name="#{permalink}" class="anchor" href="##{permalink}">»</a>
|
43
|
+
#{title}
|
44
|
+
</h#{level}>
|
45
|
+
EOH
|
46
|
+
end
|
47
|
+
|
24
48
|
#
|
25
49
|
# Override list_item to automatically add links for documentation
|
26
50
|
#
|
data/spec/unit/markdown_spec.rb
CHANGED
@@ -202,11 +202,21 @@ module Middleman::HashiCorp
|
|
202
202
|
markdown = <<-EOH.gsub(/^ {8}/, "")
|
203
203
|
# Hello World
|
204
204
|
## Subpath
|
205
|
+
## Subpath
|
205
206
|
EOH
|
206
207
|
output = <<-EOH.gsub(/^ {8}/, "")
|
207
|
-
<h1 id="hello-world">
|
208
|
-
|
209
|
-
|
208
|
+
<h1 id="hello-world">
|
209
|
+
<a name="hello-world" class="anchor" href="#hello-world">»</a>
|
210
|
+
Hello World
|
211
|
+
</h1>
|
212
|
+
<h2 id="subpath">
|
213
|
+
<a name="subpath" class="anchor" href="#subpath">»</a>
|
214
|
+
Subpath
|
215
|
+
</h2>
|
216
|
+
<h2 id="subpath-1">
|
217
|
+
<a name="subpath-1" class="anchor" href="#subpath-1">»</a>
|
218
|
+
Subpath
|
219
|
+
</h2>
|
210
220
|
EOH
|
211
221
|
|
212
222
|
expect(markdown).to render_html(output)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-hashicorp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Vargo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- assets/javascripts/ie-compat/html5shiv.js
|
198
198
|
- assets/javascripts/ie-compat/respond.js
|
199
199
|
- assets/javascripts/jquery.js
|
200
|
+
- assets/stylesheets/hashicorp/anchor-links.scss
|
200
201
|
- assets/stylesheets/hashicorp/mega-nav.scss
|
201
202
|
- docker/Dockerfile
|
202
203
|
- docker/entrypoint.sh
|
@@ -233,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
234
|
version: '0'
|
234
235
|
requirements: []
|
235
236
|
rubyforge_project:
|
236
|
-
rubygems_version: 2.
|
237
|
+
rubygems_version: 2.5.2
|
237
238
|
signing_key:
|
238
239
|
specification_version: 4
|
239
240
|
summary: A series of helpers for consistency among HashiCorp's middleman sites
|