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

Fixing poor docstring formatting for @callback. #2728

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

woefulpines
Copy link

@woefulpines woefulpines commented Jan 21, 2024

It seems like some reStructuredText elements don't render well in vscodes docstring preview window #2670. I replaced feature lists with elements that were supported according to this example in pandas contributing guidelines. In terms of content, nothing is added or changed, just formatted it differently.

  • I have broken down my PR scope into the following TODO tasks
    • Set up local repo according to contributing guidelines.
    • Figure out why the doc string was not formatting properly.
    • Replace problematic reStructure elements with more agreeable elements.
    • Conform additions to code style, eliminating linter errors.

…sues. Replaced it with a heading for the section and paragraph separated portions for each function parameter.
@woefulpines woefulpines changed the title Fixing poor docstring formatting for @callback. #2670 Fixing poor docstring formatting for @callback. Jan 21, 2024
@Coding-with-Adam
Copy link

Thank you for this PR, @woefulpines . We appreciate the time you put into this.

@alexcjohnson
Copy link
Contributor

Thanks @woefulpines! The main thing I'm concerned about here is how it works with the dash docs reference pages: https://dash.plotly.com/reference#dash.callback is auto-generated from this docstring. Frankly I'd prefer to move away from reStructuredText entirely, in favor of something more human-centered, perhaps looking more like component docstrings (which are themselves autogenerated). FYI @LiamConnors

@woefulpines
Copy link
Author

Out of curiosity, how do you generate your documentation? Is there some resource that talks about it?

@woefulpines
Copy link
Author

Also I realized now that dash/dash.py has an example of feature lists working in the vscode doc popup window so I can try that for the time being and have some changes that may be more inline with your standards.

@alexcjohnson
Copy link
Contributor

Unfortunately our docs repo is private, just because we use our enterprise packages in it. But we’ve been discussing some ways to potentially open it up, which would make this kind of thing a lot easier!

…ility while avoiding linter blank line errors.
@woefulpines
Copy link
Author

I added feature lists back in. I wasn't able to use blank lines to format the docstring, I hope newlines wont give the document generator any trouble. Looking at dash/dash.py. The comment for the dash class is allowed to use blank lines and it also has type annotations in the docstring for each parameter. So if those were things you would like in the callback docstring, I can add them in. Thank for your patience with this. I really appreciate it.

@LiamConnors
Copy link
Contributor

Yeah the formatting here does break it in the Dash docs
image
Checking to see what part might be breaking it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants