docs: Generate API documentation for release branch (#9081)

This commit is contained in:
Diamond Lewis
2024-04-13 15:36:29 -05:00
committed by GitHub
parent 2532acfce8
commit bceb621a32
2 changed files with 17 additions and 10 deletions

View File

@@ -29,7 +29,7 @@
"template": "./node_modules/clean-jsdoc-theme",
"theme_opts": {
"default_theme": "dark",
"title": "<img src='../.github/parse-server-logo.png' class='logo'/>",
"title": "<img src='https://raw.githubusercontent.com/parse-community/parse-server/alpha/.github/parse-server-logo.png' class='logo'/>",
"create_style": "header, .sidebar-section-title, .sidebar-title { color: #139cee !important } .logo { margin-left : 40px; margin-right: 40px }"
}
},

View File

@@ -1,10 +1,17 @@
#!/bin/sh -e
set -x
# GITHUB_ACTIONS=true SOURCE_TAG=test ./release_docs.sh
if [ "${GITHUB_ACTIONS}" = "" ];
then
echo "Cannot release docs without GITHUB_ACTIONS set"
exit 0;
fi
if [ "${SOURCE_TAG}" = "" ];
then
echo "Cannot release docs without SOURCE_TAG set"
exit 0;
fi
REPO="https://github.com/parse-community/parse-server"
rm -rf docs
@@ -13,20 +20,20 @@ cd docs
git pull origin gh-pages
cd ..
DEST="master"
RELEASE="release"
VERSION="${SOURCE_TAG}"
if [ "${SOURCE_TAG}" != "" ];
then
DEST="${SOURCE_TAG}"
# change the default page to the latest
echo "<meta http-equiv='refresh' content='0; url=/parse-server/api/${DEST}'>" > "docs/api/index.html"
fi
echo "<meta http-equiv='refresh' content='0; url=/parse-server/api/${VERSION}'>" > "docs/api/index.html"
npm run definitions
npm run docs
mkdir -p "docs/api/${DEST}"
cp -R out/* "docs/api/${DEST}"
mkdir -p "docs/api/${RELEASE}"
cp -R out/* "docs/api/${RELEASE}"
mkdir -p "docs/api/${VERSION}"
cp -R out/* "docs/api/${VERSION}"
# Copy other resources
RESOURCE_DIR=".github"