Skip to content

Commit

Permalink
[Fix-16690] Fix some docs of join directory is not reflected in the d…
Browse files Browse the repository at this point in the history
…ocument (#966)
  • Loading branch information
SbloodyS authored Oct 14, 2024
1 parent d386be7 commit 2b675b4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 118 deletions.
2 changes: 1 addition & 1 deletion blog/en-us/Apache_dolphinScheduler_3.0.0_alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ In versions prior to 3.0.0-alpha, Apache DolphinScheduler defaulted to the UTC+8

</div>

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

Expand Down
2 changes: 1 addition & 1 deletion blog/zh-cn/Apache_dolphinScheduler_3.0.0_alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Amazon Redshift 支持

</div>

详见链接:[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)

### 任务定义列表

Expand Down
72 changes: 0 additions & 72 deletions config/contribution_menu.js

This file was deleted.

1 change: 1 addition & 0 deletions scripts/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
49 changes: 7 additions & 42 deletions scripts/generate_docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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, "");

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = [];
Expand All @@ -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);

Expand Down
6 changes: 5 additions & 1 deletion scripts/rsync_content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/views/Documentation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ const Documentation = () => {
<div className="documentation-sider-title">{t("select_version")}</div>
<Select
className="documentation-sider-select"
defaultValue={params.version}
defaultValue={versions[1]}
options={versions.map((version) => ({
label: version,
value: version,
}))}
onChange={(value) => {
navigate(`/${locale}/docs/${value}`);
}}
showSearch
/>
<Button
className="documentation-sider-download"
Expand Down

0 comments on commit 2b675b4

Please sign in to comment.