diff --git a/README.rst b/README.rst index 33376f9..1eeb7db 100644 --- a/README.rst +++ b/README.rst @@ -4,19 +4,3 @@ Talks and Presentations by Oliver Davies For talk abstracts, event information, and links to video recordings and the generated slides, see my `talks page`_. .. _talks page: https://www.oliverdavies.uk/talks - -Watching for changes and automatically regenerating -=================================================== - -The easiest way to do this is using nodemon_:: - - nodemon \ - --ext rst,style,txt \ - --exec "rst2pdf slides.rst \ - --output slides.pdf \ - --stylesheets main \ - --break-level 1 \ - --fit-background-mode scale \ - --extension-module preprocess" - -.. _nodemon: https://nodemon.io diff --git a/workspace.yml b/workspace.yml new file mode 100644 index 0000000..9089932 --- /dev/null +++ b/workspace.yml @@ -0,0 +1,45 @@ +workspace('talks'): + description: 'My slide decks' + +attributes: + rst2pdf: + command: | + = 'rst2pdf ' ~ @('rst2pdf.filename.rst') ~ ' + --break-level 1 + --stylesheets main + --fit-background-mode scale + --extension-module preprocess + --output ' ~ @('rst2pdf.filename.pdf') + filename: + pdf: slides.pdf + rst: slides.rst + thumbnail: + filename: thumbnail.png + +command('clean all'): + env: + PDF_FILENAME: = @('rst2pdf.filename.pdf') + RST_FILENAME: = @('rst2pdf.filename.rst') + THUMBNAIL_FILENAME: = @('thumbnail.filename') + exec: | + #!bash + run "find . -type f \( -name '$PDF_FILENAME*' -o -name $RST_FILENAME.build_temp -o -name $THUMBNAIL_FILENAME \) -delete" + +command('pdf generate '): | + #!bash|= + cd ={ input.argument('talk') } + passthru ={ @('rst2pdf.command') } + +command('pdf watch '): | + #!bash|= + cd ={ input.argument('talk') } + passthru nodemon -e rst,style,txt -x "={ @('rst2pdf.command') }" + +command('thumbnail '): + env: + PDF_FILENAME: = @('rst2pdf.filename.pdf') + THUMBNAIL_FILENAME: = @('thumbnail.filename') + exec: | + #!bash|= + cd ={ input.argument('talk') } + passthru gs -sDEVICE=png16m -r300 -dDownScaleFactor=4 -sOutputFile=$THUMBNAIL_FILENAME -dLastPage=1 $PDF_FILENAME