docs: render docstring cross-references as Markdown, not Sphinx RST - #1910
Conversation
The docs site renders docstrings through mkdocstrings with the Google parser, which treats docstring bodies as Markdown. Sphinx roles such as `:class:`Foo`` and `:meth:`bar`` therefore leaked through verbatim onto the published API pages (e.g. /core/entities/), as did the RST literal- block marker `::` and the `.. warning::` / `.. code-block::` directives. Convert them to their Markdown/Google equivalents across all three packages' sources: - `:class:`/`:data:`/`:attr:`/`:mod:` -> inline code span; `~`-prefixed targets keep only the last component, matching Sphinx's rendering. - `:meth:`/`:func:` -> inline code span with `()`, matching Sphinx's default `add_function_parentheses`. - Trailing `::` -> `:` (the indented block already renders as a code block in Markdown; only the stray colon was visible). - `.. warning::` -> a Google `Warning:` section, which griffe parses as an admonition. - `.. code-block:: python` and the `Example::` blocks that ruff's D412 would then flag -> fenced ```python blocks. - The two stray `:param:`/`:return:` fields in `EntityRecord.from_data` -> Google-style `Args:`/`Returns:`. Docstring text only; no behavior changes. `ruff check` and `ruff format --check` pass on every touched file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review comments remain, and the changes are documentation-only.
Review effort: Lite
Findings: None
What changed in this PR
Updates source docstrings from Sphinx RST to Markdown/Google syntax for correct mkdocstrings rendering, without runtime changes.
Changes:
- Replaced cross-reference roles with Markdown code spans.
- Converted directives and literal blocks to Markdown/Google equivalents.
- Converted
EntityRecord.from_datafields to Google-style documentation.
| File | Summary |
|---|---|
packages/uipath/src/uipath/functions/factory.py |
Updated class references. |
packages/uipath/src/uipath/functions/debug.py |
Updated literal-block syntax. |
packages/uipath/src/uipath/eval/runtime/runtime.py |
Updated function references. |
packages/uipath/src/uipath/eval/evaluators/dataset_evaluator_factory.py |
Updated evaluator references. |
packages/uipath/src/uipath/eval/evaluators/base_dataset_evaluator.py |
Updated class references. |
packages/uipath/src/uipath/agent/models/agent.py |
Updated class references. |
packages/uipath/src/uipath/_cli/_governance/yaml_index.py |
Updated governance references. |
packages/uipath/src/uipath/_cli/_governance/__init__.py |
Updated API references. |
packages/uipath/src/uipath/_cli/_governance_bootstrap.py |
Updated governance references. |
packages/uipath-platform/src/uipath/platform/orchestrator/_assets_service.py |
Updated method references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/user_prompt_attacks.py |
Updated validator references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/prompt_injection.py |
Updated validator references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/pii.py |
Updated validator references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/llm_as_judge.py |
Updated validator references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/intellectual_property.py |
Updated validator references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/harmful_content.py |
Updated validator references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/custom.py |
Updated references and examples. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/byo.py |
Updated references and code fencing. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/validators/_base.py |
Updated references and examples. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/_registry.py |
Updated function references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/_models.py |
Updated class references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/_guardrail.py |
Updated API references. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/_core.py |
Updated references and examples. |
packages/uipath-platform/src/uipath/platform/guardrails/decorators/_actions.py |
Updated class references. |
packages/uipath-platform/src/uipath/platform/governance/policy.py |
Updated module references. |
packages/uipath-platform/src/uipath/platform/governance/compensate.py |
Updated module references. |
packages/uipath-platform/src/uipath/platform/governance/_live_track_event_dispatcher.py |
Updated references and examples. |
packages/uipath-platform/src/uipath/platform/governance/_governance_service.py |
Updated service references. |
packages/uipath-platform/src/uipath/platform/governance/_governance_provider.py |
Updated provider references. |
packages/uipath-platform/src/uipath/platform/errors/_datafabric_error.py |
Updated error references. |
packages/uipath-platform/src/uipath/platform/entities/entities.py |
Updated references and parameter documentation. |
packages/uipath-platform/src/uipath/platform/entities/_entity_schema_service.py |
Updated service references. |
packages/uipath-platform/src/uipath/platform/entities/_entity_ontology_service.py |
Updated service references. |
packages/uipath-platform/src/uipath/platform/entities/_entity_data_service.py |
Updated service and model references. |
packages/uipath-platform/src/uipath/platform/entities/_entities_service.py |
Updated references and examples. |
packages/uipath-platform/src/uipath/platform/common/_reference_context.py |
Updated references and examples. |
packages/uipath-platform/src/uipath/platform/common/_execution_context.py |
Updated context references. |
packages/uipath-platform/src/uipath/platform/common/_base_service.py |
Updated helper references. |
packages/uipath-platform/src/uipath/platform/agenthub/remote_a2a.py |
Converted warning directives. |
packages/uipath-platform/src/uipath/platform/agenthub/_remote_a2a_service.py |
Converted warnings and examples. |
packages/uipath-platform/src/uipath/platform/action_center/_tasks_service.py |
Updated method references. |
packages/uipath-core/src/uipath/core/governance/providers.py |
Updated references and example syntax. |
packages/uipath-core/src/uipath/core/governance/models.py |
Updated class references. |
packages/uipath-core/src/uipath/core/governance/exceptions.py |
Updated method and class references. |
packages/uipath-core/src/uipath/core/governance/config.py |
Updated module and method references. |
packages/uipath-core/src/uipath/core/governance/__init__.py |
Updated class references. |
packages/uipath-core/src/uipath/core/feature_flags/feature_flags.py |
Updated references and examples. |
packages/uipath-core/src/uipath/core/adapters/evaluator.py |
Updated protocol references. |
packages/uipath-core/src/uipath/core/adapters/__init__.py |
Updated protocol references. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
nit: add a guard so RST roles don't come back (follow up PR maybe). something like: |
|
Added in #1913 — thanks, good call. Two small deltas from your snippet, both easy to drop:
Kept your I did check whether the literal space in Verified both hooks pass on the current tree and report 69 / 66 offending lines against the pre-merge copy of |



Problem
The docs site renders docstrings via mkdocstrings with the Google parser, which treats docstring bodies as Markdown. Sphinx cross-reference roles in our docstrings therefore leak through verbatim onto the published pages.
Visible today on https://uipath.github.io/uipath-python/core/entities/:
The same leakage affects every other mkdocstrings-backed page whose module uses these roles (guardrails, governance, assets, tasks, evaluators, …).
Fix
Docstring text only — no code, signature, or behavior changes.
:class:`Foo`,:data:`X`,:attr:`y`,:mod:`m``Foo`:class:`~pkg.mod.Foo``Foo`(matches Sphinx's~= last component only):meth:`bar`,:func:`baz``bar()`(matches Sphinx's defaultadd_function_parentheses)Basic usage::Basic usage:— the indented block already renders as a code block; only the stray colon was visible.. warning::Warning:section, which griffe parses into a real admonition.. code-block:: python, and theExample::blocks ruff D412 would then flag```pythonblocks:param:/:return:fields inEntityRecord.from_dataArgs:/Returns:Plain code spans were chosen over mkdocstrings autorefs (
[Foo][]) deliberately: many targets are private services or live in modules that are not part of the nav, so autorefs would resolve to broken links or emit build warnings.Scope is
packages/*/src— 49 files, 275 role occurrences acrossuipath,uipath-core, anduipath-platform. Test-module docstrings still use RST roles; they are not rendered anywhere, so they are left alone.Verification
grepconfirms zero remaining:role:/::/.. directive::occurrences underpackages/*/src.ruff checkpasses on all three packages;ruff format --checkreports all 49 touched files already formatted.uipath.platform.entities._entities_servicewith griffe's Google parser: 223 docstrings, 0 sections containing RST residue, and theExamples:sections still yield their code blocks.Fixed

Current
![Uploading image.png…]()
🤖 Generated with Claude Code