Skip to content

Commit

Permalink
docs: Generate API documentation for release branch (#9081)
Browse files Browse the repository at this point in the history
  • Loading branch information
dplewis authored Apr 13, 2024
1 parent 2532acf commit bceb621
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jsdoc-conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 }"
}
},
Expand Down
25 changes: 16 additions & 9 deletions release_docs.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
# change the default page to the latest
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"
Expand Down

0 comments on commit bceb621

Please sign in to comment.