@farberg/reveal-template 1.1.38 → 1.1.40

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/css/dhbw.css CHANGED
@@ -283,6 +283,11 @@ body {
283
283
  border-collapse: collapse;
284
284
  border-spacing: 0;
285
285
  font-size: 70%;
286
+ }
287
+
288
+ /* Outer/cell borders only for content tables, not the toc_table
289
+ (which has its own border rules further down). */
290
+ .reveal table:not(.toc_table) {
286
291
  border: 1px solid #d0d0d0;
287
292
  }
288
293
 
@@ -293,6 +298,9 @@ body {
293
298
  .reveal table th, .reveal table td {
294
299
  text-align: left;
295
300
  padding: 0.2em 0.5em 0.2em 0.5em;
301
+ }
302
+
303
+ .reveal table:not(.toc_table) th, .reveal table:not(.toc_table) td {
296
304
  border: 1px solid #d0d0d0;
297
305
  }
298
306
 
@@ -70,6 +70,47 @@ Some text
70
70
  - This is an example presentation
71
71
  - This is an example presentation
72
72
 
73
+ ---
74
+ ## Long Download List
75
+
76
+ <!--
77
+ generate using
78
+ find code/use-case -type f -not -path '*/\.*' | grep -v node_modules | sort
79
+ -->
80
+ <pre class="dirtree" data-zipname="use-case.zip">
81
+ code/use-case/k8s/kafka-topic.yaml
82
+ code/use-case/k8s/mariadb.yaml
83
+ code/use-case/k8s/memcached.yaml
84
+ code/use-case/k8s/spark-ingest.yaml
85
+ code/use-case/k8s/spark-prepare-silver.yaml
86
+ code/use-case/k8s/spark-recommender.yaml
87
+ code/use-case/k8s/spark-top10.yaml
88
+ code/use-case/k8s/web-app.yaml
89
+ code/use-case/spark-ingest/Dockerfile
90
+ code/use-case/spark-ingest/ingest.py
91
+ code/use-case/spark-prepare-silver/Dockerfile
92
+ code/use-case/spark-prepare-silver/prepare-silver.py
93
+ code/use-case/spark-recommender/Dockerfile
94
+ code/use-case/spark-recommender/entrypoint.sh
95
+ code/use-case/spark-recommender/recommender.py
96
+ code/use-case/spark-top10/Dockerfile
97
+ code/use-case/spark-top10/top10.py
98
+ code/use-case/web-app/Dockerfile
99
+ code/use-case/web-app/generate_insert_statements.js
100
+ code/use-case/web-app/index.js
101
+ code/use-case/web-app/package-lock.json
102
+ code/use-case/web-app/package.json
103
+ code/use-case/web-app/views/error.handlebars
104
+ code/use-case/web-app/views/home.handlebars
105
+ code/use-case/web-app/views/layouts/layout-main.handlebars
106
+ code/use-case/web-app/views/mission.handlebars
107
+ code/use-case/README.md
108
+ code/use-case/setup-kafka-and-bucket.sh
109
+ code/use-case/teardown-kafka.sh
110
+ code/use-case/skaffold.yaml
111
+ </pre>
112
+
113
+
73
114
  ---
74
115
  ## Asciinema Example
75
116
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farberg/reveal-template",
3
- "version": "1.1.38",
3
+ "version": "1.1.40",
4
4
  "homepage": "https://github.com/pfisterer/reveal-template",
5
5
  "description": "Reveal.js template for Dennis' lectures",
6
6
  "main": "index.js",
@@ -7,6 +7,11 @@ Attributes on <pre class="dirtree">:
7
7
  (default: zip name without ".zip", else ".")
8
8
  data-line-height="1.6" — line spacing (default: 1.85)
9
9
  data-width="auto" — container width, e.g. "400px", "60%", "auto" (default: auto)
10
+ data-columns="auto" — wrap a dense tree into multiple columns when it
11
+ gets too tall for the slide (default: "auto").
12
+ "auto" picks the count from the number of entries
13
+ (>12 → 2, >24 → 3); "2"/"3"/… forces a fixed
14
+ count; "1" (or "none") keeps a single column.
10
15
 
11
16
  <pre class="dirtree" data-zipname="k8s-Exercise.zip" data-line-height="1.6" data-width="480px">
12
17
  code/k8s-demo-app/01-mariadb-deployment.yaml
@@ -388,6 +393,32 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
388
393
  margin-right: 4px;
389
394
  flex-shrink: 0;
390
395
  }
396
+
397
+ /* Multi-column layout for dense trees (opt-in via data-columns).
398
+ column-count is set inline so the number can be dynamic. Each
399
+ direct child subtree is kept whole so a directory and its files
400
+ never split across the column boundary. */
401
+ ul.dirtree.dirtree-columns {
402
+ column-gap: 1.6em;
403
+ column-rule: 1px solid #e1e4e8;
404
+ }
405
+
406
+ ul.dirtree.dirtree-columns > li.dirtree {
407
+ -webkit-column-break-inside: avoid;
408
+ break-inside: avoid;
409
+ }
410
+
411
+ /* Several non-wrapping columns side by side can grow wider than the
412
+ slide. Shrink the tree a touch and trim the side padding in
413
+ multi-column mode so both columns fit the slide width. */
414
+ .dirtree-container.dirtree-multicol {
415
+ padding-left: 12px;
416
+ padding-right: 12px;
417
+ }
418
+
419
+ .dirtree-container.dirtree-multicol li.dirtree {
420
+ font-size: 13px;
421
+ }
391
422
  `;
392
423
  document.head.appendChild(style);
393
424
  }
@@ -825,6 +856,43 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
825
856
  displayTree(ul, childTree, childPath, files, zipName, []);
826
857
  }
827
858
 
859
+ // Spread a dense tree over several columns. The tree usually hangs off a
860
+ // single root chain (e.g. code → use-case → …), so columnising the
861
+ // container itself can't split anything. Instead we target the ul that
862
+ // holds the most direct entries — the branch point — and let its child
863
+ // subtrees flow into columns. Each line already carries its full ASCII
864
+ // prefix as text, so a line stays readable in any column.
865
+ function applyColumns(rootUl, columns) {
866
+ if (!columns || columns === '1' || columns === 'none') return;
867
+
868
+ let branch = null, max = -1;
869
+ for (const u of rootUl.querySelectorAll('ul.dirtree')) {
870
+ const count = Array.from(u.children).filter(c => c.tagName === 'LI').length;
871
+ if (count > max) { max = count; branch = u; }
872
+ }
873
+ if (!branch) return;
874
+
875
+ // "auto" scales with the total number of rendered lines (the tree's
876
+ // height), not the entries of any single directory — a tree can be
877
+ // tall while every individual folder stays small.
878
+ let n;
879
+ if (columns === 'auto') {
880
+ const total = rootUl.querySelectorAll('li.dirtree').length;
881
+ n = total > 40 ? 3 : total > 14 ? 2 : 1;
882
+ } else {
883
+ n = parseInt(columns, 10);
884
+ }
885
+ if (!Number.isFinite(n) || n < 2) return;
886
+
887
+ branch.classList.add('dirtree-columns');
888
+ branch.style.columnCount = String(n);
889
+
890
+ // Mark the container so the multi-column sizing rules apply (smaller
891
+ // font + tighter padding to keep the wider layout on the slide).
892
+ const container = branch.closest('.dirtree-container');
893
+ if (container) container.classList.add('dirtree-multicol');
894
+ }
895
+
828
896
  deck.on('ready', () => {
829
897
  injectStyles();
830
898
 
@@ -832,6 +900,7 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
832
900
  const zipName = el.getAttribute('data-zipname');
833
901
  const lineHeight = el.getAttribute('data-line-height') || '1.85';
834
902
  const width = el.getAttribute('data-width') || 'auto';
903
+ const columns = el.getAttribute('data-columns') || 'auto';
835
904
 
836
905
  const files = getFileList(el);
837
906
  const tree = createTree(files);
@@ -866,6 +935,7 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
866
935
 
867
936
  const rootLabel = el.getAttribute('data-root') || (zipName ? zipName.replace(/\.zip$/i, '') : '.');
868
937
  displayRoot(ul, tree, rootLabel, files, zipName);
938
+ applyColumns(ul, columns);
869
939
 
870
940
  el.parentElement.replaceChild(container, el);
871
941
  }