Skip to content

Commit

Permalink
chore: update api to markdown command
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed May 18, 2022
1 parent 5704f3f commit 35347a2
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions generate-api-doc-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@

set -e

declare -r TMP_FOLDER='../discue-io-api-docs-next/./tmp'
declare -r INTERMEDIATE_FILE="${TMP_FOLDER}/api-endpoints-intermediate.md"
declare -r ENVIRONMENT_FILE="../discue-io-api-docs-next/generate-api-doc.config.json"
declare -r TEMPLATE_FOLDER="../discue-io-api-docs-next/templates"
declare -r INTERMEDIATE_FILE="../discue-io-api-docs/docs/api-reference"
declare -r ENVIRONMENT_FILE="../discue-io-api-docs/generate-api-doc.config.json"
declare -r TEMPLATE_FOLDER="../discue-io-api-docs/templates"

declare -r API_INPUT_FILE="../discue-io-api-docs-next/api.yaml"
declare -r API_INPUT_FILE="../discue-io-api/api.yaml"

declare -r FINAL_TITLE="Reference"
declare -r FINAL_FILE_PATH="../discue-io-api-docs-next/docs/api-reference/README.md"

mkdir -p "${TMP_FOLDER}"

cd ../widdershins && node widdershins -e "${ENVIRONMENT_FILE}" -o "${INTERMEDIATE_FILE}" -u "${TEMPLATE_FOLDER}" "${API_INPUT_FILE}" \
&& sed -i "s/title: .*/title: ${FINAL_TITLE}/" "${INTERMEDIATE_FILE}" \
&& cp ./"${INTERMEDIATE_FILE}" ${FINAL_FILE_PATH}

rm -rf "${TMP_FOLDER}"
cd ../widdershins && node widdershins -e "${ENVIRONMENT_FILE}" -o "${INTERMEDIATE_FILE}" -u "${TEMPLATE_FOLDER}" "${API_INPUT_FILE}"

0 comments on commit 35347a2

Please sign in to comment.