diff --git a/examples/pandoc.kapow b/examples/pandoc.kapow new file mode 100644 index 0000000..dc458ba --- /dev/null +++ b/examples/pandoc.kapow @@ -0,0 +1,31 @@ +POST /convert/{from}/pdf { + tmpfile=$(mktemp --suffix=.pdf) + pandoc --from=@value:request/match/from \ + --to=pdf \ + --output=${tmpfile} \ + -t latex \ + @file:request/body + if [ $? -eq 0 ]; then + cat ${tmpfile} > @fifo:response/body + echo "application/pdf" > @fifo:response/header/Content-Type + echo 200 > @fifo:response/status + else + echo 500 > @fifo:response/status + fi + rm -f ${tmpfile} +} + +POST /convert/{from}/{to} { + pandoc --from=@value:request/match/from \ + --to=@value:request/match/to \ + --output=@fifo:response/body \ + @file:request/body +} + +GET /formats/input { + pandoc --list-input-formats > @fifo:response/body +} + +GET /formats/output { + pandoc --list-output-formats | grep -v pdf > @fifo:response/body +} diff --git a/examples/pdfeditor/pdfeditor.html b/examples/pdfeditor/pdfeditor.html new file mode 100644 index 0000000..378898b --- /dev/null +++ b/examples/pdfeditor/pdfeditor.html @@ -0,0 +1,41 @@ + +
+