From ddeea69ccafe0686e71d2b56b6078dad0e72cdaa Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 3 Jun 2024 12:53:53 -0400 Subject: [PATCH 1/3] Nest icons in own div; always show src link --- docs/content/fsdocs-default.css | 43 +++++++++++++++---- src/FSharp.Formatting.ApiDocs/GenerateHtml.fs | 23 ++++++---- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/docs/content/fsdocs-default.css b/docs/content/fsdocs-default.css index e2063f56..dc2496f0 100644 --- a/docs/content/fsdocs-default.css +++ b/docs/content/fsdocs-default.css @@ -1046,15 +1046,10 @@ span[onmouseout] { .fsdocs-entity-xmldoc { > div { display: flex; - flex-direction: row-reverse; - justify-content: flex-start; + flex-direction: row; + justify-content: space-between; align-items: flex-start; - & p.fsdocs-summary { - margin: 0; - flex-grow: 1; - } - & pre { margin-bottom: var(--spacing-200); padding: var(--spacing-50); @@ -1064,18 +1059,41 @@ span[onmouseout] { } } + .fsdocs-summary-contents { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + } + + .fsdocs-member-xmldoc-column { + width: 100%; + display: flex; + flex-direction: column; + justify-content: flex-start; + } + + .icon-button-row { + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: flex-start; + height: calc(-1 * var(--spacing-200)); + } + .fsdocs-member-xmldoc { & summary { display: list-item; counter-increment: list-item 0; list-style: disclosure-closed outside; cursor: pointer; + width: calc(100% - var(--spacing-300)); margin-left: var(--spacing-300); > .fsdocs-summary { display: flex; - flex-direction: row-reverse; - justify-content: flex-start; + flex-direction: row; + justify-content: space-between; align-items: flex-start; & p.fsdocs-summary { @@ -1112,6 +1130,13 @@ span[onmouseout] { .fsdocs-return-name, .fsdocs-param-name { font-weight: 500; } + + > div.fsdocs-summary { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-start; + } } } diff --git a/src/FSharp.Formatting.ApiDocs/GenerateHtml.fs b/src/FSharp.Formatting.ApiDocs/GenerateHtml.fs index 5190acaf..c2834eb0 100644 --- a/src/FSharp.Formatting.ApiDocs/GenerateHtml.fs +++ b/src/FSharp.Formatting.ApiDocs/GenerateHtml.fs @@ -18,7 +18,7 @@ let fsdocsSummary (x: ApiDocHtml) = if x.HtmlText.StartsWith("
", StringComparison.Ordinal) then
         embed x
     else
-        p [ Class "fsdocs-summary" ] [ embed x ]
+        div [ Class "fsdocs-summary-contents" ] [ p [ Class "fsdocs-summary" ] [ embed x ] ]
 
 type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
     let root = model.Root
@@ -182,10 +182,12 @@ type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
 
                               let smry =
                                   div [ Class "fsdocs-summary" ] [
-                                      yield! copyXmlSigIconForSymbolMarkdown m.Symbol
-                                      yield! copyXmlSigIconForSymbol m.Symbol
-                                      yield! sourceLink m.SourceLocation
                                       fsdocsSummary m.Comment.Summary
+                                      div [ Class "icon-button-row" ] [
+                                          yield! sourceLink m.SourceLocation
+                                          yield! copyXmlSigIconForSymbol m.Symbol
+                                          yield! copyXmlSigIconForSymbolMarkdown m.Symbol
+                                      ]
                                   ]
 
                               let dtls =
@@ -272,7 +274,10 @@ type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
                                   if List.isEmpty dtls then
                                       smry
                                   elif String.IsNullOrWhiteSpace(m.Comment.Summary.HtmlText) then
-                                      yield! dtls
+                                      div [ Class "fsdocs-member-xmldoc-column" ] [
+                                          div [ Class "icon-button-row" ] (sourceLink m.SourceLocation)
+                                          yield! dtls
+                                      ]
                                   else
                                       details [] ((summary [] [ smry ]) :: dtls)
                               ]
@@ -325,10 +330,12 @@ type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
                               ]
                               td [ Class "fsdocs-entity-xmldoc" ] [
                                   div [] [
-                                      yield! copyXmlSigIconForSymbolMarkdown e.Symbol
-                                      yield! copyXmlSigIconForSymbol e.Symbol
-                                      yield! sourceLink e.SourceLocation
                                       fsdocsSummary e.Comment.Summary
+                                      div [ Class "icon-button-row" ] [
+                                          yield! sourceLink e.SourceLocation
+                                          yield! copyXmlSigIconForSymbol e.Symbol
+                                          yield! copyXmlSigIconForSymbolMarkdown e.Symbol
+                                      ]
                                   ]
                               ]
                           ]

From c3ac1fab164242ecb6366d7fa7d9d766c4563812 Mon Sep 17 00:00:00 2001
From: Brian Rourke Boll 
Date: Mon, 3 Jun 2024 13:54:34 -0400
Subject: [PATCH 2/3] Tweak doc paragraph margins

---
 docs/content/fsdocs-default.css | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/docs/content/fsdocs-default.css b/docs/content/fsdocs-default.css
index dc2496f0..1da78df7 100644
--- a/docs/content/fsdocs-default.css
+++ b/docs/content/fsdocs-default.css
@@ -1050,6 +1050,11 @@ span[onmouseout] {
             justify-content: space-between;
             align-items: flex-start;
 
+            & p.fsdocs-summary {
+                margin: 0;
+                flex-grow: 1;
+            }
+
             & pre {
                 margin-bottom: var(--spacing-200);
                 padding: var(--spacing-50);
@@ -1131,11 +1136,19 @@ span[onmouseout] {
             font-weight: 500;
         }
 
+        .fsdocs-param-docs p {
+            margin: var(--spacing-200) 0;
+        }
+
         > div.fsdocs-summary {
             display: flex;
             flex-direction: row;
             justify-content: space-between;
             align-items: flex-start;
+
+            & p {
+                margin: 0;
+            }
         }
     }
 }

From 37c2e3e731b05a860b098f607748c8e3a4d23db3 Mon Sep 17 00:00:00 2001
From: Brian Rourke Boll 
Date: Mon, 3 Jun 2024 14:04:50 -0400
Subject: [PATCH 3/3] Tweak more margins

---
 docs/content/fsdocs-default.css | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/content/fsdocs-default.css b/docs/content/fsdocs-default.css
index 1da78df7..de9e2052 100644
--- a/docs/content/fsdocs-default.css
+++ b/docs/content/fsdocs-default.css
@@ -1121,7 +1121,7 @@ span[onmouseout] {
         }
 
         .fsdocs-returns, .fsdocs-params {
-            margin: var(--spacing-200);
+            margin: var(--spacing-200) 0 var(--spacing-200) var(--spacing-300);
 
             &:first-child {
                 margin-top: 0;
@@ -1145,6 +1145,7 @@ span[onmouseout] {
             flex-direction: row;
             justify-content: space-between;
             align-items: flex-start;
+                margin: 0 0 0 var(--spacing-300);
 
             & p {
                 margin: 0;