@farberg/reveal-template 1.1.33 → 1.1.34
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/.vscode/settings.json +1 -1
- package/docs/00 - Introduction.md +17 -0
- package/init-reveal.js +8 -1
- package/package.json +1 -1
- package/plugins/reveal-plugin-dir-tree.js +81 -63
package/.vscode/settings.json
CHANGED
|
@@ -19,6 +19,16 @@ 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
|
+
|
|
22
32
|
---
|
|
23
33
|
## Mermaid Example
|
|
24
34
|
|
|
@@ -29,6 +39,13 @@ graph LR
|
|
|
29
39
|
C --> D["database<br/>40–110ms"]
|
|
30
40
|
```
|
|
31
41
|
|
|
42
|
+
```mermaid
|
|
43
|
+
flowchart LR
|
|
44
|
+
S(["Spout<br/>sentences"]) -->|sentence| SP["Bolt<br/>split"]
|
|
45
|
+
SP -->|words| C["Bolt<br/>count"]
|
|
46
|
+
C -->|"(word, count)"| OUT[/"Output"/]
|
|
47
|
+
```
|
|
48
|
+
|
|
32
49
|
Some text
|
|
33
50
|
- This is an example presentation
|
|
34
51
|
- 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
|
@@ -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
|
|
|
@@ -347,24 +349,26 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
|
|
|
347
349
|
/* Download button */
|
|
348
350
|
.dirtree-download-btn {
|
|
349
351
|
position: absolute !important;
|
|
350
|
-
top:
|
|
351
|
-
right:
|
|
352
|
-
padding:
|
|
352
|
+
top: 8px !important;
|
|
353
|
+
right: 12px !important;
|
|
354
|
+
padding: 1px 6px;
|
|
353
355
|
background: transparent;
|
|
354
|
-
border: 1px solid #
|
|
355
|
-
border-radius:
|
|
356
|
-
color: #
|
|
357
|
-
font-size: 0.
|
|
356
|
+
border: 1px solid #e1e4e8;
|
|
357
|
+
border-radius: 5px;
|
|
358
|
+
color: #8c959f !important;
|
|
359
|
+
font-size: 0.6em;
|
|
360
|
+
opacity: 0.6;
|
|
358
361
|
cursor: pointer;
|
|
359
362
|
text-decoration: none !important;
|
|
360
|
-
transition: background 0.15s, border-color 0.15s;
|
|
363
|
+
transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
|
|
361
364
|
font-family: inherit;
|
|
362
365
|
}
|
|
363
366
|
|
|
364
367
|
.dirtree-download-btn:hover {
|
|
365
|
-
background: #
|
|
366
|
-
border-color: #
|
|
367
|
-
color: #
|
|
368
|
+
background: #f6f8fa !important;
|
|
369
|
+
border-color: #d0d7de !important;
|
|
370
|
+
color: #57606a !important;
|
|
371
|
+
opacity: 1;
|
|
368
372
|
}
|
|
369
373
|
|
|
370
374
|
.dirtree-prefix {
|
|
@@ -652,7 +656,10 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
|
|
|
652
656
|
for (const file of files) {
|
|
653
657
|
const parts = file.split('/');
|
|
654
658
|
const filename = parts.pop();
|
|
655
|
-
|
|
659
|
+
// Files without a folder prefix attach to the tree root directly;
|
|
660
|
+
// otherwise getPath(tree, []) would create a bogus "undefined" node.
|
|
661
|
+
const dir = parts.length > 0 ? getPath(tree, parts) : tree;
|
|
662
|
+
dir[filename] = filename;
|
|
656
663
|
}
|
|
657
664
|
return tree;
|
|
658
665
|
}
|
|
@@ -686,7 +693,7 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
|
|
|
686
693
|
});
|
|
687
694
|
}
|
|
688
695
|
|
|
689
|
-
function displayTree(el, treeNode, path,
|
|
696
|
+
function displayTree(el, treeNode, path, files, zipName, ancestorLast) {
|
|
690
697
|
const names = Object.getOwnPropertyNames(treeNode);
|
|
691
698
|
|
|
692
699
|
names.forEach((name, index) => {
|
|
@@ -697,12 +704,18 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
|
|
|
697
704
|
const li = document.createElement('li');
|
|
698
705
|
li.classList.add('dirtree');
|
|
699
706
|
|
|
700
|
-
|
|
701
|
-
|
|
707
|
+
const contPrefix = ancestorLast.map(last => last ? ' ' : '│ ').join('');
|
|
708
|
+
const connector = isLast ? '└── ' : '├── ';
|
|
709
|
+
|
|
710
|
+
const prefixSpan = document.createElement('span');
|
|
711
|
+
prefixSpan.classList.add('dirtree-prefix');
|
|
712
|
+
prefixSpan.textContent = contPrefix + connector;
|
|
713
|
+
li.appendChild(prefixSpan);
|
|
702
714
|
|
|
715
|
+
if (isDir) {
|
|
703
716
|
const icon = document.createElement('span');
|
|
704
717
|
icon.classList.add('dirtree-icon');
|
|
705
|
-
icon.textContent = '
|
|
718
|
+
icon.textContent = '📂';
|
|
706
719
|
|
|
707
720
|
const nameSpan = document.createElement('span');
|
|
708
721
|
nameSpan.classList.add('dirtree-dir-name');
|
|
@@ -715,58 +728,62 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
|
|
|
715
728
|
const ul = document.createElement('ul');
|
|
716
729
|
ul.classList.add('dirtree');
|
|
717
730
|
li.appendChild(ul);
|
|
718
|
-
displayTree(ul, o, `${path}/${name}`,
|
|
731
|
+
displayTree(ul, o, `${path}/${name}`, files, zipName, [...ancestorLast, isLast]);
|
|
719
732
|
|
|
720
733
|
} else {
|
|
721
|
-
const
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
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
|
-
}
|
|
734
|
+
const ext = name.includes('.') ? name.split('.').pop().toLowerCase() : '';
|
|
735
|
+
|
|
736
|
+
const icon = document.createElement('span');
|
|
737
|
+
icon.classList.add('dirtree-icon');
|
|
738
|
+
icon.textContent = getFileIcon(name, ext);
|
|
739
|
+
|
|
740
|
+
const finalPath = `${path}/${o}`.replace(/^\//, '');
|
|
741
|
+
const a = document.createElement('a');
|
|
742
|
+
a.classList.add('dirtree-file-link');
|
|
743
|
+
a.href = finalPath;
|
|
744
|
+
a.textContent = o;
|
|
745
|
+
|
|
746
|
+
li.appendChild(icon);
|
|
747
|
+
li.appendChild(a);
|
|
748
|
+
li.appendChild(makePreviewButton(finalPath, o, ext));
|
|
749
|
+
li.appendChild(makeCopyButton(finalPath));
|
|
750
|
+
el.appendChild(li);
|
|
766
751
|
}
|
|
767
752
|
});
|
|
768
753
|
}
|
|
769
754
|
|
|
755
|
+
// Render the decorative root folder, then its contents. When every file
|
|
756
|
+
// shares a single top-level directory, that directory becomes the root
|
|
757
|
+
// (and stays in the file paths). Otherwise we show a label-only root
|
|
758
|
+
// (data-root, else the zip name, else ".") that is NOT part of any path.
|
|
759
|
+
function displayRoot(el, tree, rootLabel, files, zipName) {
|
|
760
|
+
const topNames = Object.getOwnPropertyNames(tree);
|
|
761
|
+
const singleRootDir = topNames.length === 1 && typeof tree[topNames[0]] === 'object';
|
|
762
|
+
const rootName = singleRootDir ? topNames[0] : rootLabel;
|
|
763
|
+
const childTree = singleRootDir ? tree[rootName] : tree;
|
|
764
|
+
const childPath = singleRootDir ? `/${rootName}` : '';
|
|
765
|
+
|
|
766
|
+
const li = document.createElement('li');
|
|
767
|
+
li.classList.add('dirtree', 'root');
|
|
768
|
+
|
|
769
|
+
const icon = document.createElement('span');
|
|
770
|
+
icon.classList.add('dirtree-icon');
|
|
771
|
+
icon.textContent = '📁';
|
|
772
|
+
|
|
773
|
+
const nameSpan = document.createElement('span');
|
|
774
|
+
nameSpan.classList.add('dirtree-dir-name');
|
|
775
|
+
nameSpan.textContent = rootName;
|
|
776
|
+
|
|
777
|
+
li.appendChild(icon);
|
|
778
|
+
li.appendChild(nameSpan);
|
|
779
|
+
el.appendChild(li);
|
|
780
|
+
|
|
781
|
+
const ul = document.createElement('ul');
|
|
782
|
+
ul.classList.add('dirtree');
|
|
783
|
+
li.appendChild(ul);
|
|
784
|
+
displayTree(ul, childTree, childPath, files, zipName, []);
|
|
785
|
+
}
|
|
786
|
+
|
|
770
787
|
deck.on('ready', () => {
|
|
771
788
|
injectStyles();
|
|
772
789
|
|
|
@@ -803,7 +820,8 @@ const dirTreeFactory = ({ zip, strToU8 }) => ({
|
|
|
803
820
|
ul.classList.add('dirtree');
|
|
804
821
|
container.appendChild(ul);
|
|
805
822
|
|
|
806
|
-
|
|
823
|
+
const rootLabel = el.getAttribute('data-root') || (zipName ? zipName.replace(/\.zip$/i, '') : '.');
|
|
824
|
+
displayRoot(ul, tree, rootLabel, files, zipName);
|
|
807
825
|
|
|
808
826
|
el.parentElement.replaceChild(container, el);
|
|
809
827
|
}
|