This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new 90c3156126d Cleanup legacy scripts to generate API docs (#289)
90c3156126d is described below
commit 90c3156126dea2f708454e0ccacff033caffd5c3
Author: tison <[email protected]>
AuthorDate: Tue Nov 15 19:41:15 2022 +0800
Cleanup legacy scripts to generate API docs (#289)
Signed-off-by: tison <[email protected]>
---
site2/tools/build-site.sh | 1 -
site2/tools/doxygen-doc-gen.sh | 37 ---------------
site2/tools/generate-api-docs.sh | 37 ---------------
site2/website-next/scripts/write-redirect.js | 71 ----------------------------
4 files changed, 146 deletions(-)
diff --git a/site2/tools/build-site.sh b/site2/tools/build-site.sh
index 0174a6175ae..5a061ea1d6d 100755
--- a/site2/tools/build-site.sh
+++ b/site2/tools/build-site.sh
@@ -30,7 +30,6 @@ GEN_SITE_DIR=${ROOT_DIR}/generated-site
VERSION=next
export NODE_OPTIONS="--max-old-space-size=16000"
-"$TOOLS_DIR"/generate-api-docs.sh
# Generate document for command line tools.
"$TOOLS_DIR"/pulsar-admin-doc-gen.sh "$WEBSITE_DIR" "$VERSION"
diff --git a/site2/tools/doxygen-doc-gen.sh b/site2/tools/doxygen-doc-gen.sh
deleted file mode 100755
index 0dbd9d7cd45..00000000000
--- a/site2/tools/doxygen-doc-gen.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-set -x -e
-
-ROOT_DIR=$(git rev-parse --show-toplevel)
-VERSION=$("$ROOT_DIR/src/get-project-version.py")
-DOXYGEN=doxygen
-
-mkdir -p "$ROOT_DIR/generated-site/api/cpp"
-
-(
- cd "$ROOT_DIR/pulsar-client-cpp"
- "$DOXYGEN" Doxyfile
-)
-
-# Latest docs in html dir
-cp -r "$ROOT_DIR/target/doxygen/html" "$ROOT_DIR/generated-site/api/cpp/"
-# Versioned docs in VERSION dir
-mv "$ROOT_DIR/target/doxygen/html" "$ROOT_DIR/generated-site/api/cpp/$VERSION"
diff --git a/site2/tools/generate-api-docs.sh b/site2/tools/generate-api-docs.sh
deleted file mode 100755
index 178df0ba0a0..00000000000
--- a/site2/tools/generate-api-docs.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-SCRIPT_DIR=`dirname "$0"`
-cd $SCRIPT_DIR
-
-ROOT_DIR=$(git rev-parse --show-toplevel)
-VERSION=`${ROOT_DIR}/src/get-project-version.py`
-
-set -x -e
-
-cd ${ROOT_DIR}
-mkdir -p site2/website/static/swagger/${VERSION}
-cp pulsar-broker/target/docs/*.json site2/website/static/swagger/${VERSION}/
-
-SCRIPT_DIR=`dirname "$0"`
-
-cd $SCRIPT_DIR
-
-# ./doxygen-doc-gen.sh
diff --git a/site2/website-next/scripts/write-redirect.js
b/site2/website-next/scripts/write-redirect.js
deleted file mode 100644
index 1c1a292ef52..00000000000
--- a/site2/website-next/scripts/write-redirect.js
+++ /dev/null
@@ -1,71 +0,0 @@
-const fs = require("fs");
-const path = require("path");
-const mkdirp = require("mkdirp");
-
-let versions = require("../versions.json");
-const latestVersion = versions[0];
-versions.push("next");
-const locales = ["en", "zh-CN", "zh-TW", "ja", "ko", "fr"];
-
-function _template(locale, version, docsId) {
- locale = locale == "en" ? "" : "/" + locale;
- version = version ? "/" + version : "";
- const tmp = `<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="refresh" content="0;
url=${locale}/docs${version}/${docsId}">
- <link rel="canonical" href="${locale}/docs${version}/${docsId}" />
- </head>
- <script>
- window.location.href = '${locale}/docs${version}/${docsId}';
- </script>
-</html>`;
- return tmp;
-}
-
-for (let locale of locales) {
- for (let version of versions) {
- if (version == latestVersion) {
- version = "";
- }
- let dir = path.join(__dirname, "../build/docs/" + version);
- let docsList = fs.readdirSync(dir);
- for (let filename of docsList) {
- if (/((\d\.?)+)|next/gm.exec(filename)) {
- continue;
- }
- let _continue = false;
- for (let _locale of locales) {
- let reg = new RegExp("^" + _locale + "$");
- if (reg.exec(filename)) {
- _continue = true;
- break;
- }
- }
- if (_continue) {
- continue;
- }
- if (!filename.endsWith(".md")) {
- continue;
- }
- let docsId = filename.substring(0, filename.indexOf(".md"));
- let destDir = path.join(
- __dirname,
- "../build",
- "docs",
- locale,
- version,
- docsId
- );
- if (!fs.existsSync(destDir)) {
- mkdirp.sync(destDir);
- }
- console.log(path.join(destDir, "index.html"));
- fs.writeFileSync(
- path.join(destDir, "index.html"),
- _template(locale, version, docsId)
- );
- }
- }
-}