gh-cards 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b47409d11ef9ddeb07af9f1f71b33ebffb1f8dd5ccd579ba4100f58ca66db65b
4
- data.tar.gz: 21e69c6a6282fe57c3520ce17be96c2e2d1ad9a3d8d80758c44d4b469ff5799f
3
+ metadata.gz: 6b0d362fafa37f0704620fd5ec88669629f470882fd483ce8d613c675ced211a
4
+ data.tar.gz: 87f6f49a34655b7f240106544fd9b791c2428d4ba2350a2764103b59b7561ebc
5
5
  SHA512:
6
- metadata.gz: 9d002133e26ed5db39afa9bcab1070ee36dccf79c8ed5031c081c45b6b62ac71129b0126843d6ac7e6d3ff455608615a83797afbcce69a335de2f32dfb9cb360
7
- data.tar.gz: 666d1625fc9f4ab2f30043f70e0c89e3d757f0537c232bd0a99b7993d6e7bbb4fb50e7152bcb1deba3e93d773bbfb7f431cc8db071f6e7fb9e7071cd0bdd905e
6
+ metadata.gz: f6a9f07d6d822613913d0685c955f51330debced24f917b15621a4246af3d3a9b913333a94448a324683916abe5f977c5268ac1be4e6afc1b3f2238a5b60d160
7
+ data.tar.gz: 0b86645a00ce3a4547052bc11ee8b6ffa89da21258c06611ef39a91583f30925e47981c43c0a78c27e6f84b500d109a83ff8d600e288fffb8d9797dc97da7852
data/.gh-cards/cards.html CHANGED
@@ -11,17 +11,22 @@
11
11
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/font/octicons.min.css">
12
12
  <style>
13
13
  .card-deck .card {
14
- max-width: calc(33% - 30px);
14
+ max-width: calc(33% - 30px);
15
+ height: 350px;
16
+ }
17
+ @media print {
18
+ .row {
19
+ page-break-before: always;
20
+ }
15
21
  }
16
22
  </style>
17
23
  </head>
18
24
  <body>
19
25
  <div class="container">
20
- <div class="row">
26
+ <div class="row">
21
27
  <div class="col-12">
22
28
  <div class="card-deck">
23
29
 
24
-
25
30
  <div class="card">
26
31
  <div class="card-header">
27
32
  gh-cards
@@ -32,15 +37,11 @@
32
37
  <h6 class="text-secondary"><span class="octicon octicon-milestone" aria-hidden="true"></span>Test Milestone</h6>
33
38
  <br />
34
39
 
35
-
36
- <h6 class="text-secondary">Labels:</h6>
40
+ <h6 class="text-secondary">Labels:</h6>
37
41
  <div class="small text-secondary test-lowercase">
38
-
39
- bug<br />
40
-
41
- enhancement<br />
42
-
43
- good first issue<br />
42
+ bug<br />
43
+ enhancement<br />
44
+ good first issue<br />
44
45
 
45
46
  </div>
46
47
 
@@ -56,6 +57,7 @@
56
57
  </div>
57
58
  </div>
58
59
  </div>
60
+
59
61
  </div>
60
62
  </body>
61
63
  </html>
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- # 0.2.0
1
+ # 0.2.2
2
+
3
+ Update default template to page break sensibly
4
+
5
+ # 0.2.1
2
6
 
3
7
  General code cleanup
4
8
 
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Create HTML format cards from Github Issues for printing
4
4
 
5
+ ![Default Cards for Printing](https://user-images.githubusercontent.com/57101177/68775712-e0e74c00-0626-11ea-8087-51bb9e7cdfeb.png)
6
+
7
+
5
8
  ## Installation
6
9
 
7
10
  ```
@@ -1,5 +1,5 @@
1
1
  module Gh
2
2
  module Cards
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
data/lib/gh/cards.rb CHANGED
@@ -109,7 +109,7 @@ module Gh
109
109
  end
110
110
 
111
111
  puts "Generating cards using template: #{template}"
112
- erb = ERB.new(File.read(template_file))
112
+ erb = ERB.new(File.read(template_file), nil, '-')
113
113
  File.write("#{directory}/cards.html", erb.result(binding))
114
114
  end
115
115
  end
@@ -11,31 +11,38 @@
11
11
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/font/octicons.min.css">
12
12
  <style>
13
13
  .card-deck .card {
14
- max-width: calc(33% - 30px);
14
+ max-width: calc(33% - 30px);
15
+ height: 350px;
16
+ }
17
+ @media print {
18
+ .row {
19
+ page-break-before: always;
20
+ }
15
21
  }
16
22
  </style>
17
23
  </head>
18
24
  <body>
19
25
  <div class="container">
26
+ <% cards.each_slice(12) do |cardslice| -%>
20
27
  <div class="row">
21
28
  <div class="col-12">
22
29
  <div class="card-deck">
23
- <% cards.each_slice(3) do |slice| %>
24
- <% slice.each do |card| %>
30
+ <% cardslice.each_slice(3) do |slice| -%>
31
+ <%- slice.each do |card| %>
25
32
  <div class="card">
26
33
  <div class="card-header">
27
34
  <%= repo.split('/')[-1] %>
28
35
  </div>
29
36
  <div class="card-body">
30
- <h4 class="card-title"><span class="font-weight-bold">#<%= card[:number] %></span> <%= card[:title] %></h4>
37
+ <h4 class="card-title"><span class="font-weight-bold">#<%= card[:number] %></span> <%= card[:title].length > 40 ? card[:title][0, 80 - 3] + "..." : card[:title] %></h4>
31
38
  <% if card[:milestone] %>
32
39
  <h6 class="text-secondary"><span class="octicon octicon-milestone" aria-hidden="true"></span><%= card[:milestone] %></h6>
33
40
  <br />
34
41
  <% end %>
35
- <% if card[:labels].length > 0 %>
42
+ <% if card[:labels].length > 0 -%>
36
43
  <h6 class="text-secondary">Labels:</h6>
37
44
  <div class="small text-secondary test-lowercase">
38
- <% for label in card[:labels] %>
45
+ <% for label in card[:labels] -%>
39
46
  <%= label[:name] %><br />
40
47
  <% end %>
41
48
  </div>
@@ -52,6 +59,7 @@
52
59
  </div>
53
60
  </div>
54
61
  </div>
62
+ <% end %>
55
63
  </div>
56
64
  </body>
57
65
  </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh-cards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Birkett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-12 00:00:00.000000000 Z
11
+ date: 2019-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit