From 2b675b4f31a7e4f616eaf98fa0d69baa94ccac25 Mon Sep 17 00:00:00 2001 From: xiangzihao <460888207@qq.com> Date: Mon, 14 Oct 2024 15:00:22 +0800 Subject: [PATCH] [Fix-16690] Fix some docs of join directory is not reflected in the document (#966) --- .../Apache_dolphinScheduler_3.0.0_alpha.md | 2 +- .../Apache_dolphinScheduler_3.0.0_alpha.md | 2 +- config/contribution_menu.js | 72 ------------------- scripts/conf.sh | 1 + scripts/generate_docs.js | 49 ++----------- scripts/rsync_content.sh | 6 +- src/views/Documentation/index.jsx | 3 +- 7 files changed, 17 insertions(+), 118 deletions(-) delete mode 100644 config/contribution_menu.js diff --git a/blog/en-us/Apache_dolphinScheduler_3.0.0_alpha.md b/blog/en-us/Apache_dolphinScheduler_3.0.0_alpha.md index c954677ff6c..a2a1c282f6b 100644 --- a/blog/en-us/Apache_dolphinScheduler_3.0.0_alpha.md +++ b/blog/en-us/Apache_dolphinScheduler_3.0.0_alpha.md @@ -154,7 +154,7 @@ In versions prior to 3.0.0-alpha, Apache DolphinScheduler defaulted to the UTC+8 -See link: [https://dolphinscheduler.apache.org/zh-cn/docs/3.0.0/guide/howto/general-setting](https://dolphinscheduler.apache.org/zh-cn/docs/3.0.0/guide/howto/general-setting) +See link: [general-setting](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/guide/installation/general-setting.md) ### 07 List of task definitions diff --git a/blog/zh-cn/Apache_dolphinScheduler_3.0.0_alpha.md b/blog/zh-cn/Apache_dolphinScheduler_3.0.0_alpha.md index b242e069c22..f86ea93d381 100644 --- a/blog/zh-cn/Apache_dolphinScheduler_3.0.0_alpha.md +++ b/blog/zh-cn/Apache_dolphinScheduler_3.0.0_alpha.md @@ -161,7 +161,7 @@ Amazon Redshift 支持 -详见链接:[https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/zh/guide/howto/general-setting.md](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/zh/guide/howto/general-setting.md) +详见链接:[general-setting](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/zh/guide/installation/general-setting.md) ### 任务定义列表 diff --git a/config/contribution_menu.js b/config/contribution_menu.js deleted file mode 100644 index bd70fa490e4..00000000000 --- a/config/contribution_menu.js +++ /dev/null @@ -1,72 +0,0 @@ -module.exports = (lang) => { - return { - "en-us": { - title: "Contribution", - children: [ - { - title: "SPI", - children: [ - { - title: "Alert SPI", - link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/alert.html`, - }, - { - title: "Datasource SPI", - link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/datasource.html`, - }, - { - title: "Registry SPI", - link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/registry.html`, - }, - { - title: "Task SPI", - link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/task.html`, - }, - ], - }, - { - title: "Development Environment Setup", - link: `/en-us/docs/${lang}/user_doc/contribute/development-environment-setup.html`, - }, - { - title: "Frontend Development", - link: `/en-us/docs/${lang}/user_doc/contribute/frontend-development.html`, - }, - ], - }, - "zh-cn": { - title: "贡献指南", - children: [ - { - title: "SPI", - children: [ - { - title: "Alert SPI", - link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/alert.html`, - }, - { - title: "Datasource SPI", - link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/datasource.html`, - }, - { - title: "Registry SPI", - link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/registry.html`, - }, - { - title: "Task SPI", - link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/task.html`, - }, - ], - }, - { - title: "环境搭建", - link: `/zh-cn/docs/${lang}/user_doc/contribute/development-environment-setup.html`, - }, - { - title: "前端开发", - link: `/zh-cn/docs/${lang}/user_doc/contribute/frontend-development.html`, - }, - ], - }, - }; -}; diff --git a/scripts/conf.sh b/scripts/conf.sh index 1c1c1013879..d653fa3bac6 100644 --- a/scripts/conf.sh +++ b/scripts/conf.sh @@ -49,6 +49,7 @@ declare -a HISTORY_DOCS_VERSIONS=( DEV_RELEASE_DOCS_VERSIONS=( # The key value is represents of, `key` for document version and `val` for source branch apache/dolphinscheduler. # example: "key:val" + "dev:dev" "3.0.0:3.0.0-release" "3.0.1:3.0.1-release" "3.0.2:3.0.2-release" diff --git a/scripts/generate_docs.js b/scripts/generate_docs.js index 3eb91d63d00..5b438bdb316 100644 --- a/scripts/generate_docs.js +++ b/scripts/generate_docs.js @@ -23,11 +23,14 @@ const docSearchData = { }; const getVersion = (name) => { + if (name === "docsdev") { + return "dev"; + } const result = name.match(/(\d+)-(\d+)-(\d+)/); return result[1] + "." + result[2] + "." + result[3]; }; -const formateFile = (filePath) => { +const formatFile = (filePath) => { const fileContent = fs.readFileSync(filePath); const formatContent = fileContent .toString() @@ -105,13 +108,12 @@ const getMenu = (list, data, version, lang, isDeployment, location) => { } if (item.link && item.link.includes(version)) { - const baseLink = item.link.split(version)[1]; + const baseLink = item.link.replace(version, "|").split("|")[1]; temp.key = baseLink.replace(/.html/, "").replace(/\/user_doc/, ""); const mdPath = `${BASE}/docs/${lang}/${version}${baseLink.replace( /.html/, ".md" )}`; - const mdInfo = parseMd(mdPath, lang, version); const onlyText = mdInfo["__html"].replace(/<.*?>/g, ""); @@ -168,7 +170,7 @@ const getMenu = (list, data, version, lang, isDeployment, location) => { temp.children, version, lang, - ["部署指南", "集成", "Installation", "integration"].includes( + ["部署指南", "集成", "贡献指南", "Installation", "integration", "Contribution"].includes( item.title ), temp.location @@ -229,28 +231,10 @@ const writeSearchDocData = () => { const parseDocsMenu = () => { const sourcePath = BASE + "/config/docs"; const docs = fs.readdirSync(sourcePath); - const excludeContributionVersions = [ - "1.2.0", - "1.2.1", - "1.3.1", - "1.3.2", - "1.3.3", - "1.3.4", - "1.3.5", - "1.3.6", - "1.3.8", - "1.3.9", - "2.0.0", - "2.0.1", - "2.0.2", - "2.0.3", - "2.0.5", - "2.0.6", - ]; docs.forEach((doc) => { const filePath = path.join(sourcePath, doc); const fileInfo = path.parse(filePath); - formateFile(filePath); + formatFile(filePath); const fileContent = require(`${filePath}`); const enUs = []; const zhCn = []; @@ -260,25 +244,6 @@ const parseDocsMenu = () => { const enMenu = fileContent["en-us"].sidemenu; const zhMenu = fileContent["zh-cn"].sidemenu; - if (!excludeContributionVersions.includes(version)) { - const contributionMenuFn = require(`${BASE}/config/contribution_menu.js`); - if (contributionMenuFn && typeof contributionMenuFn === "function") { - const contributionMenu = contributionMenuFn(version); - enMenu.some((item, index) => { - return ( - item.title === "Contribution" && - (enMenu[index] = contributionMenu["en-us"]) - ); - }); - zhMenu.some((item, index) => { - return ( - item.title === "贡献指南" && - (zhMenu[index] = contributionMenu["zh-cn"]) - ); - }); - } - } - getMenu(enMenu, enUs, version, "en-us", false); getMenu(zhMenu, zhCn, version, "zh-cn", false); diff --git a/scripts/rsync_content.sh b/scripts/rsync_content.sh index ffff62c1e1e..dc3af72594c 100644 --- a/scripts/rsync_content.sh +++ b/scripts/rsync_content.sh @@ -94,7 +94,11 @@ function rsync_released_docs() { echo " ---> Git checkout to version ${version}." git fetch origin "${branch}" --no-tags - git checkout -b "${version}" FETCH_HEAD + if [ "${version}" == "dev" ]; then + git checkout "${version}" + else + git checkout -b "${version}" FETCH_HEAD + fi echo " ---> Sync released version ${version} docs." rsync_wrapper "${PROJECT_DIR}/docs/docs/en" "${PROJECT_SITE_DOC_DIR}/en-us/${version}/user_doc" "--exclude=history-versions.md --exclude=development" diff --git a/src/views/Documentation/index.jsx b/src/views/Documentation/index.jsx index 1d13b54b828..5568cc85068 100644 --- a/src/views/Documentation/index.jsx +++ b/src/views/Documentation/index.jsx @@ -53,7 +53,7 @@ const Documentation = () => {
{t("select_version")}