Renamed examples.
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user