diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9a1422da179e535907d67410faaf7d748d6386ef..801b7d4d165f5afdbeba8da27ce70b5b367bd348 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -39,6 +39,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.9 + - name: Run Dev Relative Reference + run: python img_utils.py -v dev-syntax - name: Run Image Check run: python img_utils.py -v check dead-link: diff --git a/docs/docs/en/development/development-environment-setup.md b/docs/docs/en/development/development-environment-setup.md index fdb322c55a9d3b3083915f55ddd81df54d8d3c28..02e4058e23fdbfb5602186020e41180aef985788 100644 --- a/docs/docs/en/development/development-environment-setup.md +++ b/docs/docs/en/development/development-environment-setup.md @@ -37,7 +37,7 @@ There are two ways to configure the DolphinScheduler development environment, st > **_Note:_** Use standalone server only for development and debugging, because it uses H2 Database as default database and Zookeeper Testing Server which may not be stable in production. > Standalone is only supported in DolphinScheduler 1.3.9 and later versions. -> Standalone server is able to connect to external databases like mysql and postgresql, see [Standalone Deployment](../guide/installation/standalone.md) for instructions. +> Standalone server is able to connect to external databases like mysql and postgresql, see [Standalone Deployment](https://dolphinscheduler.apache.org/en-us/docs/dev/user_doc/guide/installation/standalone.html) for instructions. ### Git Branch Choose diff --git a/docs/img_utils.py b/docs/img_utils.py index aafceb71923a1290f89aec0db89802b2d42ba859..493ff7169e730d98ec86727a0e8ae905a7c31220 100644 --- a/docs/img_utils.py +++ b/docs/img_utils.py @@ -31,6 +31,8 @@ log.addHandler(logging.StreamHandler()) root_dir: Path = Path(__file__).parent img_dir: Path = root_dir.joinpath("img") doc_dir: Path = root_dir.joinpath("docs") +dev_en_dir: Path = doc_dir.joinpath("en", "development") +dev_zh_dir: Path = doc_dir.joinpath("zh", "development") def get_files_recurse(path: Path) -> Set: @@ -122,6 +124,17 @@ def prune() -> None: del_empty_dir_recurse(img_dir) +def dev_syntax() -> None: + """Check temp whether temporary do not support syntax in development.""" + pattern = re.compile("(\\(\\.\\.[\\w./-]+\\))") + dev_files_path = get_files_recurse(dev_en_dir) | get_files_recurse(dev_zh_dir) + get_files_recurse(dev_en_dir) + for path in dev_files_path: + content = path.read_text() + find = pattern.findall(content) + assert not find, f"File {str(path)} contain temporary not support syntax: {find}." + + def build_argparse() -> argparse.ArgumentParser: """Build argparse.ArgumentParser with specific configuration.""" parser = argparse.ArgumentParser(prog="img_utils") @@ -150,6 +163,11 @@ def build_argparse() -> argparse.ArgumentParser: ) parser_prune.set_defaults(func=prune) + parser_prune = subparsers.add_parser( + "dev-syntax", help="Check whether temporary does not support syntax in development directory." + ) + parser_prune.set_defaults(func=dev_syntax) + # TODO Add subcommand `reorder` return parser