Skip to content

Commit

Permalink
Refactor the demo script to democtl.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Apr 30, 2024
1 parent 31e6040 commit 64302be
Show file tree
Hide file tree
Showing 7 changed files with 447 additions and 102 deletions.
43 changes: 43 additions & 0 deletions .xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
!
! Copy from https://github.com/mbadolato/iTerm2-Color-Schemes/blob/master/Xresources/Darkside
!
*.foreground: #bababa
*.background: #222324
*.cursorColor: #bbbbbb
!
! Black
*.color0: #000000
*.color8: #000000
!
! Red
*.color1: #e8341c
*.color9: #e05a4f
!
! Green
*.color2: #68c256
*.color10: #77b869
!
! Yellow
*.color3: #f2d42c
*.color11: #efd64b
!
! Blue
*.color4: #1c98e8
*.color12: #387cd3
!
! Magenta
*.color5: #8e69c9
*.color13: #957bbe
!
! Cyan
*.color6: #1c98e8
*.color14: #3d97e2
!
! White
*.color7: #bababa
*.color15: #bababa
!
! Bold, Italic, Underline
*.colorBD: #ffffff
!*.colorIT:
!*.colorUL:
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,17 @@ release:
.PHONY: help
help:
@cat $(MAKEFILE_LIST) | grep -e '^## ' | sed -e 's/^## //'

.PRECIOUS: %.cast
%.cast: %.demo
@./hack/democtl.sh "$<" "$@" \
--ps1='\033[1;96m~/sigs.k8s.io/kwok\033[1;94m$$\033[0m '

.PRECIOUS: %.svg
%.svg: %.cast
@./hack/democtl.sh "$<" "$@" \
--term xresources \
--profile ./.xresources

%.mp4: %.cast
@./hack/democtl.sh "$<" "$@"
7 changes: 0 additions & 7 deletions demo/.gitignore

This file was deleted.

27 changes: 7 additions & 20 deletions demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SVG_TERM=./node_modules/.bin/svg-term
SVG_TO_VIDEO=./node_modules/.bin/svg-to-video
.PRECIOUS: %.cast
%.cast: %.demo
make -C .. ./demo/$@

$(SVG_TERM):
pip3 install asciinema
npm i --save-dev svg-term-cli

$(SVG_TO_VIDEO):
npm i --save-dev @wzshiming/svg-to-video

%.svg: %.demo
@$(MAKE) $(SVG_TERM)
@echo "Generating $@"
@$(SVG_TERM) --out "$@" \
--window \
--command "cd .. && ./demo/play-demo.sh ./demo/$<"
.PRECIOUS: %.svg
%.svg: %.cast
make -C .. ./demo/$@

%.mp4: %.svg
@$(MAKE) $(SVG_TO_VIDEO)
@echo "Generating $@"
@$(SVG_TO_VIDEO) $< $@ \
--delay-start 1 \
--headless
make -C .. ./demo/$@

.PHONY: all
all: $(patsubst %.demo,%.svg,$(wildcard *.demo))
Expand Down
4 changes: 3 additions & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Demo
# Demo (DEPRECATED)

Will move it to `site` directory.

## Generate demo svg

Expand Down
74 changes: 0 additions & 74 deletions demo/play-demo.sh

This file was deleted.

Loading

0 comments on commit 64302be

Please sign in to comment.