Skip to content

docs: improve CrocoDocs API signature and cross-reference rendering#6442

Open
ndonkoHenri wants to merge 6 commits intorelease/v0.85.0from
improve-crocodocs
Open

docs: improve CrocoDocs API signature and cross-reference rendering#6442
ndonkoHenri wants to merge 6 commits intorelease/v0.85.0from
improve-crocodocs

Conversation

@ndonkoHenri
Copy link
Copy Markdown
Contributor

@ndonkoHenri ndonkoHenri commented Apr 25, 2026

Improves CrocoDocs API rendering to make generated reference docs easier to read.

Changes

  • Format long method and attribute signatures across multiple lines using Ruff.
  • Show modern type syntax like T | None instead of Optional[T].
  • Unwrap Annotated[...] in displayed type annotations.
  • Preserve return type annotations in method signatures.
  • Strip flet_map. and other extension package prefixes from visible cross-reference labels while keeping links/anchors unchanged.

Summary by Sourcery

Improve CrocoDocs-generated API reference readability and consistency across signatures, type annotations, and cross-reference labels.

Enhancements:

  • Add Ruff-based formatting for function and attribute signatures, including multi-line wrapping and preservation of return types in generated API docs.
  • Modernize rendered type annotations in docs by converting Optional/Union to PEP 604 syntax, unwrapping Annotated, and cleaning alias values.
  • Expose preformatted signatures for functions and attributes to the docs UI and render them with preformatted monospace styling.
  • Unify stripping of public Flet package prefixes from API labels and reStructuredText cross-reference displays, including extension packages.
  • Update internal docs-conventions guidance and changelog skill to account for documentation-focused changelog sections and extension references.

Build:

  • Add Ruff as a CrocoDocs tooling dependency for formatting synthetic Python signatures.

Documentation:

  • Document how CrocoDocs renders extension attribute references and update flet-map docs wording for animation duration reference.
  • Add a changelog entry describing the improved CrocoDocs API reference rendering.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 25, 2026

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: b901c05
Status:🚫  Build failed.

View logs

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 300 files, and this pull request has 1951

@ndonkoHenri ndonkoHenri changed the base branch from main to release/v0.85.0 April 25, 2026 13:56
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 25, 2026

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: b901c05
Status: ✅  Deploy successful!
Preview URL: https://a4fe90e0.flet-examples.pages.dev
Branch Preview URL: https://improve-crocodocs.flet-examples.pages.dev

View logs

@ndonkoHenri
Copy link
Copy Markdown
Contributor Author

@sourcery-ai review

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New security issues found

Comment thread tools/crocodocs/src/crocodocs/griffe_extract_script.py Outdated
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

Comment thread tools/crocodocs/src/crocodocs/griffe_extract_script.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Improves CrocoDocs API reference rendering by generating cleaner, multi-line signatures and displaying more modern, readable type annotations, while also shortening public cross-reference labels for extension packages.

Changes:

  • Add Ruff-based formatting + type-annotation modernizing to the CrocoDocs extraction pipeline (formatted signatures, Optional[T]T | None, unwrap Annotated[...]).
  • Render extracted formatted_signature (and preserve return types) in the website’s API UI.
  • Strip ft. / flet. / flet_*. prefixes from visible cross-reference labels while keeping the underlying links intact.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
website/src/css/custom.css Tweaks whitespace handling for rendered signature-like content.
website/src/components/crocodocs/utils.js Centralizes Flet display-prefix stripping via a single regex.
website/src/components/crocodocs/ClassBlock.js Uses extracted formatted_signature and preserves return types in method display.
tools/crocodocs/src/crocodocs/griffe_extract_script.py Generates modernized annotations and Ruff-formatted signatures during extraction.
tools/crocodocs/pyproject.toml Adds Ruff dependency to support signature formatting.
tools/crocodocs/.gitignore Expands ignore patterns for Python tooling/artifacts.
sdk/python/packages/flet-map/src/flet_map/map.py Docstring line-wrapping tweak for readability.
CHANGELOG.md Adds a Documentation section entry for the CrocoDocs improvements.
.agents/skills/write-changelog-entry/SKILL.md Updates changelog-writing guidance to include a Documentation section.
.agents/skills/docs-conventions/SKILL.md Documents extension reference rendering conventions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/crocodocs/src/crocodocs/griffe_extract_script.py Outdated
Comment thread tools/crocodocs/src/crocodocs/griffe_extract_script.py Outdated
Comment thread tools/crocodocs/src/crocodocs/griffe_extract_script.py Outdated
Comment thread website/src/css/custom.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants