Skip to content

Commit

Permalink
doc: asciicast - reverse list for loop to not be affected by dom change
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 13, 2022
1 parent 2941a73 commit 2012680
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
15 changes: 7 additions & 8 deletions docs/asciinema/load.js
Original file line number Diff line number Diff line change
@@ -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});
}
})
3 changes: 0 additions & 3 deletions docs/src/spec/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ completion:
positionalany: ["$_fs.ZipFileContents(${C_ARG0})"] # ${C_ARG1},${C_ARG2},...
```
![]()
![](./examples-zipfile.cast)
## refs.yaml
Expand All @@ -39,7 +38,6 @@ completion:
- ["$_tools.git.Refs"] # default
```
![]()
![](./examples-refs.cast)
## embed.yaml
Expand All @@ -52,5 +50,4 @@ commands:
positionalany: ["$chdir(~/.password-store)", "$_bridge.CarapaceBin(git)"]
```
![]()
![](./examples-embed.cast)
1 change: 0 additions & 1 deletion docs/src/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ carapace --style 'carapace.Value=bold,magenta'
carapace --style 'carapace.Description='
```

![]()
![](./style-value.cast)


Expand Down

0 comments on commit 2012680

Please sign in to comment.