Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Commit

Permalink
Update templates and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nbedos committed Aug 5, 2018
1 parent 8e12a47 commit bf59a4b
Show file tree
Hide file tree
Showing 46 changed files with 427 additions and 1,824 deletions.
24 changes: 11 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: usage tests venv_dev xresources build deploy_test deploy_prod examples
.PHONY: usage tests venv_dev xresources build deploy_test deploy_prod static

VENV_PATH=.venv
VENV_ACTIVATE=. $(VENV_PATH)/bin/activate
Expand All @@ -13,7 +13,7 @@ usage:
@echo " make build # Build source distribution archives"
@echo " make deploy_prod # Upload source distribution archives to pypi.org"
@echo " make deploy_test # Upload source distribution archives to test.pypi.org"
@echo " make examples # Render example SVG animations"
@echo " make static # Render example SVG animations"
@echo " make tests # Run unit tests"

build: tests
Expand Down Expand Up @@ -43,17 +43,15 @@ venv_dev: setup.py
$(VENV_ACTIVATE) && \
pip install -U -e .[dev]

examples:
static:
(test -d $(VENV_PATH) || python -m venv $(VENV_PATH))
$(VENV_ACTIVATE) && \
for cast_file in $$(find $(CASTS_DIR) -name '*.cast'); do \
svg_file="$(EXAMPLES_DIR)/$$(basename --suffix=.cast $$cast_file).svg" && \
termtosvg render "$$cast_file" "$$svg_file" --template window_frame; \
done && \
for template in $$(find $(TEMPLATES_DIR) -name '*.svg'); do \
svg_file="$(EXAMPLES_DIR)/awesome_$$(basename --suffix=.svg $$template).svg" && \
termtosvg render examples/casts/awesome.cast "$$svg_file" -t "$$template"; \
done;


rm -r examples/*.svg && \
termtosvg render $(CASTS_DIR)/awesome.cast $(EXAMPLES_DIR)/awesome_window_frame_js.svg -t window_frame_js && \
termtosvg render $(CASTS_DIR)/colors.cast $(EXAMPLES_DIR)/colors_progress_bar.svg -t progress_bar && \
termtosvg render $(CASTS_DIR)/htop.cast $(EXAMPLES_DIR)/htop_gjm8.svg -t gjm8 && \
termtosvg render $(CASTS_DIR)/ipython.cast $(EXAMPLES_DIR)/ipython_window_frame.svg -t window_frame && \
termtosvg render $(CASTS_DIR)/unittest.cast $(EXAMPLES_DIR)/unittest_solarized_dark.svg -t solarized_dark
rm -rf docs/examples/ && mkdir docs/examples && cp examples/*.svg docs/examples/
rm -rf docs/templates/ && cp -r termtosvg/data/templates docs/

12 changes: 12 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: static

.DEFAULT: usage

usage:
@echo "Usage:"
@echo " make static # Import static data from other directories"

static:
rm -rf examples/ && mkdir examples && cp ../examples/*.svg examples/
rm -rf templates/ && cp -r ../termtosvg/data/templates .

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 38 additions & 25 deletions docs/templates/colors.svg → docs/examples/colors_progress_bar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 20 additions & 25 deletions docs/templates/htop.svg → docs/examples/htop_gjm8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
47 changes: 21 additions & 26 deletions examples/unittest.svg → docs/examples/unittest_solarized_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1><a href="index.html">termtosvg</a></h1>
<li><a href="pages/examples.html">examples</a></li>
<li><a href="pages/templates.html">templates</a></li>
<li><a href="https://github.com/nbedos/termtosvg/blob/master/man/termtosvg.md">manual</a></li>
<li><a href="https://github.com/nbedos/termtosvg">source</a></li>
<li><a href="https://github.com/nbedos/termtosvg">github</a></li>
</ul>
</nav>
</header><!-- /#banner -->
Expand All @@ -31,7 +31,7 @@ <h2>Features</h2>
</ul>

<p align="center">
<object data="templates/awesome_window_frame_js.svg" width="80%"></object>
<object data="examples/awesome_window_frame_js.svg" width="80%"></object>
</p>

<h2>Install</h2>
Expand Down
28 changes: 27 additions & 1 deletion docs/pages/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,39 @@ <h1><a href="../index.html">termtosvg</a></h1>
<li class="active"><a href="examples.html">examples</a></li>
<li><a href="templates.html">templates</a></li>
<li><a href="https://github.com/nbedos/termtosvg/blob/master/man/termtosvg.md">manual</a></li>
<li><a href="https://github.com/nbedos/termtosvg">source</a></li>
<li><a href="https://github.com/nbedos/termtosvg">github</a></li>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<h1 class="entry-title">examples</h1>

<p>Here are examples of recordings made by termtosvg.</p>

<h2>termtosvg command line session (window_frame_js template)</h2>
<p align="center">
<object data="../examples/awesome_window_frame_js.svg"></object>
</p>

<h2>Color support (progress_bar template)</h2>
<p align="center">
<object data="../examples/colors_progress_bar.svg"></object>
</p>

<h2>htop (gjm8 template)</h2>
<p align="center">
<object data="../examples/htop_gjm8.svg"></object>
</p>

<h2>IPython session (window_frame template)</h2>
<p align="center">
<object data="../examples/ipython_window_frame.svg"></object>
</p>

<h2>Python unittest session (solarized_dark template)</h2>
<p align="center">
<object data="../examples/unittest_solarized_dark.svg"></object>
</p>

</section>
<section id="extras" class="body">
</section><!-- /#extras -->
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1><a href="../index.html">termtosvg</a></h1>
<li class="active"><a href="templates.html">templates</a></li>
<li>
<a href="https://github.com/nbedos/termtosvg/blob/master/man/termtosvg.md">manual</a>
<li><a href="https://github.com/nbedos/termtosvg">source</a></li>
<li><a href="https://github.com/nbedos/termtosvg">github</a></li>
</ul>
</nav>
</header><!-- /#banner -->
Expand Down
48 changes: 0 additions & 48 deletions docs/templates/awesome_window_frame.svg

This file was deleted.

95 changes: 0 additions & 95 deletions docs/templates/casts/awesome.cast

This file was deleted.

Loading

0 comments on commit bf59a4b

Please sign in to comment.