From 98eda46fd69de6599b2928a25b2c41755ded2cf9 Mon Sep 17 00:00:00 2001 From: Anthony DiGirolamo Date: Fri, 25 Aug 2023 21:45:16 +0000 Subject: [PATCH] docs: Add function signature line breaks Change-Id: I332ba1fa206ea76f3a7aa4cc2d3a0dfad7f254cb Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/168554 Commit-Queue: Kayce Basques Pigweed-Auto-Submit: Kayce Basques Commit-Queue: Anthony DiGirolamo Reviewed-by: Kayce Basques --- docs/_static/css/pigweed.css | 7 +++++++ docs/conf.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/docs/_static/css/pigweed.css b/docs/_static/css/pigweed.css index 839c8c30c9..aec3288235 100644 --- a/docs/_static/css/pigweed.css +++ b/docs/_static/css/pigweed.css @@ -27,6 +27,7 @@ .sidebar-brand-text { font-size: 2.5rem; + text-align: center; } /********** General document coloring ***********/ @@ -78,6 +79,12 @@ dl.describe>dt { text-indent: 0em; } +/* Remove blank space before/after function signature open/close parens. */ +.sig > dl { + margin-block-start: 0; + margin-block-end: 0; +} + /* Make inline code standout more */ code.literal { border: 1px solid var(--color-inline-code-border); diff --git a/docs/conf.py b/docs/conf.py index d19ece6d08..4573e6b9e4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -282,6 +282,11 @@ # Disable Python type hints # autodoc_typehints = 'none' +# Break class and function signature arguments into one arg per line if the +# total length exceeds 130 characters. 130 seems about right for keeping one or +# two parameters on a single line. +maximum_signature_line_length = 130 + def do_not_skip_init(app, what, name, obj, would_skip, options): if name == "__init__":