Skip to content

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Jul 20, 2023

Improving docs, mostly API docs and links to API docs.

Selected Reviewer: @Kludex

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 20, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 10d8242
Status: ✅  Deploy successful!
Preview URL: https://c0ac2c55.pydantic-docs2.pages.dev
Branch Preview URL: https://docs-links.pydantic-docs2.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: fee65cd
Status:⚡️  Build in progress...

View logs

@samuelcolvin
Copy link
Member Author

please review.

@samuelcolvin samuelcolvin marked this pull request as ready for review July 20, 2023 19:43
@samuelcolvin samuelcolvin changed the title Docs links Improve API documentation, in particular more links between usage and API docs Jul 20, 2023
show_root_heading: true
merge_init_into_class: false
group_by_category: false
# explicit members list so we can set order and include `__init__` easily
Copy link
Member

Choose a reason for hiding this comment

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

You mean that if we add __init__, then it's going to be the last?

We need to remember to add methods here when we implement them, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes we need to add them.

We can use some very special regex to include __init__ but not other dunder attributes, but the order is still very confusing. I think since this is a very important bit of the API documentation, it's worth getting it as good as possible even if that means adding members manually.

@@ -670,7 +675,9 @@ def Field( # noqa: C901
max_length: int | None = _Unset,
**extra: Unpack[_EmptyKwargs],
) -> Any:
"""Create a field for objects that can be configured.
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/fields
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change some to 2.0 and some you added dev-v2?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think they are all 2.0, should probably be changed to 2.1 if these changes are going to be released in the next minor release.

The point is we can't just use latest or dev-v2 since it'll be wrong for someone reading 2.0.3 code in 6 months time, or 6 years time 🤯.

samuelcolvin and others added 3 commits July 21, 2023 14:35
@samuelcolvin samuelcolvin merged commit 6636989 into main Jul 24, 2023
@samuelcolvin samuelcolvin deleted the docs-links branch July 24, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants