Skip to content

Commit

Permalink
generate list of postman collections documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
debbabi committed Nov 9, 2017
1 parent e67b170 commit 80ceedf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN apt-get update \

RUN pip install WeasyPrint

ENV REFRESHED_AT 20170919_1021
ENV REFRESHED_AT 20171003_1100

COPY callpostmanerator.sh /root
COPY ./theme/cohorte /root/.postmanerator/themes/cohorte
Expand Down
31 changes: 26 additions & 5 deletions callpostmanerator.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
#! /bin/sh

mkdir -p /usr/var/assets
mkdir -p /usr/var/fonts
cp -rf /root/.postmanerator/themes/cohorte/assets/* /usr/var/assets/.
cp -rf /root/.postmanerator/themes/cohorte/fonts/* /usr/var/fonts/.
postmanerator $@
mkdir -p /usr/var/docs/assets
mkdir -p /usr/var/docs/fonts
cp -rf /root/.postmanerator/themes/cohorte/assets/* /usr/var/docs/assets/.
cp -rf /root/.postmanerator/themes/cohorte/fonts/* /usr/var/docs/fonts/.

echo "<html><head><title>REST API Documentation</title></head><body>" > /usr/var/docs/index.html
echo "<h2>REST API Documentation</h2><ul>" >> /usr/var/docs/index.html

ENVIRONMENT=$(cat /usr/var/environments/environment.txt)
COLLECTIONS_FILE="/usr/var/collections/collections.txt"
while read line
do
[ -z "$line" ] && continue
echo "Reading collection: $line"
postmanerator \
-theme "cohorte" \
-collection /usr/var/collections/${line}.json \
-environment /usr/var/environments/${ENVIRONMENT}.json \
-output /usr/var/docs/${line}.html \
$@
echo "<li><a href='${line}.html'>${line}</a></li>" >> /usr/var/docs/index.html
done < $COLLECTIONS_FILE

echo "</ul>" >> /usr/var/docs/index.html
echo "</body>" >> /usr/var/docs/index.html

#weasyprint /usr/var/*.html /usr/var/output.pdf
6 changes: 0 additions & 6 deletions theme/cohorte/bootstrap.min.css

This file was deleted.

7 changes: 0 additions & 7 deletions theme/cohorte/bootstrap.min.js

This file was deleted.

0 comments on commit 80ceedf

Please sign in to comment.