showcase-rails 0.2.6 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/app/assets/builds/showcase.css +19 -19
- data/app/assets/builds/showcase.highlights.css +115 -0
- data/app/views/layouts/showcase.html.erb +1 -0
- data/app/views/showcase/engine/_head.html.erb +2 -0
- data/app/views/showcase/engine/_javascripts.html.erb +1 -1
- data/app/views/showcase/engine/_root.html.erb +3 -1
- data/app/views/showcase/engine/_sample.html.erb +8 -6
- data/app/views/showcase/engine/_stylesheets.html.erb +1 -1
- data/app/views/showcase/engine/index.html.erb +3 -0
- data/app/views/showcase/engine/path/_path.html.erb +1 -1
- data/lib/showcase/route_helper.rb +6 -3
- data/lib/showcase/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03270bcd056181e09393db4fb8c701fb082e41d3c30ed2ec00b82004e8c967a6
|
4
|
+
data.tar.gz: d762aea659bfd35a7b7a14126976d8bd56f9edf0ff8a8399e882b37907cbd4c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7a642d7d0f7bf5dc52cf290116b566f81206650bdbd3880bbee20aefebb83edead2b4688abbc3ae376a89e6a63913880e8be51c908133c4bb4823ce3c2ddd89
|
7
|
+
data.tar.gz: 9ce4be151434d49e3a6acc329cf6c8765786844855fd00319b33ac48fe301bdf6609989acd44e16c72174bbc09a3774a4a736c18d79ef9e4a33acf6ebd76aaa2
|
data/README.md
CHANGED
@@ -157,12 +157,16 @@ Showcase bundles its own `showcase.js`, `showcase.css` and `showcase.highlights.
|
|
157
157
|
Action View's [javascript_include_tag][] and [stylesheet_link_tag][].
|
158
158
|
|
159
159
|
If your assets require more sophisticated loading techniques, declare your own
|
160
|
-
|
160
|
+
version of the [showcase/engine/_head.html.erb][] partial.
|
161
|
+
|
162
|
+
If you need to tweak showcase's assets, declare your own versions of
|
163
|
+
the [showcase/engine/_javascripts.html.erb][] and
|
161
164
|
[showcase/engine/_stylesheets.html.erb][] partials. When customizing those
|
162
165
|
partials, make sure to include `"showcase"` in your list of assets.
|
163
166
|
|
164
167
|
[javascript_include_tag]: https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-javascript_include_tag
|
165
168
|
[stylesheet_link_tag]: https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-stylesheet_link_tag
|
169
|
+
[showcase/engine/_head.html.erb]: ./showcase/engine/_head.html.erb
|
166
170
|
[showcase/engine/_javascripts.html.erb]: ./showcase/engine/_javascripts.html.erb
|
167
171
|
[showcase/engine/_stylesheets.html.erb]: ./showcase/engine/_stylesheets.html.erb
|
168
172
|
|
@@ -173,7 +177,7 @@ By default, Showcase's syntax highlighting runs on Rouge's "github" theme.
|
|
173
177
|
To use a different theme, override [showcase/engine/_stylesheets.html.erb][] with the following, replacing `:magritte` with a [valid theme](rouge-themes):
|
174
178
|
|
175
179
|
```erb
|
176
|
-
<%= stylesheet_link_tag "
|
180
|
+
<%= stylesheet_link_tag "showcase" %> # We've removed the default showcase.highlights file here.
|
177
181
|
<%= tag.style Rouge::Theme.find(:magritte).render(scope: ".sc-highlight") %>
|
178
182
|
```
|
179
183
|
|
@@ -727,8 +727,8 @@ select {
|
|
727
727
|
height: 100%;
|
728
728
|
}
|
729
729
|
|
730
|
-
.sc-max-h-
|
731
|
-
max-height:
|
730
|
+
.sc-max-h-48 {
|
731
|
+
max-height: 12rem;
|
732
732
|
}
|
733
733
|
|
734
734
|
.sc-min-h-screen {
|
@@ -800,6 +800,10 @@ select {
|
|
800
800
|
margin-bottom: calc(2rem * var(--tw-space-y-reverse));
|
801
801
|
}
|
802
802
|
|
803
|
+
.sc-overflow-clip {
|
804
|
+
overflow: clip;
|
805
|
+
}
|
806
|
+
|
803
807
|
.sc-overflow-scroll {
|
804
808
|
overflow: scroll;
|
805
809
|
}
|
@@ -826,27 +830,19 @@ select {
|
|
826
830
|
border-radius: 0.375rem;
|
827
831
|
}
|
828
832
|
|
829
|
-
.sc-rounded-
|
830
|
-
border-
|
831
|
-
border-
|
833
|
+
.sc-rounded-b-md {
|
834
|
+
border-bottom-right-radius: 0.375rem;
|
835
|
+
border-bottom-left-radius: 0.375rem;
|
832
836
|
}
|
833
837
|
|
834
838
|
.sc-border {
|
835
839
|
border-width: 1px;
|
836
840
|
}
|
837
841
|
|
838
|
-
.sc-border-0 {
|
839
|
-
border-width: 0px;
|
840
|
-
}
|
841
|
-
|
842
842
|
.sc-border-2 {
|
843
843
|
border-width: 2px;
|
844
844
|
}
|
845
845
|
|
846
|
-
.sc-border-b {
|
847
|
-
border-bottom-width: 1px;
|
848
|
-
}
|
849
|
-
|
850
846
|
.sc-border-r {
|
851
847
|
border-right-width: 1px;
|
852
848
|
}
|
@@ -969,11 +965,19 @@ select {
|
|
969
965
|
line-height: 1.375;
|
970
966
|
}
|
971
967
|
|
968
|
+
.\!sc-text-inherit {
|
969
|
+
color: inherit !important;
|
970
|
+
}
|
971
|
+
|
972
972
|
.sc-text-slate-500 {
|
973
973
|
--tw-text-opacity: 1;
|
974
974
|
color: rgb(100 116 139 / var(--tw-text-opacity));
|
975
975
|
}
|
976
976
|
|
977
|
+
.\!sc-no-underline {
|
978
|
+
text-decoration-line: none !important;
|
979
|
+
}
|
980
|
+
|
977
981
|
.hover\:sc-select-all:hover {
|
978
982
|
-webkit-user-select: all;
|
979
983
|
-moz-user-select: all;
|
@@ -985,12 +989,8 @@ select {
|
|
985
989
|
background-color: rgb(238 242 255 / var(--tw-bg-opacity));
|
986
990
|
}
|
987
991
|
|
988
|
-
.hover\:sc-
|
989
|
-
|
990
|
-
}
|
991
|
-
|
992
|
-
.hover\:sc-no-underline:hover {
|
993
|
-
text-decoration-line: none;
|
992
|
+
.hover\:sc-underline:hover {
|
993
|
+
text-decoration-line: underline;
|
994
994
|
}
|
995
995
|
|
996
996
|
@media (prefers-color-scheme: dark) {
|
@@ -110,3 +110,118 @@
|
|
110
110
|
color: #24292f;
|
111
111
|
font-weight: bold;
|
112
112
|
}
|
113
|
+
|
114
|
+
@media (prefers-color-scheme: dark) {
|
115
|
+
.sc-highlight table td { padding: 5px; }
|
116
|
+
.sc-highlight table pre { margin: 0; }
|
117
|
+
.sc-highlight, .sc-highlight .w {
|
118
|
+
color: #c9d1d9;
|
119
|
+
background-color: #161b22;
|
120
|
+
}
|
121
|
+
.sc-highlight .k, .sc-highlight .kd, .sc-highlight .kn, .sc-highlight .kp, .sc-highlight .kr, .sc-highlight .kt, .sc-highlight .kv {
|
122
|
+
color: #ff7b72;
|
123
|
+
}
|
124
|
+
.sc-highlight .gr {
|
125
|
+
color: #f0f6fc;
|
126
|
+
}
|
127
|
+
.sc-highlight .gd {
|
128
|
+
color: #ffdcd7;
|
129
|
+
background-color: #67060c;
|
130
|
+
}
|
131
|
+
.sc-highlight .nb {
|
132
|
+
color: #ffa657;
|
133
|
+
}
|
134
|
+
.sc-highlight .nc {
|
135
|
+
color: #ffa657;
|
136
|
+
}
|
137
|
+
.sc-highlight .no {
|
138
|
+
color: #ffa657;
|
139
|
+
}
|
140
|
+
.sc-highlight .nn {
|
141
|
+
color: #ffa657;
|
142
|
+
}
|
143
|
+
.sc-highlight .sr {
|
144
|
+
color: #7ee787;
|
145
|
+
}
|
146
|
+
.sc-highlight .na {
|
147
|
+
color: #7ee787;
|
148
|
+
}
|
149
|
+
.sc-highlight .nt {
|
150
|
+
color: #7ee787;
|
151
|
+
}
|
152
|
+
.sc-highlight .gi {
|
153
|
+
color: #aff5b4;
|
154
|
+
background-color: #033a16;
|
155
|
+
}
|
156
|
+
.sc-highlight .kc {
|
157
|
+
color: #79c0ff;
|
158
|
+
}
|
159
|
+
.sc-highlight .l, .sc-highlight .ld, .sc-highlight .m, .sc-highlight .mb, .sc-highlight .mf, .sc-highlight .mh, .sc-highlight .mi, .sc-highlight .il, .sc-highlight .mo, .sc-highlight .mx {
|
160
|
+
color: #79c0ff;
|
161
|
+
}
|
162
|
+
.sc-highlight .sb {
|
163
|
+
color: #79c0ff;
|
164
|
+
}
|
165
|
+
.sc-highlight .bp {
|
166
|
+
color: #79c0ff;
|
167
|
+
}
|
168
|
+
.sc-highlight .ne {
|
169
|
+
color: #79c0ff;
|
170
|
+
}
|
171
|
+
.sc-highlight .nl {
|
172
|
+
color: #79c0ff;
|
173
|
+
}
|
174
|
+
.sc-highlight .py {
|
175
|
+
color: #79c0ff;
|
176
|
+
}
|
177
|
+
.sc-highlight .nv, .sc-highlight .vc, .sc-highlight .vg, .sc-highlight .vi, .sc-highlight .vm {
|
178
|
+
color: #79c0ff;
|
179
|
+
}
|
180
|
+
.sc-highlight .o, .sc-highlight .ow {
|
181
|
+
color: #79c0ff;
|
182
|
+
}
|
183
|
+
.sc-highlight .gh {
|
184
|
+
color: #1f6feb;
|
185
|
+
font-weight: bold;
|
186
|
+
}
|
187
|
+
.sc-highlight .gu {
|
188
|
+
color: #1f6feb;
|
189
|
+
font-weight: bold;
|
190
|
+
}
|
191
|
+
.sc-highlight .s, .sc-highlight .sa, .sc-highlight .sc, .sc-highlight .dl, .sc-highlight .sd, .sc-highlight .s2, .sc-highlight .se, .sc-highlight .sh, .sc-highlight .sx, .sc-highlight .s1, .sc-highlight .ss {
|
192
|
+
color: #a5d6ff;
|
193
|
+
}
|
194
|
+
.sc-highlight .nd {
|
195
|
+
color: #d2a8ff;
|
196
|
+
}
|
197
|
+
.sc-highlight .nf, .sc-highlight .fm {
|
198
|
+
color: #d2a8ff;
|
199
|
+
}
|
200
|
+
.sc-highlight .err {
|
201
|
+
color: #f0f6fc;
|
202
|
+
background-color: #8e1519;
|
203
|
+
}
|
204
|
+
.sc-highlight .c, .sc-highlight .ch, .sc-highlight .cd, .sc-highlight .cm, .sc-highlight .cp, .sc-highlight .cpf, .sc-highlight .c1, .sc-highlight .cs {
|
205
|
+
color: #8b949e;
|
206
|
+
}
|
207
|
+
.sc-highlight .gl {
|
208
|
+
color: #8b949e;
|
209
|
+
}
|
210
|
+
.sc-highlight .gt {
|
211
|
+
color: #8b949e;
|
212
|
+
}
|
213
|
+
.sc-highlight .ni {
|
214
|
+
color: #c9d1d9;
|
215
|
+
}
|
216
|
+
.sc-highlight .si {
|
217
|
+
color: #c9d1d9;
|
218
|
+
}
|
219
|
+
.sc-highlight .ge {
|
220
|
+
color: #c9d1d9;
|
221
|
+
font-style: italic;
|
222
|
+
}
|
223
|
+
.sc-highlight .gs {
|
224
|
+
color: #c9d1d9;
|
225
|
+
font-weight: bold;
|
226
|
+
}
|
227
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
<%= javascript_include_tag "
|
1
|
+
<%= javascript_include_tag "showcase" %>
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<main class="sc-flex sc-flex-wrap dark:sc-bg-neutral-900 dark:sc-text-white" aria-labelledby="showcase_main_title">
|
2
2
|
<section class="sc-grid sc-grid-cols-12 sc-w-full">
|
3
3
|
<nav class="sc-col-span-3 xl:sc-col-span-2 sc-py-5 sc-h-full sc-border-r">
|
4
|
-
<h1 id="showcase_main_title" class="sc-font-black sc-text-2xl sc-py-2 sc-pl-4 sc-cursor-pointer"
|
4
|
+
<h1 id="showcase_main_title" class="sc-font-black sc-text-2xl sc-py-2 sc-pl-4 sc-cursor-pointer">
|
5
|
+
<%= link_to "Showcase", root_url, class: "!sc-text-inherit hover:sc-underline" %>
|
6
|
+
</h1>
|
5
7
|
|
6
8
|
<%= render Showcase::Path.tree %>
|
7
9
|
</nav>
|
@@ -1,8 +1,10 @@
|
|
1
|
-
<section class="sc-mb-4 sc-border sc-border-gray-200 sc-rounded-md" aria-labelledby="showcase_<%= sample.id %>_title">
|
1
|
+
<section class="sc-mb-4 sc-border sc-border-gray-200 sc-rounded-md sc-overflow-clip" aria-labelledby="showcase_<%= sample.id %>_title">
|
2
2
|
<showcase-sample id="<%= sample.id %>" events="<%= sample.events %>">
|
3
|
-
<header class="sc-bg-slate-100/50 dark:sc-bg-neutral-700/50
|
3
|
+
<header class="sc-bg-slate-100/50 dark:sc-bg-neutral-700/50">
|
4
4
|
<div class="sc-flex sc-justify-between">
|
5
|
-
<h3 id="showcase_<%= sample.id %>_title" class="sc-px-4 sc-py-2 sc-font-medium sc-text-base md:sc-text-lg sc-leading-snug sc-truncate"
|
5
|
+
<h3 id="showcase_<%= sample.id %>_title" class="sc-px-4 sc-py-2 sc-font-medium sc-text-base md:sc-text-lg sc-leading-snug sc-truncate">
|
6
|
+
<%= link_to sample.name, "##{sample.id}", class: "!sc-text-inherit" %>
|
7
|
+
</h3>
|
6
8
|
|
7
9
|
<% if event = sample.instrumented %>
|
8
10
|
<div class="sc-text-xs sc-grid sc-gap-x-2 sc-m-2 sc-italic sc-text-slate-500 dark:sc-text-inherit">
|
@@ -18,7 +20,7 @@
|
|
18
20
|
</header>
|
19
21
|
|
20
22
|
<% if sample.preview %>
|
21
|
-
<section class="sc-px-4 sc-py-2
|
23
|
+
<section class="sc-px-4 sc-py-2">
|
22
24
|
<%= sample.preview %>
|
23
25
|
</section>
|
24
26
|
<% end %>
|
@@ -34,10 +36,10 @@
|
|
34
36
|
<% end %>
|
35
37
|
|
36
38
|
<% if sample.events.any? %>
|
37
|
-
<section class="sc-px-4 sc-py-2 sc-font-small sc-bg-slate-50" aria-labelledby="showcase_<%= sample.id %>_javascript_events_title">
|
39
|
+
<section class="sc-px-4 sc-py-2 sc-font-small sc-bg-slate-50 dark:sc-bg-neutral-800 sc-rounded-b-md" aria-labelledby="showcase_<%= sample.id %>_javascript_events_title">
|
38
40
|
<h4 id="showcase_<%= sample.id %>_javascript_events_title" class="sc-mb-2 sc-font-medium sc-text-base">JavaScript Events</h4>
|
39
41
|
|
40
|
-
<div class="sc-overflow-scroll sc-max-h-
|
42
|
+
<div class="sc-overflow-scroll sc-max-h-48">
|
41
43
|
<pre data-showcase-sample-target="relay"></pre>
|
42
44
|
</div>
|
43
45
|
</section>
|
@@ -1 +1 @@
|
|
1
|
-
<%= stylesheet_link_tag "
|
1
|
+
<%= stylesheet_link_tag "showcase", "showcase.highlights" %>
|
@@ -25,6 +25,9 @@
|
|
25
25
|
<section class="sc-space-y-4">
|
26
26
|
<h2 class="sc-font-semibold sc-text-2xl">Additional resources</h2>
|
27
27
|
<ul class="sc-list-none">
|
28
|
+
<li>
|
29
|
+
<%= link_to "Showcase documentation", "https://github.com/bullet-train-co/showcase", target: "_blank" %>
|
30
|
+
</li>
|
28
31
|
<li>
|
29
32
|
<%= link_to "Bullet Train field partials documentation", "https://bullettrain.co/docs/field-partials", target: "_blank" %>
|
30
33
|
</li>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<article class="hover:sc-bg-indigo-50 dark:hover:sc-bg-neutral-700/50 <%= "sc-bg-indigo-50 dark:sc-bg-neutral-700/50" if path.id == params[:id] %>">
|
2
|
-
<%= link_to path.basename.titleize, preview_path(path.id), class: "sc-inline-block sc-py-2 sc-px-8 sc-w-full
|
2
|
+
<%= link_to path.basename.titleize, showcase.preview_path(path.id), class: "sc-inline-block sc-py-2 sc-px-8 sc-w-full !sc-text-inherit !sc-no-underline" %>
|
3
3
|
</article>
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Showcase::RouteHelper
|
2
4
|
def method_missing(name, ...)
|
3
|
-
|
4
|
-
|
5
|
-
else
|
5
|
+
if name.end_with?("_path", "_url")
|
6
|
+
main_app.public_send(name, ...)
|
7
|
+
else
|
8
|
+
super
|
6
9
|
end
|
7
10
|
end
|
8
11
|
end
|
data/lib/showcase/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: showcase-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Pence
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-03-
|
12
|
+
date: 2023-03-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- app/models/showcase/preview.rb
|
60
60
|
- app/models/showcase/sample.rb
|
61
61
|
- app/views/layouts/showcase.html.erb
|
62
|
+
- app/views/showcase/engine/_head.html.erb
|
62
63
|
- app/views/showcase/engine/_javascripts.html.erb
|
63
64
|
- app/views/showcase/engine/_options.html.erb
|
64
65
|
- app/views/showcase/engine/_preview.html.erb
|
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
102
|
- !ruby/object:Gem::Version
|
102
103
|
version: '0'
|
103
104
|
requirements: []
|
104
|
-
rubygems_version: 3.4.
|
105
|
+
rubygems_version: 3.4.8
|
105
106
|
signing_key:
|
106
107
|
specification_version: 4
|
107
108
|
summary: Showcase helps you show off and document your partials, components, view
|