doc: asciicast - reverse list for loop to not be affected by dom change

This commit is contained in:
rsteube 2022-10-13 18:37:08 +02:00
parent 2941a73fda
commit 2012680676
3 changed files with 7 additions and 12 deletions

View File

@ -1,11 +1,10 @@
window.addEventListener("load", function () {
// <img src="./carapace-bin.cast" alt="" />
for (elem of document.getElementsByTagName("img")) {
if (elem.src.endsWith(".cast")) {
const newItem = document.createElement("div");
newItem.id = elem.src;
elem.parentNode.replaceChild(newItem, elem);
AsciinemaPlayer.create(newItem.id, newItem, {cols: 108, rows: 24});
}
}
for (elem of Array.prototype.slice.call(document.getElementsByTagName("img")).reverse())
if (elem.src.endsWith(".cast")) {
const newItem = document.createElement("div");
newItem.id = elem.src;
elem.parentNode.replaceChild(newItem, elem);
AsciinemaPlayer.create(newItem.id, newItem, {cols: 108, rows: 24});
}
})

View File

@ -22,7 +22,6 @@ completion:
positionalany: ["$_fs.ZipFileContents(${C_ARG0})"] # ${C_ARG1},${C_ARG2},...
```
![]()
![](./examples-zipfile.cast)
## refs.yaml
@ -39,7 +38,6 @@ completion:
- ["$_tools.git.Refs"] # default
```
![]()
![](./examples-refs.cast)
## embed.yaml
@ -52,5 +50,4 @@ commands:
positionalany: ["$chdir(~/.password-store)", "$_bridge.CarapaceBin(git)"]
```
![]()
![](./examples-embed.cast)

View File

@ -33,7 +33,6 @@ carapace --style 'carapace.Value=bold,magenta'
carapace --style 'carapace.Description='
```
![]()
![](./style-value.cast)