Skip to content

Commit

Permalink
Add asciinema (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha authored and osterman committed May 16, 2018
1 parent e0f9b88 commit cfdfe46
Show file tree
Hide file tree
Showing 11 changed files with 4,305 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .snippets/hugo/docs.misc.snippet.cson
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
'docs:link':
'prefix': 'link'
'body': '[]({{< relref "" >}})'

'docs:asciinema':
'prefix': 'asciinema'
'body': '{{% asciinema "" %}}'
23 changes: 21 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export INSTALL_PATH ?= /usr/local/bin
export OS ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
export HUGO ?= hugo
export HUGO_VERSION ?= 0.40.2
export HUGO_URL ?= http://localhost.cloudposse.com:1313/
Expand All @@ -9,16 +10,35 @@ export HUGO_CONFIG ?= config.toml
export HUGO_PUBLISH_DIR ?= public
export PACKAGES_VERSION ?= 0.1.7
export HTMLTEST_LOG_LEVEL ?= 2

export ALGOLIA_INDEX_FILE ?= $(HUGO_PUBLISH_DIR)/index.algolia.json
export ALGOLIA_APPLICATION_INDEX ?= dev
export ALGOLIA_API_ENDPOINT ?= "https://$(ALGOLIA_APPLICATION_ID).algolia.net/1/indexes/$(ALGOLIA_APPLICATION_INDEX)"
#export ALGOLIA_API_ENDPOINT ?= "https://httpbin.org/post"

export ASCIINEMA_VERSION ?= 2.6.1

-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)

## Install OSX deps
deps-darwin:
brew install asciinema

## Install Linux deps
deps-linux:
@which pip3 >/dev/null || (echo "Install pip3 please"; exit 1)
pip3 install asciinema

## Install package dependencies
deps: packages/install/hugo \
deps: deps-$(OS) \
packages/install/hugo \
packages/install/htmltest
asciinema auth
@exit 0

deps/asciinema:
curl -sSL -o static/css/asciinema-player.css https://github.com/asciinema/asciinema-player/releases/download/v2.6.1/asciinema-player.css
curl -sSL -o static/js/asciinema-player.js https://github.com/asciinema/asciinema-player/releases/download/v2.6.1/asciinema-player.js

## Install useful atom plugins
deps/atom:
Expand All @@ -27,7 +47,6 @@ deps/atom:
modular-snippets \
language-hugo \
autocomplete-paths \
markdown-badges-snippets \
editorconfig \
linter-ui-default \
linter-markdown \
Expand Down
4 changes: 4 additions & 0 deletions codefresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ steps:
image: cloudposse/build-harness:${{BUILD_HARNESS_VERSION}}
working_directory: ./
commands:
# Install python3 to pass install deps asciinema
- apk add --no-cache python3
- make deps
- make release
- make build
Expand All @@ -36,6 +38,8 @@ steps:
environment:
- "HUGO_EDIT_BRANCH=${{CF_BRANCH}}"
commands:
# Install python3 to pass install deps asciinema
- apk add --no-cache python3
- make deps
- make smoketest

Expand Down
4 changes: 1 addition & 3 deletions content/geodesic/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ Geodesic provides a fully customizable framework for defining and building world

# Demo

{{% dialog type="info" icon="fa fa-info-circle" title="Important" %}} This demo is *very* out-of-date. {{% /dialog %}}

{{< img src="https://media.giphy.com/media/26FmS6BRnPVPo2FDq/source.gif" title="demo video" >}}
{{% asciinema src="/assets/geodesic-demo.cast" autoplay="true" title="Geodesic Demo" %}}

Geodesic is composed of two parts:

Expand Down
7 changes: 5 additions & 2 deletions layouts/partials/custom-footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<!-- Asciinema Player -->
<script src="/js/asciinema-player.js"></script>
<!-- Asciinema Player end -->

<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/2197148.js"></script>
Expand All @@ -22,12 +25,12 @@
</script>
<!-- Hotjar end -->



<!-- AddThis -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5ac3dab5d97449fa"></script>
<!-- AddThis end -->

<!-- Pingdom RUM -->
<script src="//rum-static.pingdom.net/pa-5acb059646534f0007000645.js" async></script>
<!-- Pingdom RUM end -->


4 changes: 4 additions & 0 deletions layouts/partials/custom-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch-theme-algolia.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

<!-- Asciinema Player -->
<link rel="stylesheet" type="text/css" href="/css/asciinema-player.css" />

5 changes: 5 additions & 0 deletions layouts/shortcodes/asciinema.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ if .IsNamedParams }}
<asciinema-player src="{{ .Get "src" }}" autoplay="{{ .Get "autoplay" | default "no" }}" rows="{{ .Get "rows" | default "24" }}" cols="{{ .Get "cols" | default "80" }}" loop="{{ .Get "loop" | default "no" }}" speed="{{ .Get "speed" | default "1" }}" idle-time-limit="{{ .Get "idle-time-limit" | default "2" }}" theme="{{ .Get "theme" | default "asciinema" }}" title="{{ .Get "title" }}" ></asciinema-player>
{{- else -}}
<asciinema-player src="{{ .Get 0 }}"></asciinema-player>
{{- end -}}
471 changes: 471 additions & 0 deletions static/assets/geodesic-demo.cast

Large diffs are not rendered by default.

Loading

0 comments on commit cfdfe46

Please sign in to comment.