Libdoc with new style for arguments - #5734
Conversation
Inject a Heroicons clipboard button (MIT) into every .doc .code block. Clicking copies the plain text of the <pre> to the clipboard and swaps the icon to a checkmark for 1.5 s before restoring the clipboard icon. Button is always visible, positioned absolute top-right of each block.
|
I like a lot of what is here. Think it covers René's concern about unused space. I also think it puts this in a good spot for a release now and give people a chance to try it out and comment about it. |
|
I personally like the current styles a bit more that this. The current table has some wasted space, but I consider is easy to understand compared to this version. I find it a bit strange that the data is kind of formatted as in a table but kind of as in a list. I would think using either a normal table, like we now have, or a list, like this mkdocstring example does, would be simpler. That said, I see problems with the table approach and I also see that complex type hints and long default values would probably cause problems with the list approach. The above said, I'm not really against these styles, especially when the comments here have been positive. I'd like to hear opinions from a bit wider audience, though. Could you @aaltat and @Snooz82 create examples with the current styles and with these PR styles so that people could test them? It would be best if both versions would be somewhere available so that people could experiment with the real docs instead of just seeing images. Using a real library like SchemathesisLibary or/and BuiltIn would be best. If majority of the people like the new styles, and we got at least few votes, I'm fine with using these styles in RF 7.5. We can, and probably should, do a bigger Libdoc HTML update in the future anyway. |
|
If we go with this design, I'd somewhat strongly want to remove the equal sign from the default value. I didn't like it too much with the previous design either, but back then the default value was after the argument name and having |
Fixes #5733 #5728
Part of #5604
Arguments now look like:

And return and raises information:

Also in the previous implementation, the SchemathesisLibary looks better:

I can even now consider keeping the

sessionargument documentation as it is: