From 4e19811f820c34bcc6d0fa60bd089583003169fa Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:43:30 +0200 Subject: [PATCH 1/4] wrong url --- docs/doc_entrypoint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/doc_entrypoint.md b/docs/doc_entrypoint.md index b756f342..96c945dd 100644 --- a/docs/doc_entrypoint.md +++ b/docs/doc_entrypoint.md @@ -28,7 +28,7 @@ To begin using `osparc`, simply import the package and refer to the detailed exa ### API Key/Secret Setup -Before interacting with the osparc API, you need to generate an API key-secret pair from your osparc account. Follow the [instructions here](https://docs.osparc.io/#/docs/platform_introduction/profile?id=preferences) to create the key and secret. +Before interacting with the osparc API, you need to generate an API key-secret pair from your osparc account. Follow the [instructions here](https://docs.osparc.io/#/docs/platform_introduction/user_setup/security_details?id=generating-o%c2%b2s%c2%b2parc-tokens) to create the key and secret. Once generated, you can configure them by either: From bf9e7b740e5defbc84ce627b54ba93e2a8f8d515 Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:01:00 +0200 Subject: [PATCH 2/4] adds tests --- clients/python/test/tests_docs.py | 40 +++++++++++++++++++++++++++++++ docs/doc_entrypoint.md | 4 ---- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 clients/python/test/tests_docs.py diff --git a/clients/python/test/tests_docs.py b/clients/python/test/tests_docs.py new file mode 100644 index 00000000..28356319 --- /dev/null +++ b/clients/python/test/tests_docs.py @@ -0,0 +1,40 @@ +import pytest +import sys +import re +from pathlib import Path + +_CURRENT_DIR = ( + Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent +) +_REPO_DIR = _CURRENT_DIR.parent.parent.parent +_DOCS_DIR = _REPO_DIR / "docs" + +assert _DOCS_DIR.exists + +_MD_LINK_PATTERN = re.compile(r"\[(.*?)\]\((.*?)\)") + + +def _collect_links(): + def _extract_file_links(markdown_file: Path) -> tuple[Path, str, str]: + content = markdown_file.read_text() + # Find all markdown links (e.g., [text](path/to/file)) + links = _MD_LINK_PATTERN.findall(content) + return [(markdown_file, text, file_link) for text, file_link in links] + + links = [] + for md_file in _DOCS_DIR.rglob("*.md"): + links.extend(_extract_file_links(md_file)) + return links + + +@pytest.mark.parametrize("md_file, link_text, file_link", _collect_links()) +def test_markdown_links(md_file: Path, link_text: str, file_link: str): + if file_link.startswith("http"): + pytest.skip(f"External link skipped: {file_link}") + + relative_to_md = (md_file.parent / file_link).resolve() + relative_to_repo = (_REPO_DIR / file_link).resolve() + + assert ( + relative_to_md.exists() or relative_to_repo.exists() + ), f"Broken link found: [{link_text}]({file_link}) in {md_file}" diff --git a/docs/doc_entrypoint.md b/docs/doc_entrypoint.md index 96c945dd..89f4efe2 100644 --- a/docs/doc_entrypoint.md +++ b/docs/doc_entrypoint.md @@ -79,10 +79,6 @@ For more in-depth usage, refer to the following tutorial guides: - [Version 0.6 Documentation](clients/python/docs/v0.6.0/README.md) -## Contributing - -We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to get involved. - ## License This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details. From 606a06593d5329d6b6c57333f4a1079cc274c39d Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:02:53 +0200 Subject: [PATCH 3/4] minor --- docs/doc_entrypoint.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/doc_entrypoint.md b/docs/doc_entrypoint.md index 89f4efe2..23331ca0 100644 --- a/docs/doc_entrypoint.md +++ b/docs/doc_entrypoint.md @@ -24,7 +24,6 @@ pip install osparc ## Getting Started with `osparc` -To begin using `osparc`, simply import the package and refer to the detailed examples provided in the [official documentation](https://github.com/your-username/osparc/wiki). ### API Key/Secret Setup From 23c17021f2886a1f66daf08371a74619db593e20 Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:10:16 +0200 Subject: [PATCH 4/4] minor --- clients/python/test/tests_docs.py | 4 ++-- docs/doc_entrypoint.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/python/test/tests_docs.py b/clients/python/test/tests_docs.py index 28356319..ae772bb0 100644 --- a/clients/python/test/tests_docs.py +++ b/clients/python/test/tests_docs.py @@ -32,9 +32,9 @@ def test_markdown_links(md_file: Path, link_text: str, file_link: str): if file_link.startswith("http"): pytest.skip(f"External link skipped: {file_link}") - relative_to_md = (md_file.parent / file_link).resolve() + # NOTE: that current doc only support relative to repo! relative_to_repo = (_REPO_DIR / file_link).resolve() assert ( - relative_to_md.exists() or relative_to_repo.exists() + relative_to_repo.exists() ), f"Broken link found: [{link_text}]({file_link}) in {md_file}" diff --git a/docs/doc_entrypoint.md b/docs/doc_entrypoint.md index 23331ca0..596c0680 100644 --- a/docs/doc_entrypoint.md +++ b/docs/doc_entrypoint.md @@ -80,7 +80,7 @@ For more in-depth usage, refer to the following tutorial guides: ## License -This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details. +This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details. ---