Put arguments to new lines for long function signatures #388
-
With long function signatures you get something like: It's quite ugly to look at, better would be: class pastry.auth.token_provider.OAuth2TokenProvider(
url: str,
client_id: Optional[str] = None,
client_secret: Optional[str] = None,
...and so on...
) There's a ticket also for Sphinx about the same thing at sphinx-doc/sphinx#1514 but this is perhaps a representation issue, rather, and should be discussed per theme. Hacking the CSS I could probably make each parameter show on a new line, but that would then apply also for functions with only 1-2 parameters, too. Would detecting long signatures be difficult? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
This isn’t feasible in CSS or the theme side without invasive hacks. It has to happen on Sphinx’s end. |
Beta Was this translation helpful? Give feedback.
-
@pradyunsg - I tagged you on sphinx-doc/sphinx#1514 (comment), which I think is the closest I've found to a relevant open issue for Sphinx itself. I guess we really want this to be intelligent, no point in putting short argument definitions on multiple lines, but really want to see long signatures split. Doing whatever is done in the source might be a good option... Anyway, I have a particularly ugly example now, so keen to help where I can or nudge things along where I can't ;-) |
Beta Was this translation helpful? Give feedback.
-
sphinx-doc/sphinx#11011 seems like the way forward here. Once that is implemented, I'd be happy to make sure that Furo handles that output gracefully. :) |
Beta Was this translation helpful? Give feedback.
sphinx-doc/sphinx#11011 seems like the way forward here. Once that is implemented, I'd be happy to make sure that Furo handles that output gracefully. :)