Skip to content

Commit

Permalink
refactor load doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sollhui committed Dec 26, 2024
1 parent 42c3982 commit ab8a525
Show file tree
Hide file tree
Showing 705 changed files with 61,992 additions and 17,129 deletions.
2 changes: 0 additions & 2 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ github:
issues: true

collaborators:
- jeffreys-cat
- KassieZ
- wangtianyi2004

notifications:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron-deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Cron Deploy

on:
schedule:
- cron: '0 4,10,17 * * *' # UTC time
- cron: '0 * * * *' # Runs every hour.
permissions: write-all
jobs:
build-and-deploy:
Expand Down
86 changes: 86 additions & 0 deletions check_all_deadlink.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# 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.

import re
import os
from urllib.parse import urlparse


def process_md_file(file_path):
link_pattern = re.compile(r"\[.*?\]\((.*?)\)")
code_block_pattern = re.compile(r"^```.*$")

with open(file_path, "r", encoding="utf-8") as f:
content = f.read()

lines = content.splitlines()
in_code_block = False

for line_number, line in enumerate(lines, start=1):
# Skip codeblocks
if code_block_pattern.match(line):
in_code_block = not in_code_block
continue

if in_code_block:
continue

links = link_pattern.findall(line)

for link in links:
# Skip urls
if (
not urlparse(link).scheme
and not os.path.isabs(link)
and not (link[0] == "#")
):
full_path = os.path.normpath(
os.path.join(os.path.dirname(file_path), link)
)

# Skip section headers
if "#" in full_path:
full_path = full_path.split("#", 1)[0]

if not full_path.endswith(".md") and not full_path.endswith(".mdx"):
full_path += ".md"
md_exists = os.path.exists(full_path)
mdx_exists = (
os.path.exists(full_path[:-3] + ".mdx")
if full_path.endswith(".md")
else False
)

if not md_exists and not mdx_exists:
print(
f"Error: File not found for link '{link}' in file '{file_path}:{line_number}'"
)


def travel(root_path: str):
for root, dirs, files in os.walk(root_path):
for file in files:
if file.endswith(".md") or file.endswith(".mdx"):
md_file_path = os.path.join(root, file)
process_md_file(md_file_path)


if __name__ == "__main__":
# check docs directories
travel("docs")
travel("i18n")
travel("versioned_docs")
7 changes: 4 additions & 3 deletions check_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ def process_md_file(file_path):
full_path += ".md"

for [from_path, to_path] in move_pairs:
# Skip change of suffix
from_base, from_ext = os.path.splitext(from_path)
to_base, to_ext = os.path.splitext(to_path)
if (from_ext in [".md", ".mdx"] and to_ext in [".md", ".mdx"]) and (
from_base == to_base
):
if (
from_ext in [".md", ".mdx", ""] or to_ext in [".md", ".mdx", ""]
) and (from_base == to_base):
continue
# In md, the link relative path starts from the directory where the document is located, not the document
relative_to_path = os.path.relpath(
Expand Down
22 changes: 11 additions & 11 deletions docs/admin-manual/auth/encryption-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ under the License.

Doris provides the following built-in encryption and masking functions. For detailed usage, please refer to the SQL manual.

- [AES_ENCRYPT](../sql-manual/sql-functions/encrypt-digest-functions/aes-encrypt)
- [AES_DECRYPT](../sql-manual/sql-functions/encrypt-digest-functions/aes-decrypt)
- [SM4_ENCRYPT](../sql-manual/sql-functions/encrypt-digest-functions/sm4-encrypt)
- [SM4_DECRYPT](../sql-manual/sql-functions/encrypt-digest-functions/sm4-decrypt)
- [MD5](../sql-manual/sql-functions/encrypt-digest-functions/md5)
- [MD5SUM](../sql-manual/sql-functions/encrypt-digest-functions/md5sum)
- [SM3](../sql-manual/sql-functions/encrypt-digest-functions/sm3)
- [SM3SUM](../sql-manual/sql-functions/encrypt-digest-functions/sm3sum)
- [SHA](../sql-manual/sql-functions/encrypt-digest-functions/sha)
- [SHA2](../sql-manual/sql-functions/encrypt-digest-functions/sha2)
- [DIGITAL_MASKING](../sql-manual/sql-functions/digital-masking)
- [AES_ENCRYPT](../../sql-manual/sql-functions/encrypt-digest-functions/aes-encrypt)
- [AES_DECRYPT](../../sql-manual/sql-functions/encrypt-digest-functions/aes-decrypt)
- [SM4_ENCRYPT](../../sql-manual/sql-functions/encrypt-digest-functions/sm4-encrypt)
- [SM4_DECRYPT](../../sql-manual/sql-functions/encrypt-digest-functions/sm4-decrypt)
- [MD5](../../sql-manual/sql-functions/encrypt-digest-functions/md5)
- [MD5SUM](../../sql-manual/sql-functions/encrypt-digest-functions/md5sum)
- [SM3](../../sql-manual/sql-functions/encrypt-digest-functions/sm3)
- [SM3SUM](../../sql-manual/sql-functions/encrypt-digest-functions/sm3sum)
- [SHA](../../sql-manual/sql-functions/encrypt-digest-functions/sha)
- [SHA2](../../sql-manual/sql-functions/encrypt-digest-functions/sha2)
- [DIGITAL_MASKING](../../sql-manual/sql-functions/digital-masking)
5 changes: 5 additions & 0 deletions docs/admin-manual/config/be-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,11 @@ Indicates how many tablets failed to load in the data directory. At the same tim
* Description: Minimum download speed
* Default value: 50 (KB/s)
#### `enable_batch_download`
* Description: Whether to download files in batch, it is recommended to open it when the binlog is enabled.
* Default value: false
#### `priority_queue_remaining_tasks_increased_frequency`
* Description: the increased frequency of priority for remaining tasks in BlockingPriorityQueue
Expand Down
Loading

0 comments on commit ab8a525

Please sign in to comment.