From 137b8ec89ed1f4c073385a242b00d68f8b439900 Mon Sep 17 00:00:00 2001 From: Richard Willis Date: Sat, 15 Aug 2020 08:49:29 +0100 Subject: [PATCH] Add api docs generation script & template --- api/docs/generate-docs.sh | 23 +++++++++++++++++++++++ api/docs/template.hbs | 31 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100755 api/docs/generate-docs.sh create mode 100644 api/docs/template.hbs diff --git a/api/docs/generate-docs.sh b/api/docs/generate-docs.sh new file mode 100755 index 00000000..e7951d8a --- /dev/null +++ b/api/docs/generate-docs.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +# Requirements: +# - Node.js +# - redoc-cli (`npm install redoc-cli -g`) + +redoc-cli bundle ../mailinabox.yml \ + -t template.hbs \ + -o api-docs.html \ + --templateOptions.metaDescription="Mail-in-a-Box HTTP API" \ + --title="Mail-in-a-Box HTTP API" \ + --options.expandSingleSchemaField \ + --options.hideSingleRequestSampleTab \ + --options.jsonSampleExpandLevel=10 \ + --options.hideDownloadButton \ + --options.theme.logo.maxHeight=180px \ + --options.theme.logo.maxWidth=180px \ + --options.theme.colors.primary.main="#C52" \ + --options.theme.typography.fontSize=16px \ + --options.theme.typography.fontFamily="Raleway, sans-serif" \ + --options.theme.typography.headings.fontFamily="Ubuntu, Arial, sans-serif" \ + --options.theme.typography.code.fontSize=15px \ + --options.theme.typography.code.fontFamily='"Source Code Pro", monospace' \ No newline at end of file diff --git a/api/docs/template.hbs b/api/docs/template.hbs new file mode 100644 index 00000000..0de7d222 --- /dev/null +++ b/api/docs/template.hbs @@ -0,0 +1,31 @@ + + + + + + {{title}} + + + + + + + + + {{{redocHead}}} + + + + {{{redocHTML}}} + + +