summaryrefslogtreecommitdiffstats
path: root/Utilities/Sphinx/static
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2023-03-13 17:31:38 (GMT)
committerMatthew Woehlke <matthew.woehlke@kitware.com>2023-03-13 17:31:38 (GMT)
commit39ecaa5da1f1e42cb62d4ce3d6870409cdefec07 (patch)
tree19cc31480f40825ec15be1656aeb552b19356e07 /Utilities/Sphinx/static
parent9db40bec4e1004baa8b397c8b52c248d8de71f67 (diff)
downloadCMake-39ecaa5da1f1e42cb62d4ce3d6870409cdefec07.zip
CMake-39ecaa5da1f1e42cb62d4ce3d6870409cdefec07.tar.gz
CMake-39ecaa5da1f1e42cb62d4ce3d6870409cdefec07.tar.bz2
Utilities/Sphinx: Improve word wrap of signatures
Implement logic to support several styles of parsing in the new signature directive that control where line breaks are allowed in a signature. The default is 'smart', which forbids breaks inside of square- or angle-brackets. The 'verbatim' option forbids all breaks. In all cases, breaks are always allowed where a newline appears in the source. This seems to Just Work for most writers, but HTML needs some special handling that is accomplished by a new CSS rule and assigning the 'nbsp' class to spaces that are not allowed to break. (ROFF's line wrapping is rather unfortunate here, as it prefers splitting and hyphenating words rather than breaking at a space.)
Diffstat (limited to 'Utilities/Sphinx/static')
-rw-r--r--Utilities/Sphinx/static/cmake.css5
1 files changed, 5 insertions, 0 deletions
diff --git a/Utilities/Sphinx/static/cmake.css b/Utilities/Sphinx/static/cmake.css
index dd0dd02..41a74f5 100644
--- a/Utilities/Sphinx/static/cmake.css
+++ b/Utilities/Sphinx/static/cmake.css
@@ -40,6 +40,11 @@ div.sphinxsidebarwrapper {
font-weight: normal;
}
+/* Implement non-breaking spaces in signatures. */
+.nbsp {
+ white-space: nowrap;
+}
+
/* Remove unwanted margin in case list item contains a div-wrapping
directive like `.. versionadded` or `.. deprecated`. */
dd > :first-child > p {