Skip to content

Commit 948118b

Browse files
Merge branch 'main' of https://github.com/fsprojects/FSharp.Formatting into deets-button
2 parents d038a74 + 6bd2905 commit 948118b

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
@@ -1053,8 +1053,8 @@ span[onmouseout] {
10531053
.fsdocs-entity-xmldoc {
10541054
> div {
10551055
display: flex;
1056-
flex-direction: row-reverse;
1057-
justify-content: flex-start;
1056+
flex-direction: row;
1057+
justify-content: space-between;
10581058
align-items: flex-start;
10591059

10601060
& p.fsdocs-summary {
@@ -1071,18 +1071,41 @@ span[onmouseout] {
10711071
}
10721072
}
10731073

1074+
.fsdocs-summary-contents {
1075+
display: flex;
1076+
flex-direction: column;
1077+
justify-content: flex-start;
1078+
align-items: flex-start;
1079+
}
1080+
1081+
.fsdocs-member-xmldoc-column {
1082+
width: 100%;
1083+
display: flex;
1084+
flex-direction: column;
1085+
justify-content: flex-start;
1086+
}
1087+
1088+
.icon-button-row {
1089+
display: flex;
1090+
flex-direction: row;
1091+
justify-content: flex-end;
1092+
align-items: flex-start;
1093+
height: calc(-1 * var(--spacing-200));
1094+
}
1095+
10741096
.fsdocs-member-xmldoc {
10751097
& summary {
10761098
display: list-item;
10771099
counter-increment: list-item 0;
10781100
list-style: disclosure-closed outside;
10791101
cursor: pointer;
1102+
width: calc(100% - var(--spacing-300));
10801103
margin-left: var(--spacing-300);
10811104

10821105
> .fsdocs-summary {
10831106
display: flex;
1084-
flex-direction: row-reverse;
1085-
justify-content: flex-start;
1107+
flex-direction: row;
1108+
justify-content: space-between;
10861109
align-items: flex-start;
10871110

10881111
& p.fsdocs-summary {
@@ -1105,7 +1128,7 @@ span[onmouseout] {
11051128
}
11061129

11071130
.fsdocs-returns, .fsdocs-params {
1108-
margin: var(--spacing-200);
1131+
margin: var(--spacing-200) 0 var(--spacing-200) var(--spacing-300);
11091132

11101133
&:first-child {
11111134
margin-top: 0;
@@ -1119,6 +1142,22 @@ span[onmouseout] {
11191142
.fsdocs-return-name, .fsdocs-param-name {
11201143
font-weight: 500;
11211144
}
1145+
1146+
.fsdocs-param-docs p {
1147+
margin: var(--spacing-200) 0;
1148+
}
1149+
1150+
> div.fsdocs-summary {
1151+
display: flex;
1152+
flex-direction: row;
1153+
justify-content: space-between;
1154+
align-items: flex-start;
1155+
margin: 0 0 0 var(--spacing-300);
1156+
1157+
& p {
1158+
margin: 0;
1159+
}
1160+
}
11221161
}
11231162
}
11241163

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)