@farberg/reveal-template 1.1.33 → 1.1.35

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- "liveServer.settings.port": 5501
2
+ "liveServer.settings.port": 5502
3
3
  }
@@ -19,6 +19,21 @@ kubectl apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operato
19
19
  docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t yourusername/yourcontainername:1.2.3 -t yourusername/yourcontainername:latest --push .
20
20
  ```
21
21
 
22
+ ---
23
+
24
+ ---
25
+ ## Kafka Streams: Run It
26
+
27
+ <pre class="dirtree" data-zipname="bla.zip" style="margin-left: 40px;">
28
+ 00 - Introduction.md
29
+ npm.html
30
+ </pre>
31
+
32
+ <pre class="dirtree" style="margin-left: 40px;">
33
+ 00 - Introduction.md
34
+ npm.html
35
+ </pre>
36
+
22
37
  ---
23
38
  ## Mermaid Example
24
39
 
@@ -29,6 +44,13 @@ graph LR
29
44
  C --> D["database<br/>40–110ms"]
30
45
  ```
31
46
 
47
+ ```mermaid
48
+ flowchart LR
49
+ S(["Spout<br/>sentences"]) -->|sentence| SP["Bolt<br/>split"]
50
+ SP -->|words| C["Bolt<br/>count"]
51
+ C -->|"(word, count)"| OUT[/"Output"/]
52
+ ```
53
+
32
54
  Some text
33
55
  - This is an example presentation
34
56
  - This is an example presentation
package/init-reveal.js CHANGED
@@ -155,7 +155,14 @@ const defaultRevealOptions = {
155
155
  secondaryColor: '#5c6971',
156
156
  secondaryTextColor: '#000',
157
157
  tertiaryColor: '#e8e8e8',
158
- loopTextColor: '#4a4a4a'
158
+ loopTextColor: '#4a4a4a',
159
+ // timeline / journey color scale (DHBW red + grey, alternating)
160
+ cScale0: '#e2001a', cScaleLabel0: '#ffffff',
161
+ cScale1: '#5c6971', cScaleLabel1: '#ffffff',
162
+ cScale2: '#e2001a', cScaleLabel2: '#ffffff',
163
+ cScale3: '#5c6971', cScaleLabel3: '#ffffff',
164
+ cScale4: '#e2001a', cScaleLabel4: '#ffffff',
165
+ cScale5: '#5c6971', cScaleLabel5: '#ffffff'
159
166
  },
160
167
  sequence: {
161
168
  mirrorActors: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farberg/reveal-template",
3
- "version": "1.1.33",
3
+ "version": "1.1.35",
4
4
  "homepage": "https://github.com/pfisterer/reveal-template",
5
5
  "description": "Reveal.js template for Dennis' lectures",
6
6
  "main": "index.js",
@@ -3,6 +3,8 @@ Create a zip from existing files for download and display a tree of files
3
3
 
4
4
  Attributes on <pre class="dirtree">:
5
5
  data-zipname="archive.zip" — name of the downloaded zip; omit to hide the download button
6
+ data-root="my-project" — label for the root folder when files have no common top-level dir
7
+ (default: zip name without ".zip", else ".")
6
8
  data-line-height="1.6" — line spacing (default: 1.85)
7
9
  data-width="auto" — container width, e.g. "400px", "60%", "auto" (default: auto)
8
10
 
@@ -36,6 +38,12 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
36
38
  position: relative !important;
37
39
  }
38
40
 
41
+ /* Without a download button there is nothing to clear at the top,
42
+ so drop the reserved space the button would otherwise occupy. */
43
+ .dirtree-container.no-download {
44
+ padding-top: 14px;
45
+ }
46
+
39
47
  ul.dirtree {
40
48
  list-style: none !important;
41
49
  padding: 0 !important;
@@ -347,24 +355,26 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
347
355
  /* Download button */
348
356
  .dirtree-download-btn {
349
357
  position: absolute !important;
350
- top: 10px !important;
351
- right: 14px !important;
352
- padding: 2px 10px;
358
+ top: 8px !important;
359
+ right: 12px !important;
360
+ padding: 1px 6px;
353
361
  background: transparent;
354
- border: 1px solid #d0d7de;
355
- border-radius: 6px;
356
- color: #cf222e !important;
357
- font-size: 0.85em;
362
+ border: 1px solid #e1e4e8;
363
+ border-radius: 5px;
364
+ color: #8c959f !important;
365
+ font-size: 0.6em;
366
+ opacity: 0.6;
358
367
  cursor: pointer;
359
368
  text-decoration: none !important;
360
- transition: background 0.15s, border-color 0.15s;
369
+ transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
361
370
  font-family: inherit;
362
371
  }
363
372
 
364
373
  .dirtree-download-btn:hover {
365
- background: #fff5f5 !important;
366
- border-color: #cf222e !important;
367
- color: #cf222e !important;
374
+ background: #f6f8fa !important;
375
+ border-color: #d0d7de !important;
376
+ color: #57606a !important;
377
+ opacity: 1;
368
378
  }
369
379
 
370
380
  .dirtree-prefix {
@@ -652,7 +662,10 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
652
662
  for (const file of files) {
653
663
  const parts = file.split('/');
654
664
  const filename = parts.pop();
655
- getPath(tree, parts)[filename] = filename;
665
+ // Files without a folder prefix attach to the tree root directly;
666
+ // otherwise getPath(tree, []) would create a bogus "undefined" node.
667
+ const dir = parts.length > 0 ? getPath(tree, parts) : tree;
668
+ dir[filename] = filename;
656
669
  }
657
670
  return tree;
658
671
  }
@@ -686,7 +699,7 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
686
699
  });
687
700
  }
688
701
 
689
- function displayTree(el, treeNode, path, isRoot, files, zipName, ancestorLast) {
702
+ function displayTree(el, treeNode, path, files, zipName, ancestorLast) {
690
703
  const names = Object.getOwnPropertyNames(treeNode);
691
704
 
692
705
  names.forEach((name, index) => {
@@ -697,12 +710,18 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
697
710
  const li = document.createElement('li');
698
711
  li.classList.add('dirtree');
699
712
 
700
- if (isRoot) {
701
- li.classList.add('root');
713
+ const contPrefix = ancestorLast.map(last => last ? ' ' : '│ ').join('');
714
+ const connector = isLast ? '└── ' : '├── ';
702
715
 
716
+ const prefixSpan = document.createElement('span');
717
+ prefixSpan.classList.add('dirtree-prefix');
718
+ prefixSpan.textContent = contPrefix + connector;
719
+ li.appendChild(prefixSpan);
720
+
721
+ if (isDir) {
703
722
  const icon = document.createElement('span');
704
723
  icon.classList.add('dirtree-icon');
705
- icon.textContent = '📁';
724
+ icon.textContent = '📂';
706
725
 
707
726
  const nameSpan = document.createElement('span');
708
727
  nameSpan.classList.add('dirtree-dir-name');
@@ -715,58 +734,62 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
715
734
  const ul = document.createElement('ul');
716
735
  ul.classList.add('dirtree');
717
736
  li.appendChild(ul);
718
- displayTree(ul, o, `${path}/${name}`, false, files, zipName, []);
737
+ displayTree(ul, o, `${path}/${name}`, files, zipName, [...ancestorLast, isLast]);
719
738
 
720
739
  } else {
721
- const contPrefix = ancestorLast.map(last => last ? ' ' : '').join('');
722
- const connector = isLast ? '└── ' : '├── ';
723
-
724
- const prefixSpan = document.createElement('span');
725
- prefixSpan.classList.add('dirtree-prefix');
726
- prefixSpan.textContent = contPrefix + connector;
727
- li.appendChild(prefixSpan);
728
-
729
- if (isDir) {
730
- const icon = document.createElement('span');
731
- icon.classList.add('dirtree-icon');
732
- icon.textContent = '📂';
733
-
734
- const nameSpan = document.createElement('span');
735
- nameSpan.classList.add('dirtree-dir-name');
736
- nameSpan.textContent = name;
737
-
738
- li.appendChild(icon);
739
- li.appendChild(nameSpan);
740
- el.appendChild(li);
741
-
742
- const ul = document.createElement('ul');
743
- ul.classList.add('dirtree');
744
- li.appendChild(ul);
745
- displayTree(ul, o, `${path}/${name}`, false, files, zipName, [...ancestorLast, isLast]);
746
-
747
- } else {
748
- const ext = name.includes('.') ? name.split('.').pop().toLowerCase() : '';
749
-
750
- const icon = document.createElement('span');
751
- icon.classList.add('dirtree-icon');
752
- icon.textContent = getFileIcon(name, ext);
753
-
754
- const finalPath = `${path}/${o}`.replace(/^\//, '');
755
- const a = document.createElement('a');
756
- a.classList.add('dirtree-file-link');
757
- a.href = finalPath;
758
- a.textContent = o;
759
-
760
- li.appendChild(icon);
761
- li.appendChild(a);
762
- li.appendChild(makePreviewButton(finalPath, o, ext));
763
- li.appendChild(makeCopyButton(finalPath));
764
- el.appendChild(li);
765
- }
740
+ const ext = name.includes('.') ? name.split('.').pop().toLowerCase() : '';
741
+
742
+ const icon = document.createElement('span');
743
+ icon.classList.add('dirtree-icon');
744
+ icon.textContent = getFileIcon(name, ext);
745
+
746
+ const finalPath = `${path}/${o}`.replace(/^\//, '');
747
+ const a = document.createElement('a');
748
+ a.classList.add('dirtree-file-link');
749
+ a.href = finalPath;
750
+ a.textContent = o;
751
+
752
+ li.appendChild(icon);
753
+ li.appendChild(a);
754
+ li.appendChild(makePreviewButton(finalPath, o, ext));
755
+ li.appendChild(makeCopyButton(finalPath));
756
+ el.appendChild(li);
766
757
  }
767
758
  });
768
759
  }
769
760
 
761
+ // Render the decorative root folder, then its contents. When every file
762
+ // shares a single top-level directory, that directory becomes the root
763
+ // (and stays in the file paths). Otherwise we show a label-only root
764
+ // (data-root, else the zip name, else ".") that is NOT part of any path.
765
+ function displayRoot(el, tree, rootLabel, files, zipName) {
766
+ const topNames = Object.getOwnPropertyNames(tree);
767
+ const singleRootDir = topNames.length === 1 && typeof tree[topNames[0]] === 'object';
768
+ const rootName = singleRootDir ? topNames[0] : rootLabel;
769
+ const childTree = singleRootDir ? tree[rootName] : tree;
770
+ const childPath = singleRootDir ? `/${rootName}` : '';
771
+
772
+ const li = document.createElement('li');
773
+ li.classList.add('dirtree', 'root');
774
+
775
+ const icon = document.createElement('span');
776
+ icon.classList.add('dirtree-icon');
777
+ icon.textContent = '📁';
778
+
779
+ const nameSpan = document.createElement('span');
780
+ nameSpan.classList.add('dirtree-dir-name');
781
+ nameSpan.textContent = rootName;
782
+
783
+ li.appendChild(icon);
784
+ li.appendChild(nameSpan);
785
+ el.appendChild(li);
786
+
787
+ const ul = document.createElement('ul');
788
+ ul.classList.add('dirtree');
789
+ li.appendChild(ul);
790
+ displayTree(ul, childTree, childPath, files, zipName, []);
791
+ }
792
+
770
793
  deck.on('ready', () => {
771
794
  injectStyles();
772
795
 
@@ -797,13 +820,17 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
797
820
  btn.href = '#zip/' + zipName;
798
821
  btn.addEventListener('click', e => { e.preventDefault(); download(files, zipName); });
799
822
  container.appendChild(btn);
823
+ } else {
824
+ // No button means no need to reserve top padding for it.
825
+ container.classList.add('no-download');
800
826
  }
801
827
 
802
828
  const ul = document.createElement('ul');
803
829
  ul.classList.add('dirtree');
804
830
  container.appendChild(ul);
805
831
 
806
- displayTree(ul, tree, '', true, files, zipName, []);
832
+ const rootLabel = el.getAttribute('data-root') || (zipName ? zipName.replace(/\.zip$/i, '') : '.');
833
+ displayRoot(ul, tree, rootLabel, files, zipName);
807
834
 
808
835
  el.parentElement.replaceChild(container, el);
809
836
  }