Skip to content

Commit ddeea69

Browse files
Nest icons in own div; always show src link
1 parent 56b856b commit ddeea69

File tree

2 files changed

+49
-17
lines changed

2 files changed

+49
-17
lines changed

docs/content/fsdocs-default.css

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,15 +1046,10 @@ 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

1053-
& p.fsdocs-summary {
1054-
margin: 0;
1055-
flex-grow: 1;
1056-
}
1057-
10581053
& pre {
10591054
margin-bottom: var(--spacing-200);
10601055
padding: var(--spacing-50);
@@ -1064,18 +1059,41 @@ span[onmouseout] {
10641059
}
10651060
}
10661061

1062+
.fsdocs-summary-contents {
1063+
display: flex;
1064+
flex-direction: column;
1065+
justify-content: flex-start;
1066+
align-items: flex-start;
1067+
}
1068+
1069+
.fsdocs-member-xmldoc-column {
1070+
width: 100%;
1071+
display: flex;
1072+
flex-direction: column;
1073+
justify-content: flex-start;
1074+
}
1075+
1076+
.icon-button-row {
1077+
display: flex;
1078+
flex-direction: row;
1079+
justify-content: flex-end;
1080+
align-items: flex-start;
1081+
height: calc(-1 * var(--spacing-200));
1082+
}
1083+
10671084
.fsdocs-member-xmldoc {
10681085
& summary {
10691086
display: list-item;
10701087
counter-increment: list-item 0;
10711088
list-style: disclosure-closed outside;
10721089
cursor: pointer;
1090+
width: calc(100% - var(--spacing-300));
10731091
margin-left: var(--spacing-300);
10741092

10751093
> .fsdocs-summary {
10761094
display: flex;
1077-
flex-direction: row-reverse;
1078-
justify-content: flex-start;
1095+
flex-direction: row;
1096+
justify-content: space-between;
10791097
align-items: flex-start;
10801098

10811099
& p.fsdocs-summary {
@@ -1112,6 +1130,13 @@ span[onmouseout] {
11121130
.fsdocs-return-name, .fsdocs-param-name {
11131131
font-weight: 500;
11141132
}
1133+
1134+
> div.fsdocs-summary {
1135+
display: flex;
1136+
flex-direction: row;
1137+
justify-content: space-between;
1138+
align-items: flex-start;
1139+
}
11151140
}
11161141
}
11171142

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)