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

Improving docs across core strategies #2957

Open
rsokl opened this issue May 7, 2021 · 6 comments
Open

Improving docs across core strategies #2957

rsokl opened this issue May 7, 2021 · 6 comments
Labels
docs documentation could *always* be better enhancement it's not broken, but we want it to be better

Comments

@rsokl
Copy link
Contributor

rsokl commented May 7, 2021

While working on a tutorial for pycon, I found that a substantial part of my materials was simply explaining what the various strategies do... which is what docstrings are for, but I think that ours fall short.

I am a fan of NumPy-style docs where each function's parameters are clearly described – alongside their type annotations – and an example section follows. Among these qualities, I think including an examples section for each docstring has the biggest bang for its buck.

One issue with this is that the Core Strategies page may end up being pretty lengthy. Perhaps expanding the TOC to include the strategies would make it easier for users to navigate. These would be collapsable, so this wouldn't blow up the navigation pane.

@rsokl rsokl added enhancement it's not broken, but we want it to be better docs documentation could *always* be better labels May 7, 2021
@rsokl rsokl changed the title Improving strategy docs Improving docs across core strategies May 7, 2021
@Zac-HD
Copy link
Member

Zac-HD commented May 7, 2021

  • I'd support adopting Numpy-style structured docstrings for our whole API, though examples are probably most useful for strategies. If we're doing this we should also investigate linters which can check for malformed docstrings.
  • Too many strategies to add them all to the table of contents, but arranging them into sections for scalars, collections, etc (like in our tutorial) would probably be useful.

@rsokl
Copy link
Contributor Author

rsokl commented May 7, 2021

but arranging them into sections for scalars, collections, etc (like in our tutorial) would probably be useful

I had been thinking this as well, but wasn't sure if restructuring the page itself was on the table. I think this is a great idea and that it makes it easier to get a bird's eye view of all the strategies

@Zac-HD
Copy link
Member

Zac-HD commented May 7, 2021

Anything that doesn't break URLs is on the table 😁

(I've wanted to restructure to follow the four kinds of documentation for years, but doing it well - including redirects - is a lot of work and not at the top of my todo list. I'd be delighted if someone volunteered to do it though!)

@rsokl
Copy link
Contributor Author

rsokl commented May 7, 2021

Anything that doesn't break URLs is on the table

That is what I was worried about when I suggested expanding the TOC rather than rearrange the strats. Rearranging strategies into scalars, collections, etc. would break URLs, right? E.g. in the tutorial I link to https://hypothesis.readthedocs.io/en/latest/data.html#hypothesis.strategies.fixed_dictionaries

@Zac-HD
Copy link
Member

Zac-HD commented May 7, 2021

Yeah, we can rearrange them on the page and add sidebar-linkable subheadings though (which also preserves ctrl-f searchability).

@epgui
Copy link

epgui commented Jun 7, 2022

FWIW, this format of documentation is very easy to use for libraries that are essentially just a big collection of utility functions: https://ramdajs.com/docs/

The toolz library is also quite easy to navigate: https://toolz.readthedocs.io/en/latest/api.html

@Zac-HD Zac-HD mentioned this issue May 18, 2024
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs documentation could *always* be better enhancement it's not broken, but we want it to be better
Projects
None yet
Development

No branches or pull requests

3 participants