From f71d6674a033b04a72fe1e1e9ccafdbace110087 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sun, 14 Aug 2022 09:48:02 +0800 Subject: Update --- tigrc | 2 +- tools/markdown/reveal | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tigrc b/tigrc index 3ca1720..b2c43c2 100644 --- a/tigrc +++ b/tigrc @@ -140,7 +140,7 @@ bind main p none # override default pager binding bind main pp ?git push bind main pP ?git push -u %(remote) %(branch):%(branch) bind main pr ?git push -u %(remote) %(branch):%(branch) -bind main pR ?git push -u '%(prompt Which remote? )':%(branch) +bind main pR ?git push -u '%(prompt Which remote? )' %(branch):'%(prompt Which branch? )' bind main pF ?git push --force bind main pd ?git push %(remote) :%(branch) bind generic pD ?git push '%(prompt Delete from which remote? )' :'%(prompt Which reference? )' diff --git a/tools/markdown/reveal b/tools/markdown/reveal index 17321d5..c6bf97b 100755 --- a/tools/markdown/reveal +++ b/tools/markdown/reveal @@ -1,6 +1,6 @@ #! /bin/bash -if [[ ! $1 =~ (.md|.slide)$ ]]; then +if [[ ! $1 =~ (.md|.slide)$ || ! -e $1 ]]; then echo markdown file is not given >&2 exit 1 fi @@ -26,12 +26,20 @@ THEME=${THEME:-serif} # tomorrow-night-bright vs2015 vs xcode xt256 HIGHLIGHT_THEME=${HIGHLIGHT_THEME:-base16/zenburn} + +if [[ $1 =~ / ]]; then + DIR="`dirname $1`" +else + DIR="`pwd`" +fi + +set -x docker run --rm \ -u `id -u`:`id -g` \ - -v `pwd`:/slides \ + -v "$DIR":/slides \ -p 1948:1948 \ webpronl/reveal-md:5.3.4 \ - $1 \ + `basename $1` \ --static /slides \ #--theme ${THEME} \ #--highlight-theme ${HIGHLIGHT_THEME} \ -- cgit v1.2.3-70-g09d2