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

Tool for documentation coverage #516

Closed
blythed opened this issue Jul 24, 2023 · 3 comments
Closed

Tool for documentation coverage #516

blythed opened this issue Jul 24, 2023 · 3 comments
Assignees
Labels
📝 documentation Improvements or additions to documentation

Comments

@blythed
Copy link
Collaborator

blythed commented Jul 24, 2023

Might be nice to add something to interrogate how many functions/ methods are documented in the code-base.

@blythed blythed added the 📝 documentation Improvements or additions to documentation label Jul 24, 2023
@tmylk
Copy link

tmylk commented Jul 25, 2023

If you mean docstrings, then it is possible to add to the linter "D103 Missing docstring in public function". There are currently 204 hits for it on main. And also suggest adding doctest.

However my preferred way is not to build the Documentation with sphinx from docstrings but have several markdown files and use 'mkdocs' package the way FastApi does it. The explanations and formatting doesn't clog the docstrings, plus docs can be updated without touching the code. I don't know a way to automate coverage here though, so it is a bit more work.

@blythed
Copy link
Collaborator Author

blythed commented Jul 26, 2023

If you mean docstrings, then it is possible to add to the linter "D103 Missing docstring in public function". There are currently 204 hits for it on main. And also suggest adding doctest.

However my preferred way is not to build the Documentation with sphinx from docstrings but have several markdown files and use 'mkdocs' package the way FastApi does it. The explanations and formatting doesn't clog the docstrings, plus docs can be updated without touching the code. I don't know a way to automate coverage here though, so it is a bit more work.

Interesting. Do you have links or a high level view of that? How do the doc-strings appear in the interactive python help
my_function?? I couldn't quite follow along from the FastAPI link.

@tmylk
Copy link

tmylk commented Jul 31, 2023

Here is an example of a docstring appearing on mouse hover in vs code. It is short, much shorter than a Docs website page would be on this function. And I suggest that docstrings stay concise and just cover what the PEP suggests. I see it as a "reference" in Diataxis definition. How do you see it?

Screenshot 2023-07-31 at 19 40 44

I gave FastAPI as an example of docs decoupled from docstrings. This FastAPI docs page goes into a lot more detail than any docstring. The website and individual pages are structured in the order which is best for learning, not for storing code methods in a file like in sphinx docs.

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

No branches or pull requests

3 participants