Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup description #2

Merged
merged 1 commit into from
Dec 17, 2023
Merged

cleanup description #2

merged 1 commit into from
Dec 17, 2023

Conversation

juftin
Copy link
Contributor

@juftin juftin commented Dec 16, 2023

This PR applies some text cleaning to the description param using textwrap.dedent + strip. This came up on a project of mine where I stored shared field descriptions on a class namespace

from pydantic import BaseModel, Field


class CommonDescriptions:
    field_name = """
    This is a multiline field description for the `field_name`
    field. It requires some text cleaning to show up in docs the right way
    """


class Model(BaseModel):
    field_name: str = Field(description=CommonDescriptions.field_name)


class AnotherModel(BaseModel):
    field_name: str = Field(description=CommonDescriptions.field_name)

P.S. This is an awesome project - it really is helping take my docs to the next level with mkdocstrings.

Copy link
Member

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

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

Thanks! Nice to see it’s being used, and thanks for taking the time to make a PR

@tlambert03 tlambert03 merged commit dd4072b into pyapp-kit:main Dec 17, 2023
2 of 17 checks passed
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