Created
September 12, 2013 09:28
-
-
Save ritalin/6534954 to your computer and use it in GitHub Desktop.
PowerShell script for converting Reveal.js output by pandoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: <source-path> | md2reveal [-block <script-block>] | |
[CmdletBinding()] | |
param( | |
[parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$source, | |
[scriptblock]$block | |
) | |
if ($block -eq $null) { | |
$block = { $_ | out-file -encoding utf8 ([IO.Path]::ChangeExtension($source, 'html')) | out-null } | |
} | |
$file = Split-Path $myInvocation.MyCommand.path | |
$output = pandoc --section-divs -t html5 -s --template $file\templates\reveal.js\template-revealjs.html $source | |
(,$output) | %{ &$block } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment