middleman-hashicorp 0.3.13 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fd56a22a40b1ad7c4f7b07e8acf0c41aeabfe85
4
- data.tar.gz: 439ba649970686c407027c2bb4bc5533e21078d7
3
+ metadata.gz: c6e17a35054d12adb10150112bfd766bb05a9323
4
+ data.tar.gz: 660989c15ec9ecbba9f4fd5b6b4a28fe428bda60
5
5
  SHA512:
6
- metadata.gz: dd2ef764799095db9ebcc13266f1c7cd0d00709b3e8b6f47fb2263e9783daaba7e0efe91abd16a6d4f37e706d3977ca59d55c04bedf0609d8ae4f62892c77d00
7
- data.tar.gz: 67b6d40035aaeadbe730ffb5ec7f31b0dd2cd53215cc7d92b06c109024619609c31165d4ed1139906bd1bc9e42ef67873f517f24557fe9e686501ef536a3d202
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
- Sine the majority of HashiCorp's projects use the following syntax to define APIs, this extension automatically converts those to named anchor links:
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
- @media (min-width: $mega-nav-breakpoint-md) {
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}">&raquo;</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
  #
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module HashiCorp
3
- VERSION = "0.3.13"
3
+ VERSION = "0.3.14"
4
4
  end
5
5
  end
@@ -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">Hello World</h1>
208
-
209
- <h2 id="subpath">Subpath</h2>
208
+ <h1 id="hello-world">
209
+ <a name="hello-world" class="anchor" href="#hello-world">&raquo;</a>
210
+ Hello World
211
+ </h1>
212
+ <h2 id="subpath">
213
+ <a name="subpath" class="anchor" href="#subpath">&raquo;</a>
214
+ Subpath
215
+ </h2>
216
+ <h2 id="subpath-1">
217
+ <a name="subpath-1" class="anchor" href="#subpath-1">&raquo;</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.13
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-08 00:00:00.000000000 Z
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.6.10
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