Skip to content

Commit 6bd2905

Browse files
authored
Merge pull request #919 from brianrourkeboll/deets-2
More details/member docs tweaks
2 parents 56b856b + 37c2e3e commit 6bd2905

File tree

2 files changed

+59
-13
lines changed

2 files changed

+59
-13
lines changed

docs/content/fsdocs-default.css

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,8 @@ span[onmouseout] {
10461046
.fsdocs-entity-xmldoc {
10471047
> div {
10481048
display: flex;
1049-
flex-direction: row-reverse;
1050-
justify-content: flex-start;
1049+
flex-direction: row;
1050+
justify-content: space-between;
10511051
align-items: flex-start;
10521052

10531053
& p.fsdocs-summary {
@@ -1064,18 +1064,41 @@ span[onmouseout] {
10641064
}
10651065
}
10661066

1067+
.fsdocs-summary-contents {
1068+
display: flex;
1069+
flex-direction: column;
1070+
justify-content: flex-start;
1071+
align-items: flex-start;
1072+
}
1073+
1074+
.fsdocs-member-xmldoc-column {
1075+
width: 100%;
1076+
display: flex;
1077+
flex-direction: column;
1078+
justify-content: flex-start;
1079+
}
1080+
1081+
.icon-button-row {
1082+
display: flex;
1083+
flex-direction: row;
1084+
justify-content: flex-end;
1085+
align-items: flex-start;
1086+
height: calc(-1 * var(--spacing-200));
1087+
}
1088+
10671089
.fsdocs-member-xmldoc {
10681090
& summary {
10691091
display: list-item;
10701092
counter-increment: list-item 0;
10711093
list-style: disclosure-closed outside;
10721094
cursor: pointer;
1095+
width: calc(100% - var(--spacing-300));
10731096
margin-left: var(--spacing-300);
10741097

10751098
> .fsdocs-summary {
10761099
display: flex;
1077-
flex-direction: row-reverse;
1078-
justify-content: flex-start;
1100+
flex-direction: row;
1101+
justify-content: space-between;
10791102
align-items: flex-start;
10801103

10811104
& p.fsdocs-summary {
@@ -1098,7 +1121,7 @@ span[onmouseout] {
10981121
}
10991122

11001123
.fsdocs-returns, .fsdocs-params {
1101-
margin: var(--spacing-200);
1124+
margin: var(--spacing-200) 0 var(--spacing-200) var(--spacing-300);
11021125

11031126
&:first-child {
11041127
margin-top: 0;
@@ -1112,6 +1135,22 @@ span[onmouseout] {
11121135
.fsdocs-return-name, .fsdocs-param-name {
11131136
font-weight: 500;
11141137
}
1138+
1139+
.fsdocs-param-docs p {
1140+
margin: var(--spacing-200) 0;
1141+
}
1142+
1143+
> div.fsdocs-summary {
1144+
display: flex;
1145+
flex-direction: row;
1146+
justify-content: space-between;
1147+
align-items: flex-start;
1148+
margin: 0 0 0 var(--spacing-300);
1149+
1150+
& p {
1151+
margin: 0;
1152+
}
1153+
}
11151154
}
11161155
}
11171156

src/FSharp.Formatting.ApiDocs/GenerateHtml.fs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let fsdocsSummary (x: ApiDocHtml) =
1818
if x.HtmlText.StartsWith("<pre>", StringComparison.Ordinal) then
1919
embed x
2020
else
21-
p [ Class "fsdocs-summary" ] [ embed x ]
21+
div [ Class "fsdocs-summary-contents" ] [ p [ Class "fsdocs-summary" ] [ embed x ] ]
2222

2323
type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
2424
let root = model.Root
@@ -182,10 +182,12 @@ type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
182182

183183
let smry =
184184
div [ Class "fsdocs-summary" ] [
185-
yield! copyXmlSigIconForSymbolMarkdown m.Symbol
186-
yield! copyXmlSigIconForSymbol m.Symbol
187-
yield! sourceLink m.SourceLocation
188185
fsdocsSummary m.Comment.Summary
186+
div [ Class "icon-button-row" ] [
187+
yield! sourceLink m.SourceLocation
188+
yield! copyXmlSigIconForSymbol m.Symbol
189+
yield! copyXmlSigIconForSymbolMarkdown m.Symbol
190+
]
189191
]
190192

191193
let dtls =
@@ -272,7 +274,10 @@ type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
272274
if List.isEmpty dtls then
273275
smry
274276
elif String.IsNullOrWhiteSpace(m.Comment.Summary.HtmlText) then
275-
yield! dtls
277+
div [ Class "fsdocs-member-xmldoc-column" ] [
278+
div [ Class "icon-button-row" ] (sourceLink m.SourceLocation)
279+
yield! dtls
280+
]
276281
else
277282
details [] ((summary [] [ smry ]) :: dtls)
278283
]
@@ -325,10 +330,12 @@ type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
325330
]
326331
td [ Class "fsdocs-entity-xmldoc" ] [
327332
div [] [
328-
yield! copyXmlSigIconForSymbolMarkdown e.Symbol
329-
yield! copyXmlSigIconForSymbol e.Symbol
330-
yield! sourceLink e.SourceLocation
331333
fsdocsSummary e.Comment.Summary
334+
div [ Class "icon-button-row" ] [
335+
yield! sourceLink e.SourceLocation
336+
yield! copyXmlSigIconForSymbol e.Symbol
337+
yield! copyXmlSigIconForSymbolMarkdown e.Symbol
338+
]
332339
]
333340
]
334341
]

0 commit comments

Comments
 (0)