desy-html 7.3.1 → 8.0.0
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.
- package/docs/_global.foot.njk +0 -23
- package/docs/_global.head.njk +13 -331
- package/docs/_macro.example-render.njk +40 -15
- package/docs/_macro.render-caller.njk +2 -2
- package/docs/_macro.show-code-from-file.njk +57 -0
- package/docs/_template.examples.njk +1 -1
- package/docs/estilos.html +15 -14
- package/docs/index.html +12 -0
- package/gulpfile.js +18 -3
- package/package.json +5 -2
- package/src/css/styles.css +1 -1
- package/src/js/filters/filter-caller.js +6 -0
- package/src/js/filters/highlight.js +14 -0
- package/src/js/filters/index.js +10 -0
- package/src/js/globals/get-html-code-from-example.js +29 -0
- package/src/js/globals/get-html-code-from-file.js +26 -0
- package/src/js/globals/get-nunjucks-code-from-example.js +32 -0
- package/src/js/globals/get-nunjucks-code-from-file.js +24 -0
- package/src/js/globals/index.js +14 -0
- package/src/js/index.js +21 -0
- package/src/templates/components/accordion/_examples.accordion.njk +108 -104
- package/src/templates/components/accordion-history/_examples.accordion-history.njk +116 -112
- package/src/templates/components/alert/_examples.alert.njk +10 -6
- package/src/templates/components/breadcrumbs/_examples.breadcrumbs.njk +52 -52
- package/src/templates/components/button/_examples.button.njk +71 -71
- package/src/templates/components/button-loader/_examples.button-loader.njk +72 -72
- package/src/templates/components/card/_examples.card.njk +43 -43
- package/src/templates/components/character-count/_examples.character-count.njk +35 -33
- package/src/templates/components/checkboxes/_examples.checkboxes.njk +200 -201
- package/src/templates/components/collapsible/_examples.collapsible.njk +24 -9
- package/src/templates/components/date-input/_examples.date-input.njk +14 -14
- package/src/templates/components/description-list/_examples.description-list.njk +45 -44
- package/src/templates/components/details/_examples.details.njk +17 -16
- package/src/templates/components/dialog/_examples.dialog.njk +5 -6
- package/src/templates/components/dropdown/_examples.dropdown.njk +34 -35
- package/src/templates/components/error-message/_examples.error-message.njk +8 -2
- package/src/templates/components/error-summary/_examples.error-summary.njk +19 -19
- package/src/templates/components/fieldset/_examples.fieldset.njk +27 -25
- package/src/templates/components/file-upload/_examples.file-upload.njk +7 -7
- package/src/templates/components/footer/_examples.footer.njk +24 -24
- package/src/templates/components/footer/_template.footer.njk +1 -1
- package/src/templates/components/header/_examples.header.njk +12 -12
- package/src/templates/components/header-mini/_examples.header-mini.njk +5 -5
- package/src/templates/components/hint/_examples.hint.njk +4 -4
- package/src/templates/components/input/_examples.input.njk +68 -65
- package/src/templates/components/input-group/_examples.input-group.njk +15 -17
- package/src/templates/components/item/_examples.item.njk +21 -20
- package/src/templates/components/label/_examples.label.njk +11 -9
- package/src/templates/components/links-list/_examples.links-list.njk +34 -34
- package/src/templates/components/listbox/_examples.listbox.njk +146 -146
- package/src/templates/components/media-object/_examples.media-object.njk +7 -7
- package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +54 -54
- package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +65 -66
- package/src/templates/components/menu-vertical/_examples.menu-vertical.njk +71 -71
- package/src/templates/components/menubar/_examples.menubar.njk +42 -42
- package/src/templates/components/modal/_examples.modal.njk +21 -15
- package/src/templates/components/modal/_template.modal.njk +5 -5
- package/src/templates/components/nav/_examples.nav.njk +66 -66
- package/src/templates/components/notification/_examples.notification.njk +14 -13
- package/src/templates/components/pagination/_examples.pagination.njk +7 -6
- package/src/templates/components/pill/_examples.pill.njk +29 -29
- package/src/templates/components/radios/_examples.radios.njk +153 -142
- package/src/templates/components/searchbar/_examples.searchbar.njk +13 -13
- package/src/templates/components/select/_examples.select.njk +63 -63
- package/src/templates/components/skip-link/_examples.skip-link.njk +4 -4
- package/src/templates/components/spinner/_examples.spinner.njk +11 -11
- package/src/templates/components/status/_examples.status.njk +4 -4
- package/src/templates/components/status-item/_examples.status-item.njk +21 -21
- package/src/templates/components/table/_examples.table.njk +58 -56
- package/src/templates/components/table-advanced/_examples.table-advanced.njk +83 -83
- package/src/templates/components/tabs/_examples.tabs.njk +30 -29
- package/src/templates/components/textarea/_examples.textarea.njk +28 -27
- package/src/templates/components/toggle/_examples.toggle.njk +10 -11
- package/src/templates/components/tooltip/_examples.tooltip.njk +9 -9
- package/src/templates/components/tree/_examples.tree.njk +58 -57
- package/src/js/prism/clipboard.min.js +0 -7
- package/src/js/prism/prism-copy-to-clipboard.min.js +0 -1
- package/src/js/prism/prism-normalize-whitespace.min.js +0 -1
- package/src/js/prism/prism-toolbar.min.js +0 -1
- package/src/js/prism/prism-twig.min.js +0 -1
- package/src/js/prism/prism-yaml.min.js +0 -1
- package/src/js/prism/prism.min.js +0 -1
package/docs/_global.foot.njk
CHANGED
|
@@ -6,29 +6,6 @@
|
|
|
6
6
|
"classes": "lg:mt-48"
|
|
7
7
|
}) }}
|
|
8
8
|
|
|
9
|
-
<script src="js/prism/prism.min.js"></script>
|
|
10
|
-
<script src="js/prism/prism-toolbar.min.js"></script>
|
|
11
|
-
<script src="js/prism/clipboard.min.js"></script>
|
|
12
|
-
<script src="js/prism/prism-copy-to-clipboard.min.js"></script>
|
|
13
|
-
<script src="js/prism/prism-normalize-whitespace.min.js"></script>
|
|
14
|
-
<script src="js/prism/prism-yaml.min.js"></script>
|
|
15
|
-
<script src="js/prism/prism-twig.min.js"></script>
|
|
16
|
-
<script>
|
|
17
|
-
// Optional
|
|
18
|
-
Prism.plugins.NormalizeWhitespace.setDefaults({
|
|
19
|
-
'remove-trailing': true,
|
|
20
|
-
'remove-indent': true,
|
|
21
|
-
'left-trim': true,
|
|
22
|
-
'right-trim': true,
|
|
23
|
-
/*'break-lines': 80,
|
|
24
|
-
'indent': 2,
|
|
25
|
-
'remove-initial-line-feed': false,
|
|
26
|
-
'tabs-to-spaces': 4,
|
|
27
|
-
'spaces-to-tabs': 4*/
|
|
28
|
-
});
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
|
|
32
9
|
<script src="js/popper.min.js"></script>
|
|
33
10
|
<script src="js/tippy-bundle.umd.min.js"></script>
|
|
34
11
|
<script type="module" src="js/index.js"></script>
|
package/docs/_global.head.njk
CHANGED
|
@@ -11,336 +11,18 @@
|
|
|
11
11
|
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" rel="stylesheet">
|
|
12
12
|
<link rel="stylesheet" href="css/styles.css">
|
|
13
13
|
<style>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
28
|
-
text-align: left;
|
|
29
|
-
white-space: pre;
|
|
30
|
-
word-spacing: normal;
|
|
31
|
-
word-break: normal;
|
|
32
|
-
word-wrap: normal;
|
|
33
|
-
line-height: 1.5;
|
|
34
|
-
-moz-tab-size: 4;
|
|
35
|
-
-o-tab-size: 4;
|
|
36
|
-
tab-size: 4;
|
|
37
|
-
-webkit-hyphens: none;
|
|
38
|
-
-ms-hyphens: none;
|
|
39
|
-
hyphens: none; }
|
|
40
|
-
|
|
41
|
-
/* Code blocks */
|
|
42
|
-
pre[class*="language-"] {
|
|
43
|
-
position: relative;
|
|
44
|
-
margin: .5em 0;
|
|
45
|
-
overflow: visible;
|
|
46
|
-
padding: 0; }
|
|
47
|
-
|
|
48
|
-
pre[class*="language-"] > code {
|
|
49
|
-
position: relative;
|
|
50
|
-
border-left: 10px solid #358ccb;
|
|
51
|
-
-webkit-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
|
|
52
|
-
box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
|
|
53
|
-
background-color: #fdfdfd;
|
|
54
|
-
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(50%, transparent), color-stop(50%, rgba(69, 142, 209, 0.04)));
|
|
55
|
-
background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
|
|
56
|
-
background-size: 3em 3em;
|
|
57
|
-
background-origin: content-box;
|
|
58
|
-
background-attachment: local; }
|
|
59
|
-
|
|
60
|
-
code[class*="language"] {
|
|
61
|
-
max-height: inherit;
|
|
62
|
-
height: inherit;
|
|
63
|
-
padding: 0 1em;
|
|
64
|
-
display: block;
|
|
65
|
-
overflow: auto; }
|
|
66
|
-
|
|
67
|
-
/* Margin bottom to accommodate shadow */
|
|
68
|
-
:not(pre) > code[class*="language-"],
|
|
69
|
-
pre[class*="language-"] {
|
|
70
|
-
background-color: #fdfdfd;
|
|
71
|
-
-webkit-box-sizing: border-box;
|
|
72
|
-
box-sizing: border-box;
|
|
73
|
-
margin-bottom: 1em; }
|
|
74
|
-
|
|
75
|
-
/* Inline code */
|
|
76
|
-
:not(pre) > code[class*="language-"] {
|
|
77
|
-
position: relative;
|
|
78
|
-
padding: .2em;
|
|
79
|
-
border-radius: 0.3em;
|
|
80
|
-
color: #c92c2c;
|
|
81
|
-
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
82
|
-
display: inline;
|
|
83
|
-
white-space: normal; }
|
|
84
|
-
|
|
85
|
-
pre[class*="language-"]:before,
|
|
86
|
-
pre[class*="language-"]:after {
|
|
87
|
-
content: '';
|
|
88
|
-
z-index: -2;
|
|
89
|
-
display: block;
|
|
90
|
-
position: absolute;
|
|
91
|
-
bottom: 0.75em;
|
|
92
|
-
left: 0.18em;
|
|
93
|
-
width: 40%;
|
|
94
|
-
height: 20%;
|
|
95
|
-
max-height: 13em;
|
|
96
|
-
-webkit-box-shadow: 0px 13px 8px #979797;
|
|
97
|
-
box-shadow: 0px 13px 8px #979797;
|
|
98
|
-
-webkit-transform: rotate(-2deg);
|
|
99
|
-
transform: rotate(-2deg); }
|
|
100
|
-
|
|
101
|
-
:not(pre) > code[class*="language-"]:after,
|
|
102
|
-
pre[class*="language-"]:after {
|
|
103
|
-
right: 0.75em;
|
|
104
|
-
left: auto;
|
|
105
|
-
-webkit-transform: rotate(2deg);
|
|
106
|
-
transform: rotate(2deg); }
|
|
107
|
-
|
|
108
|
-
.token.comment,
|
|
109
|
-
.token.block-comment,
|
|
110
|
-
.token.prolog,
|
|
111
|
-
.token.doctype,
|
|
112
|
-
.token.cdata {
|
|
113
|
-
color: #7D8B99; }
|
|
114
|
-
|
|
115
|
-
.token.punctuation {
|
|
116
|
-
color: #5F6364; }
|
|
117
|
-
|
|
118
|
-
.token.property,
|
|
119
|
-
.token.tag,
|
|
120
|
-
.token.boolean,
|
|
121
|
-
.token.number,
|
|
122
|
-
.token.function-name,
|
|
123
|
-
.token.constant,
|
|
124
|
-
.token.symbol,
|
|
125
|
-
.token.deleted {
|
|
126
|
-
color: #c92c2c; }
|
|
127
|
-
|
|
128
|
-
.token.selector,
|
|
129
|
-
.token.attr-name,
|
|
130
|
-
.token.string,
|
|
131
|
-
.token.char,
|
|
132
|
-
.token.function,
|
|
133
|
-
.token.builtin,
|
|
134
|
-
.token.inserted {
|
|
135
|
-
color: #2f9c0a; }
|
|
136
|
-
|
|
137
|
-
.token.operator,
|
|
138
|
-
.token.entity,
|
|
139
|
-
.token.url,
|
|
140
|
-
.token.variable {
|
|
141
|
-
color: #a67f59;
|
|
142
|
-
background: rgba(255, 255, 255, 0.5); }
|
|
143
|
-
|
|
144
|
-
.token.atrule,
|
|
145
|
-
.token.attr-value,
|
|
146
|
-
.token.keyword,
|
|
147
|
-
.token.class-name {
|
|
148
|
-
color: #1990b8; }
|
|
149
|
-
|
|
150
|
-
.token.regex,
|
|
151
|
-
.token.important {
|
|
152
|
-
color: #e90; }
|
|
153
|
-
|
|
154
|
-
.language-css .token.string,
|
|
155
|
-
.style .token.string {
|
|
156
|
-
color: #a67f59; }
|
|
157
|
-
|
|
158
|
-
.token.important {
|
|
159
|
-
font-weight: normal; }
|
|
160
|
-
|
|
161
|
-
.token.bold {
|
|
162
|
-
font-weight: bold; }
|
|
163
|
-
|
|
164
|
-
.token.italic {
|
|
165
|
-
font-style: italic; }
|
|
166
|
-
|
|
167
|
-
.token.entity {
|
|
168
|
-
cursor: help; }
|
|
169
|
-
|
|
170
|
-
.namespace {
|
|
171
|
-
opacity: .7; }
|
|
172
|
-
|
|
173
|
-
@media screen and (max-width: 767px) {
|
|
174
|
-
pre[class*="language-"]:before,
|
|
175
|
-
pre[class*="language-"]:after {
|
|
176
|
-
bottom: 14px;
|
|
177
|
-
-webkit-box-shadow: none;
|
|
178
|
-
box-shadow: none; } }
|
|
179
|
-
|
|
180
|
-
/* Plugin styles */
|
|
181
|
-
.token.tab:not(:empty):before,
|
|
182
|
-
.token.cr:before,
|
|
183
|
-
.token.lf:before {
|
|
184
|
-
color: #e0d7d1; }
|
|
185
|
-
|
|
186
|
-
/* Plugin styles: Line Numbers */
|
|
187
|
-
pre[class*="language-"].line-numbers.line-numbers {
|
|
188
|
-
padding-left: 0; }
|
|
189
|
-
|
|
190
|
-
pre[class*="language-"].line-numbers.line-numbers code {
|
|
191
|
-
padding-left: 3.8em; }
|
|
192
|
-
|
|
193
|
-
pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows {
|
|
194
|
-
left: 0; }
|
|
195
|
-
|
|
196
|
-
/* Plugin styles: Line Highlight */
|
|
197
|
-
pre[class*="language-"][data-line] {
|
|
198
|
-
padding-top: 0;
|
|
199
|
-
padding-bottom: 0;
|
|
200
|
-
padding-left: 0; }
|
|
201
|
-
|
|
202
|
-
pre[data-line] code {
|
|
203
|
-
position: relative;
|
|
204
|
-
padding-left: 4em; }
|
|
205
|
-
|
|
206
|
-
pre .line-highlight {
|
|
207
|
-
margin-top: 0; }
|
|
208
|
-
|
|
209
|
-
div.code-toolbar {
|
|
210
|
-
position: relative; }
|
|
211
|
-
|
|
212
|
-
div.code-toolbar > .toolbar {
|
|
213
|
-
position: absolute;
|
|
214
|
-
top: .3em;
|
|
215
|
-
right: .2em;
|
|
216
|
-
-webkit-transition: opacity 0.3s ease-in-out;
|
|
217
|
-
transition: opacity 0.3s ease-in-out;
|
|
218
|
-
opacity: 0; }
|
|
219
|
-
|
|
220
|
-
div.code-toolbar:hover > .toolbar {
|
|
221
|
-
opacity: 1; }
|
|
222
|
-
|
|
223
|
-
div.code-toolbar > .toolbar .toolbar-item {
|
|
224
|
-
display: inline-block; }
|
|
225
|
-
|
|
226
|
-
div.code-toolbar > .toolbar a {
|
|
227
|
-
cursor: pointer; }
|
|
228
|
-
|
|
229
|
-
div.code-toolbar > .toolbar button {
|
|
230
|
-
background: none;
|
|
231
|
-
border: 0;
|
|
232
|
-
color: inherit;
|
|
233
|
-
font: inherit;
|
|
234
|
-
line-height: normal;
|
|
235
|
-
overflow: visible;
|
|
236
|
-
padding: 0;
|
|
237
|
-
-webkit-user-select: none;
|
|
238
|
-
/* for button */
|
|
239
|
-
-moz-user-select: none;
|
|
240
|
-
-ms-user-select: none; }
|
|
241
|
-
|
|
242
|
-
div.code-toolbar > .toolbar a,
|
|
243
|
-
div.code-toolbar > .toolbar button,
|
|
244
|
-
div.code-toolbar > .toolbar span {
|
|
245
|
-
/* color: #bbb;
|
|
246
|
-
font-size: .8em;
|
|
247
|
-
padding: 0 .5em;
|
|
248
|
-
background: #f5f2f0;
|
|
249
|
-
background: rgba(224, 224, 224, 0.2);
|
|
250
|
-
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
|
|
251
|
-
border-radius: .5em; */ }
|
|
252
|
-
|
|
253
|
-
div.code-toolbar > .toolbar a:hover,
|
|
254
|
-
div.code-toolbar > .toolbar a:focus,
|
|
255
|
-
div.code-toolbar > .toolbar button:hover,
|
|
256
|
-
div.code-toolbar > .toolbar button:focus,
|
|
257
|
-
div.code-toolbar > .toolbar span:hover,
|
|
258
|
-
div.code-toolbar > .toolbar span:focus {
|
|
259
|
-
text-decoration: none; }
|
|
260
|
-
|
|
261
|
-
pre[class*="language-"] > code {
|
|
262
|
-
margin: 0 0 1rem;
|
|
263
|
-
padding: 1.5rem;
|
|
264
|
-
border-left: 0;
|
|
265
|
-
border-radius: 4px;
|
|
266
|
-
background: #f6f6f5;
|
|
267
|
-
-webkit-box-shadow: 0 0 0 1px #dfdfdf;
|
|
268
|
-
box-shadow: 0 0 0 1px #dfdfdf; }
|
|
269
|
-
|
|
270
|
-
code[class*="language-"],
|
|
271
|
-
pre[class*="language-"] {
|
|
272
|
-
position: relative;
|
|
273
|
-
color: #5c5c5c;
|
|
274
|
-
font-family: Inconsolata, "Roboto Mono", Consolas, Menlo, Monaco, "Ubuntu Mono", "DejaVu Sans Mono", monospace;
|
|
275
|
-
font-weight: normal; }
|
|
276
|
-
|
|
277
|
-
:not(pre) > code[class*="language-"],
|
|
278
|
-
pre[class*="language-"] {
|
|
279
|
-
margin-top: 0;
|
|
280
|
-
margin-bottom: 0; }
|
|
281
|
-
|
|
282
|
-
pre[class*="language-"]::before,
|
|
283
|
-
pre[class*="language-"]::after {
|
|
284
|
-
display: none; }
|
|
285
|
-
|
|
286
|
-
pre[class*="language-"] > code {
|
|
287
|
-
margin: 0 0 2rem;
|
|
288
|
-
padding-top: 3rem;
|
|
289
|
-
border-left: 0;
|
|
290
|
-
background-image: none;
|
|
291
|
-
-webkit-box-shadow: none;
|
|
292
|
-
box-shadow: none; }
|
|
293
|
-
|
|
294
|
-
.prism-show-language {
|
|
295
|
-
margin-bottom: 0.75rem;
|
|
296
|
-
font-size: 0.889rem; }
|
|
297
|
-
|
|
298
|
-
.clipboard-copy {
|
|
299
|
-
display: none; }
|
|
300
|
-
|
|
301
|
-
div.code-toolbar > .toolbar {
|
|
302
|
-
position: absolute;
|
|
303
|
-
top: 0rem;
|
|
304
|
-
width: 100%;
|
|
305
|
-
font-family: "Open Sans", "Gill Sans MT", "Gill Sans", Corbel, Arial, sans-serif;
|
|
306
|
-
font-size: 1rem;
|
|
307
|
-
opacity: 1;
|
|
308
|
-
z-index: 1; }
|
|
309
|
-
div.code-toolbar > .toolbar a {
|
|
310
|
-
padding: 0.375rem 0.625rem;
|
|
311
|
-
text-decoration: none; }
|
|
312
|
-
div.code-toolbar > .toolbar .toolbar-item:first-of-type {
|
|
313
|
-
position: absolute;
|
|
314
|
-
top: 0.75rem;
|
|
315
|
-
left: 1.75rem;
|
|
316
|
-
color: #8f8f8f;
|
|
317
|
-
font-size: .875em;
|
|
318
|
-
letter-spacing: .08em;
|
|
319
|
-
text-transform: uppercase;
|
|
320
|
-
-webkit-box-shadow: none;
|
|
321
|
-
box-shadow: none; }
|
|
322
|
-
div.code-toolbar > .toolbar .toolbar-item:nth-of-type(2) {
|
|
323
|
-
display: none;
|
|
324
|
-
position: absolute;
|
|
325
|
-
top: 0.5rem;
|
|
326
|
-
right: 0.5rem;
|
|
327
|
-
padding: .2em;
|
|
328
|
-
-webkit-transition: opacity 0.08s ease;
|
|
329
|
-
transition: opacity 0.08s ease;
|
|
330
|
-
border-radius: 3px;
|
|
331
|
-
background: #fff;
|
|
332
|
-
font-size: .8em;
|
|
333
|
-
-webkit-box-shadow: 0 2px 0 0 #b9c4ca;
|
|
334
|
-
box-shadow: 0 2px 0 0 #b9c4ca;
|
|
335
|
-
opacity: .6; }
|
|
336
|
-
@media screen and (min-width: 1024px) {
|
|
337
|
-
div.code-toolbar > .toolbar .toolbar-item:nth-of-type(2) {
|
|
338
|
-
display: block; } }
|
|
339
|
-
div.code-toolbar > .toolbar .toolbar-item:nth-of-type(2):hover {
|
|
340
|
-
opacity: 1; }
|
|
341
|
-
|
|
342
|
-
.language-name {
|
|
343
|
-
display: none; }
|
|
344
|
-
|
|
14
|
+
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
15
|
+
Theme: StackOverflow Light
|
|
16
|
+
Description: Light theme as used on stackoverflow.com
|
|
17
|
+
Author: stackoverflow.com
|
|
18
|
+
Maintainer: @Hirse
|
|
19
|
+
Website: https://github.com/StackExchange/Stacks
|
|
20
|
+
License: MIT
|
|
21
|
+
Updated: 2021-05-15
|
|
22
|
+
|
|
23
|
+
Updated for @stackoverflow/stacks v0.64.0
|
|
24
|
+
Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less
|
|
25
|
+
Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less
|
|
26
|
+
*/.hljs{color:#2f3337;background:#f6f6f6}.hljs-subst{color:#2f3337}.hljs-comment{color:#656e77}.hljs-attr,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-selector-tag{color:#015692}.hljs-attribute{color:#803378}.hljs-name,.hljs-number,.hljs-quote,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#b75501}.hljs-selector-class{color:#015692}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-string,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#54790d}.hljs-meta,.hljs-selector-pseudo{color:#015692}.hljs-built_in,.hljs-literal,.hljs-title{color:#b75501}.hljs-bullet,.hljs-code{color:#535a60}.hljs-meta .hljs-string{color:#54790d}.hljs-deletion{color:#c02d2e}.hljs-addition{color:#2f6f44}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
|
|
345
27
|
</style>
|
|
346
28
|
</head>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
{% from "_macro.load-component-template.njk" import loadComponentTemplate %}
|
|
2
|
-
|
|
3
1
|
{% from "components/accordion/_macro.accordion.njk"
|
|
4
2
|
import componentAccordion %}
|
|
5
3
|
{% from "components/accordion-history/_macro.accordion-history.njk"
|
|
@@ -126,8 +124,10 @@ import componentTree %}
|
|
|
126
124
|
<div class="py-base">
|
|
127
125
|
<h2 class="mb-sm font-bold">Parámetros del componente</h2>
|
|
128
126
|
{% from "_macro.load-component-params.njk" import loadComponentParams %}
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
<pre>
|
|
128
|
+
<code class="language-yaml hljs text-sm">{{ loadComponentParams(exampleComponent) | highlight("yaml") | safe }}
|
|
129
|
+
</code>
|
|
130
|
+
</pre>
|
|
131
131
|
</div>
|
|
132
132
|
</div>
|
|
133
133
|
{% endcall %}
|
|
@@ -136,7 +136,7 @@ import componentTree %}
|
|
|
136
136
|
<div class="grid grid-cols-1 gap-x-xl mt-xl">
|
|
137
137
|
<div class="pt-xl">
|
|
138
138
|
<h3 id="example-title-{{ loop.index }}" class="c-h3 group">{{ example.name | capitalize }} <a href="#{{ example.name | capitalize | urlencode }}" class="hidden font-semibold text-neutral-base underline group-hover:inline-block">#</a></h3>
|
|
139
|
-
<p class="c-paragraph-base mb-0">{{ example.description }}</p>
|
|
139
|
+
<p class="c-paragraph-base mb-0">{{ example.description | safe }}</p>
|
|
140
140
|
</div>
|
|
141
141
|
<div class="pt-base lg:pt-lg">
|
|
142
142
|
<div class="p-base border border-neutral-base">
|
|
@@ -255,19 +255,44 @@ import componentTree %}
|
|
|
255
255
|
{% set nunjucksContent %}
|
|
256
256
|
{% if example.data.caller %}
|
|
257
257
|
{% from "_macro.render-caller.njk" import renderCaller %}
|
|
258
|
-
{% set callerHtml %}{{ renderCaller(example.data.caller
|
|
259
|
-
|
|
258
|
+
{% set callerHtml %}{{ renderCaller(example.data.caller) }}{% endset %}
|
|
259
|
+
{% set callerNunjucks %}
|
|
260
260
|
{% raw %}{%{% endraw %} from "components/{{ exampleComponent }}/_macro.{{ exampleComponent }}.njk" import component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }}{% raw %} %}{% endraw %}
|
|
261
|
-
{% raw %}{% {% endraw %}call component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }}
|
|
262
|
-
{{
|
|
261
|
+
{% raw %}{% {% endraw %}call component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }} {% endset %}
|
|
262
|
+
{{ componentButton({
|
|
263
|
+
"text": "Copiar código",
|
|
264
|
+
"classes": "c-button--sm c-button--transparent mb-sm",
|
|
265
|
+
"attributes": {
|
|
266
|
+
"data-module": "c-button-copy"
|
|
267
|
+
}
|
|
268
|
+
}) }}
|
|
269
|
+
<pre><code class="language-js hljs text-sm">
|
|
270
|
+
{{ callerNunjucks | highlight("js") | safe }}({{ example.data | filtercaller | dump(2) | highlight("js") | safe }}){% raw %} %}{% endraw %}
|
|
271
|
+
{{ callerHtml | highlight("html") | safe }}
|
|
272
|
+
{% raw %}{%{% endraw %} endcall {% raw %} %}{% endraw %}</code></pre>
|
|
263
273
|
{% else %}
|
|
264
|
-
|
|
265
|
-
|
|
274
|
+
{{ componentButton({
|
|
275
|
+
"text": "Copiar código",
|
|
276
|
+
"classes": "c-button--sm c-button--transparent mb-sm",
|
|
277
|
+
"attributes": {
|
|
278
|
+
"data-module": "c-button-copy"
|
|
279
|
+
}
|
|
280
|
+
}) }}
|
|
281
|
+
<pre class="hljs"><code class="language-js hljs text-sm">{{- getNunjucksCodeFromExample(exampleComponent, example.data, 'component') | highlight("twig") | safe -}}</code></pre>
|
|
266
282
|
{% endif %}
|
|
267
283
|
{% endset %}
|
|
268
284
|
{% set htmlContent %}
|
|
269
|
-
{
|
|
270
|
-
|
|
285
|
+
{{ componentButton({
|
|
286
|
+
"text": "Copiar código",
|
|
287
|
+
"classes": "c-button--sm c-button--transparent mb-sm",
|
|
288
|
+
"attributes": {
|
|
289
|
+
"data-module": "c-button-copy"
|
|
290
|
+
}
|
|
291
|
+
}) }}
|
|
292
|
+
<pre class="hljs"><code class="language-html hljs text-sm">
|
|
293
|
+
{{- getHTMLCodeFromExample(exampleComponent, example.data, 'component') | highlight("html") | safe -}}
|
|
294
|
+
</code>
|
|
295
|
+
</pre>
|
|
271
296
|
{% endset %}
|
|
272
297
|
{% call componentDetails({
|
|
273
298
|
"summary": {
|
|
@@ -283,13 +308,13 @@ import componentTree %}
|
|
|
283
308
|
{
|
|
284
309
|
"text": "Nunjucks macro",
|
|
285
310
|
"panel": {
|
|
286
|
-
"html": nunjucksContent | trim
|
|
311
|
+
"html": nunjucksContent | trim
|
|
287
312
|
}
|
|
288
313
|
},
|
|
289
314
|
{
|
|
290
315
|
"text": "HTML",
|
|
291
316
|
"panel": {
|
|
292
|
-
"html": htmlContent | trim
|
|
317
|
+
"html": htmlContent | trim
|
|
293
318
|
}
|
|
294
319
|
}
|
|
295
320
|
]
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
{% macro renderCaller(params) %}
|
|
2
|
-
{{ params | safe
|
|
3
|
-
{% endmacro %}
|
|
2
|
+
{{ params | safe }}
|
|
3
|
+
{% endmacro %}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{% from "components/button/_macro.button.njk"
|
|
2
|
+
import componentButton %}
|
|
3
|
+
{% from "components/details/_macro.details.njk"
|
|
4
|
+
import componentDetails %}
|
|
5
|
+
{% from "components/tabs/_macro.tabs.njk"
|
|
6
|
+
import componentTabs %}
|
|
7
|
+
|
|
8
|
+
{% macro showCodeFromFile(filePath) %}
|
|
9
|
+
{% set nunjucksContent %}
|
|
10
|
+
{{ componentButton({
|
|
11
|
+
"html": 'Copiar código<span class="sr-only">Nunjucks del ejemplo: ' + filePath + '</span>',
|
|
12
|
+
"classes": "c-button--sm c-button--transparent mb-sm",
|
|
13
|
+
"attributes": {
|
|
14
|
+
"data-module": "c-button-copy"
|
|
15
|
+
}
|
|
16
|
+
}) }}
|
|
17
|
+
<pre class="hljs"><code class="language-js hljs text-sm">{{- getNunjucksCodeFromFile(filePath) | highlight("twig") | safe -}}</code></pre>
|
|
18
|
+
{% endset %}
|
|
19
|
+
{% set htmlContent %}
|
|
20
|
+
{{ componentButton({
|
|
21
|
+
"html": 'Copiar código<span class="sr-only">HTML del ejemplo: ' + filePath + '</span>',
|
|
22
|
+
"classes": "c-button--sm c-button--transparent mb-sm",
|
|
23
|
+
"attributes": {
|
|
24
|
+
"data-module": "c-button-copy"
|
|
25
|
+
}
|
|
26
|
+
}) }}
|
|
27
|
+
<pre class="hljs"><code class="language-html hljs text-sm">
|
|
28
|
+
{{- getHTMLCodeFromFile(filePath) | highlight("html") | safe -}}
|
|
29
|
+
</code></pre>
|
|
30
|
+
{% endset %}
|
|
31
|
+
{% call componentDetails({
|
|
32
|
+
"summary": {
|
|
33
|
+
"html": 'Mostrar código<span class="sr-only">del ejemplo: ' + filePath + '</span>',
|
|
34
|
+
"classes": "c-link text-sm"
|
|
35
|
+
}
|
|
36
|
+
}) %}
|
|
37
|
+
{{ componentTabs({
|
|
38
|
+
"tablistAriaLabel": "Tab example",
|
|
39
|
+
"idPrefix": "tab-" + filePath | replace("/", "-") | replace("_", "") | replace(".", "-"),
|
|
40
|
+
"classes": "c-tabs--scroll",
|
|
41
|
+
"items": [
|
|
42
|
+
{
|
|
43
|
+
"text": "Nunjucks macro",
|
|
44
|
+
"panel": {
|
|
45
|
+
"html": nunjucksContent | trim
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"text": "HTML",
|
|
50
|
+
"panel": {
|
|
51
|
+
"html": htmlContent | trim
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}) }}
|
|
56
|
+
{% endcall %}
|
|
57
|
+
{% endmacro %}
|
package/docs/estilos.html
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{% set title = "Estilos: colores, espaciado, retícula y tipografía. Documentación de desy-html. Gobierno de Aragón" %}
|
|
2
2
|
{% extends "_template.default.njk" %}
|
|
3
|
+
|
|
3
4
|
{% block contentBlock %}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{% endblock %}
|
|
5
|
+
<div class="pb-lg"></div>
|
|
6
|
+
<div class="c-h1">Estilos</div>
|
|
7
|
+
<div class="pb-lg"></div>
|
|
8
|
+
{% include "ds/_ds.section.color.njk" %}
|
|
9
|
+
<div class="pb-2xl"></div>
|
|
10
|
+
{% include "ds/_ds.section.espaciado.njk" %}
|
|
11
|
+
<div class="pb-2xl"></div>
|
|
12
|
+
{% include "ds/_ds.section.layout.njk" %}
|
|
13
|
+
<div class="pb-2xl"></div>
|
|
14
|
+
{% include "ds/_ds.section.textos.njk" %}
|
|
15
|
+
<div class="pb-2xl"></div>
|
|
16
|
+
{% include "ds/_ds.section.typography.njk" %}
|
|
17
|
+
<div class="pb-2xl"></div>
|
|
18
|
+
{% endblock %}
|
package/docs/index.html
CHANGED
|
@@ -38,6 +38,18 @@
|
|
|
38
38
|
|
|
39
39
|
<h2>Changelog (English)</h2>
|
|
40
40
|
<p>What's new in the latest version of desy-html</p>
|
|
41
|
+
<h3>v.8.0.0</h3>
|
|
42
|
+
<ul class="text-sm">
|
|
43
|
+
<li>Improved indentation in examples.</li>
|
|
44
|
+
<li>Added functions to show source code in Nunjucks and HTML.</li>
|
|
45
|
+
<li>Removed Prism.</li>
|
|
46
|
+
<li>Fixed a bug in telephone link in footer.</li>
|
|
47
|
+
<li>Fixed an example of Searchbar with button breaking line.</li>
|
|
48
|
+
</ul>
|
|
49
|
+
<h3>v.7.4.0</h3>
|
|
50
|
+
<ul class="text-sm">
|
|
51
|
+
<li>Translated examples to español.</li>
|
|
52
|
+
</ul>
|
|
41
53
|
<h3>v.7.3.1</h3>
|
|
42
54
|
<ul class="text-sm">
|
|
43
55
|
<li>Added source code links to Plantillas pages.</li>
|
package/gulpfile.js
CHANGED
|
@@ -19,14 +19,28 @@ const SOURCE_HTML_DIR = './docs/**.html';
|
|
|
19
19
|
const SOURCE_NUNJUCKS_PATHS = ['./src/templates/','./docs/'];
|
|
20
20
|
const SOURCE_NUNJUCKS_FILES = ['./src/templates/**/*','./docs/**/*'];
|
|
21
21
|
const SOURCE_NUNJUCKS_DIR = './docs/**/*.html';
|
|
22
|
-
const
|
|
22
|
+
const SOURCE_JS_FILES = ['./src/**/**.js','!./src/js/globals/**', '!./src/js/filters/**'];
|
|
23
23
|
const SOURCE_STYLESHEET = './src/css/styles.css';
|
|
24
24
|
const SOURCE_STYLESHEET_DIR = './src/**/*.css';
|
|
25
|
+
const SOURCE_NUNJUCKS_GLOBALS = require('./src/js/globals/index.js');
|
|
26
|
+
const SOURCE_NUNJUCKS_FILTERS = require('./src/js/filters/index.js');
|
|
25
27
|
const DESTINATION_HTML_DIR = './dist/';
|
|
26
28
|
const DESTINATION_JS_DIR = './dist/';
|
|
27
29
|
const DESTINATION_STYLESHEET = './dist/css/';
|
|
28
30
|
|
|
29
31
|
|
|
32
|
+
const manageEnvironment = function(environment) {
|
|
33
|
+
// Custom globals
|
|
34
|
+
for (const key in SOURCE_NUNJUCKS_GLOBALS) {
|
|
35
|
+
environment.addGlobal(key, SOURCE_NUNJUCKS_GLOBALS[key])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Custom filters
|
|
39
|
+
for (const key in SOURCE_NUNJUCKS_FILTERS) {
|
|
40
|
+
environment.addFilter(key, SOURCE_NUNJUCKS_FILTERS[key])
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
30
44
|
function bs(cb) {
|
|
31
45
|
browserSync.init({
|
|
32
46
|
server: {
|
|
@@ -40,7 +54,7 @@ function bs(cb) {
|
|
|
40
54
|
|
|
41
55
|
|
|
42
56
|
function watchFiles(cb) {
|
|
43
|
-
gulp.watch([TAILWIND_CONFIG, SOURCE_STYLESHEET_DIR, SOURCE_HTML_DIR,
|
|
57
|
+
gulp.watch([TAILWIND_CONFIG, SOURCE_STYLESHEET_DIR, SOURCE_HTML_DIR, ...SOURCE_JS_FILES, SOURCE_NUNJUCKS_DIR, ...SOURCE_NUNJUCKS_FILES], gulp.series(html, nunjucks, js, css, reload));
|
|
44
58
|
cb();
|
|
45
59
|
}
|
|
46
60
|
|
|
@@ -82,6 +96,7 @@ function nunjucks() {
|
|
|
82
96
|
lstripBlocks: true,
|
|
83
97
|
noCache: true
|
|
84
98
|
},
|
|
99
|
+
manageEnv: manageEnvironment,
|
|
85
100
|
path: SOURCE_NUNJUCKS_PATHS // String or Array
|
|
86
101
|
}))
|
|
87
102
|
.pipe(gulp.dest(DESTINATION_HTML_DIR));
|
|
@@ -89,7 +104,7 @@ function nunjucks() {
|
|
|
89
104
|
|
|
90
105
|
|
|
91
106
|
function js() {
|
|
92
|
-
return gulp.src(
|
|
107
|
+
return gulp.src(SOURCE_JS_FILES)
|
|
93
108
|
.pipe(gulp.dest(DESTINATION_JS_DIR));
|
|
94
109
|
}
|
|
95
110
|
|