From 69b03b662e0477fde0662a977b1c9a3662b9c4e1 Mon Sep 17 00:00:00 2001 From: "h.nejati" Date: Mon, 23 Nov 2026 12:09:41 +0330 Subject: [PATCH 1/2] fix(docs): render Mermaid and Markdown callouts --- docs/community/contributing.md | 141 ++++++++++++++++++--------------- scripts/check_docs.py | 17 +++- zensical.toml | 8 +- 3 files changed, 98 insertions(+), 68 deletions(-) diff --git a/docs/community/contributing.md b/docs/community/contributing.md index 1c1db0cc..083f51fe 100644 --- a/docs/community/contributing.md +++ b/docs/community/contributing.md @@ -12,34 +12,33 @@ contributing to ArchiPy. 1. **Fork the Repository** - Fork the [ArchiPy repository](https://github.com/SyntaxArc/ArchiPy) on GitHub. + Fork the [ArchiPy repository](https://github.com/SyntaxArc/ArchiPy) on GitHub. 2. **Clone Your Fork** - ```bash - git clone https://github.com/YOUR-USERNAME/ArchiPy.git - cd ArchiPy - ``` + ```bash + git clone https://github.com/YOUR-USERNAME/ArchiPy.git + cd ArchiPy + ``` 3. **Set Up Development Environment** - ```bash - make setup - make install - make install-dev - ``` + ```bash + make setup + make install + make install-dev + ``` - !!! tip "Pre-commit Hooks" - Running `make install-dev` sets up pre-commit hooks that automatically run linting, formatting, and type checking on - every commit. Use `make pre-commit` to run all hooks manually before opening a pull request. + > **Tip:** Running `make install-dev` sets up pre-commit hooks that automatically run linting, formatting, and + > type checking on every commit. Use `make pre-commit` to run all hooks manually before opening a pull request. 4. **Create a Branch** - Create a branch for your feature or bugfix: + Create a branch for your feature or bugfix: - ```bash - git checkout -b feature/your-feature-name - ``` + ```bash + git checkout -b feature/your-feature-name + ``` ## Development Installation @@ -129,39 +128,39 @@ Common types: 1. **Update Your Branch** - Before submitting a pull request, make sure your branch is up to date with the master branch: + Before submitting a pull request, make sure your branch is up to date with the master branch: - ```bash - git checkout master - git pull origin master - git checkout your-branch - git rebase master - ``` + ```bash + git checkout master + git pull origin master + git checkout your-branch + git rebase master + ``` 2. **Run All Checks** - Ensure all checks pass: + Ensure all checks pass: - ```bash - make check - make behave - ``` + ```bash + make check + make behave + ``` 3. **Submit Your Pull Request** - Push your branch to your fork and create a pull request: + Push your branch to your fork and create a pull request: - ```bash - git push origin your-branch - ``` + ```bash + git push origin your-branch + ``` 4. **Code Review** - Your pull request will be reviewed by the maintainers. They may suggest changes or improvements. + Your pull request will be reviewed by the maintainers. They may suggest changes or improvements. 5. **Merge** - Once your pull request is approved, it will be merged into the master branch. + Once your pull request is approved, it will be merged into the master branch. ## Bug Reports and Feature Requests @@ -190,41 +189,41 @@ New adapters follow a consistent checklist. Use this as your guide when contribu 1. **Create the adapter package** - ```text - packages// - ├── pyproject.toml # dist `archipy-`, depends on `archipy==` + the client library - └── archipy/adapters// - ├── __init__.py - ├── ports.py # Abstract interface (plain class with @abstractmethod) - ├── adapters.py # Concrete implementation - └── mocks.py # In-memory test double - ``` + ```text + packages// + ├── pyproject.toml # dist `archipy-`, depends on `archipy==` + the client library + └── archipy/adapters// + ├── __init__.py + ├── ports.py # Abstract interface (plain class with @abstractmethod) + ├── adapters.py # Concrete implementation + └── mocks.py # In-memory test double + ``` 2. **Define the port** (`ports.py`) - Create a plain class with `@abstractmethod` methods that describes what the adapter can do. Your business logic and - repositories - must depend only on this interface. + Create a plain class with `@abstractmethod` methods that describes what the adapter can do. Your business logic and + repositories + must depend only on this interface. 3. **Implement the adapter** (`adapters.py`) - Implement the port against the real external service. Lazy-import the third-party library inside - methods (not at module level) to avoid `ImportError` when the optional extra is not installed. + Implement the port against the real external service. Lazy-import the third-party library inside + methods (not at module level) to avoid `ImportError` when the optional extra is not installed. 4. **Write the mock** (`mocks.py`) - Implement the port using an in-memory data structure. The mock must behave consistently with the - real adapter for all methods exercised in tests. + Implement the port using an in-memory data structure. The mock must behave consistently with the + real adapter for all methods exercised in tests. 5. **Add the optional extra** to `pyproject.toml` - ```toml - [project.optional-dependencies] - myservice = ["myservice-client>=1.0"] - ``` + ```toml + [project.optional-dependencies] + myservice = ["myservice-client>=1.0"] + ``` 6. **Write tests** — BDD tests using the mock for fast scenarios, integration tests using `testcontainers` for - real-service scenarios. + real-service scenarios. 7. **Document the adapter** — create both: - `docs/tutorials/adapters/.md` — example guide (5 required sections) @@ -278,19 +277,35 @@ When including code examples: ### Admonitions -Use admonitions to highlight important information: +Use block quote callouts to highlight important information. ```markdown -!!! note -This is a note. +> **Note:** This is a note. -!!! warning -This is a warning. +> **Warning:** This is a warning. -!!! tip -This is a tip. +> **Tip:** This is a tip. ``` +#### GitHub callout types + +Start a GitHub callout with an uppercase marker such as `> [!NOTE]`. Prefix each line of the message with `>`. + +> [!NOTE] +> Read the Docs and GitHub Pages build from the same documentation sources. + +> [!TIP] +> Use `make docs-serve` to preview edits locally before opening a pull request. + +> [!WARNING] +> Add a redirect when moving a published page so existing links keep working. + +> [!IMPORTANT] +> Update the `nav` array in `zensical.toml` when adding a page to the site navigation. + +> [!CAUTION] +> Remove real credentials and personal data from examples before committing. + ### Building and Previewing Documentation Preview the documentation locally: diff --git a/scripts/check_docs.py b/scripts/check_docs.py index b4fc0632..0bf64a53 100644 --- a/scripts/check_docs.py +++ b/scripts/check_docs.py @@ -9,7 +9,7 @@ # ] # /// -"""Build the documentation and verify the generated error page and redirects.""" +"""Build the documentation and verify generated diagrams, redirects, and the error page.""" import json import os @@ -38,14 +38,17 @@ def __init__(self, source: Path) -> None: self.links: set[str] = set() self.recovery_links: set[str] = set() self.assets: set[str] = set() + self.mermaid_count = 0 self.theme_config = "" self._in_recovery_navigation = False self._in_theme_config = False self.feed(source.read_text(encoding="utf-8")) def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: - """Record canonical, refresh, and visible fallback links.""" + """Record the markup needed by the output checks.""" attributes = dict(attrs) + if tag == "pre" and "mermaid" in (attributes.get("class") or "").split(): + self.mermaid_count += 1 if tag == "nav" and attributes.get("id") == "docs-recovery": self._in_recovery_navigation = True if tag == "a" and (href := attributes.get("href")): @@ -116,7 +119,7 @@ def check_404(site: Path, site_url: str) -> None: def check_output(config_path: Path) -> None: - """Verify each page redirect and the custom 404.""" + """Verify Mermaid diagrams, page redirects, and the custom 404.""" with config_path.open("rb") as file: project = tomllib.load(file)["project"] site = config_path.parent / project.get("site_dir", "site") @@ -124,6 +127,12 @@ def check_output(config_path: Path) -> None: directory_urls = project.get("use_directory_urls", True) redirects = project["plugins"]["redirects"]["redirect_maps"] + for source, expected in (("index.md", 1), ("getting-started/concepts.md", 2)): + url = urljoin(site_url, markdown_url(source, directory_urls)) + count = PageLinks(site_file(site, site_url, url)).mermaid_count + if count != expected: + raise SystemExit(f"{source}: expected {expected} Mermaid diagrams, found {count}") + for old, new in redirects.items(): if urlsplit(old).fragment: continue # Section redirects are handled on the destination page. @@ -147,7 +156,7 @@ def check_output(config_path: Path) -> None: raise SystemExit(f"Invalid generated redirect: {old} -> {new}") check_404(site, site_url) - print(f"Verified generated redirects, 404 links, and 404 assets under {site_url}") + print(f"Verified Mermaid diagram markup, redirects, and 404 links and assets under {site_url}") @contextmanager diff --git a/zensical.toml b/zensical.toml index cc609e79..0b61e790 100644 --- a/zensical.toml +++ b/zensical.toml @@ -165,18 +165,24 @@ icon = "fontawesome/brands/github" link = "https://github.com/SyntaxArc/ArchiPy" [project.markdown_extensions] +abbr = {} admonition = {} attr_list = {} def_list = {} footnotes = {} md_in_html = {} toc.permalink = true +pymdownx.blocks.caption = {} +pymdownx.details = {} pymdownx.highlight.anchor_linenums = true pymdownx.highlight.line_spans = "__span" pymdownx.highlight.pygments_lang_class = true pymdownx.inlinehilite = {} +pymdownx.quotes.callouts = true pymdownx.snippets = {} -pymdownx.superfences = {} +pymdownx.superfences.custom_fences = [ + { name = "mermaid", class = "mermaid", format = "pymdownx.superfences.fence_code_format" }, +] pymdownx.tabbed.alternate_style = true pymdownx.tasklist.custom_checkbox = true pymdownx.emoji.emoji_index = "zensical.extensions.emoji.twemoji" From c724dab5665a1f007a1d9d0a8e597a51efab5467 Mon Sep 17 00:00:00 2001 From: "h.nejati" Date: Mon, 23 Nov 2026 12:09:57 +0330 Subject: [PATCH 2/2] docs(changelog): update changelog for version 6.1.2 --- docs/community/changelog/6/6.1.1.md | 2 +- docs/community/changelog/6/6.1.2.md | 20 ++++++++++++++++++++ docs/community/changelog/6/index.md | 1 + docs/community/changelog/index.md | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 docs/community/changelog/6/6.1.2.md diff --git a/docs/community/changelog/6/6.1.1.md b/docs/community/changelog/6/6.1.1.md index aebc1b05..5ec44b0d 100644 --- a/docs/community/changelog/6/6.1.1.md +++ b/docs/community/changelog/6/6.1.1.md @@ -5,7 +5,7 @@ description: "Release notes for ArchiPy 6.1.1" # 6.1.1 — 2026-11-23 -[← 6.1.0](6.1.0.md) | [↑ 6.x series](index.md) +[← 6.1.2](6.1.2.md) | [6.1.0 →](6.1.0.md) | [↑ 6.x series](index.md) ## Chore diff --git a/docs/community/changelog/6/6.1.2.md b/docs/community/changelog/6/6.1.2.md new file mode 100644 index 00000000..ad906134 --- /dev/null +++ b/docs/community/changelog/6/6.1.2.md @@ -0,0 +1,20 @@ +--- +title: "Changelog 6.1.2" +description: "Release notes for ArchiPy 6.1.2" +--- + +# 6.1.2 — 2026-11-23 + +[← 6.1.1](6.1.1.md) | [↑ 6.x series](index.md) + +## Added + +- **GitHub Callouts** - Render GitHub-style Note, Tip, Warning, Important, and Caution callouts. The Contributing guide + shows all five types. + +## Fixed + +- **Mermaid Diagrams** - Render all three architecture diagrams on the homepage and Concepts page. The strict docs + build checks both pages for missing diagrams. +- **Markdown Rendering** - Render image captions, abbreviation tooltips, and collapsible admonitions. +- **Contributing Guide** - Preserve step numbering and keep code blocks and the pre-commit callout with their steps. diff --git a/docs/community/changelog/6/index.md b/docs/community/changelog/6/index.md index 59f5adfb..6e3f6367 100644 --- a/docs/community/changelog/6/index.md +++ b/docs/community/changelog/6/index.md @@ -9,6 +9,7 @@ description: "Release history for the ArchiPy 6.x series" | Version | Date | Summary | |---------|------|---------| +| [6.1.2](6.1.2.md) | 2026-11-23 | Restores Mermaid diagrams and expands Markdown rendering support. | | [6.1.1](6.1.1.md) | 2026-11-23 | Updates ty and sets 21 type-checking rules to error. | | [6.1.0](6.1.0.md) | 2026-11-23 | Redesigns the documentation and defers more configuration and error imports on Python 3.15. | | [6.0.1](6.0.1.md) | 2026-11-22 | Defers framework and helper imports on Python 3.15 and removes SDK imports from error models. | diff --git a/docs/community/changelog/index.md b/docs/community/changelog/index.md index 0ea4ee8f..c2b888d5 100644 --- a/docs/community/changelog/index.md +++ b/docs/community/changelog/index.md @@ -9,7 +9,7 @@ All notable changes to ArchiPy are documented here, organized by major version s ## [6.x Series](6/index.md) -4 releases — from 6.0.0 to 6.1.1 +5 releases — from 6.0.0 to 6.1.2 ## [5.x Series](5/index.md)