Skip to content

Commit 9ba3277

Browse files
committed
fixes
1 parent f4e9260 commit 9ba3277

File tree

7 files changed

+43
-34
lines changed

7 files changed

+43
-34
lines changed

src/html/templates/breadcrumbs.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ul>
55
{{~/if~}}
66

7-
<li class="inline {{#if @first}}text-xl lg:text-2xl leading-none font-bold{{else}}lg:text-xl leading-[0.9em]{{/if}} {{#unless (or @last this.is_symbol)}}rounded-lg hover:bg-[#EBF6FF]{{/unless}}">
7+
<li>
88
{{~#if @last~}}
99
{{~this.name~}}
1010
{{~else~}}

src/html/templates/pages/page.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
body {
66
@apply flex flex-col lg:flex-row w-full overflow-x-hidden;
77
}
8+
89
#content {
9-
@apply p-7 max-w-screen-xl w-full overflow-x-hidden
10+
@apply p-7 max-w-screen-xl w-full overflow-x-hidden;
11+
12+
&:not(:has(#sidepanel)) {
13+
@apply mx-auto;
14+
}
1015
}
16+
1117
#sidepanel {
1218
@apply py-3 pl-3 lg:w-72;
1319
}

src/html/templates/pages/page.gen.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/html/templates/styles.css

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ summary::-webkit-details-marker {
121121
}
122122

123123
.namespaceSection {
124-
@apply grid grid-cols-1 gap-y-3 lg:grid-cols-4 lg:gap-x-3 lg:gap-y-8;
124+
@apply grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-y-3 md:gap-x-3 md:gap-y-8;
125125

126126
.namespaceItem {
127127
@apply flex gap-x-2.5;
@@ -242,21 +242,25 @@ summary::-webkit-details-marker {
242242
}
243243
}
244244
}
245+
}
245246

246-
pre.highlight {
247-
@apply border border-gray-300 max-md:border-x-0;
248-
}
247+
.usageContent pre.highlight {
248+
@apply border border-gray-300 max-md:border-x-0;
249249
}
250250

251251
.contextLink {
252-
@apply text-contextLink underline decoration-[1.5px] decoration-contextLink/50 underline-offset-4 hover:decoration-contextLink;
252+
@apply text-contextLink/80 underline decoration-[1.5px] decoration-contextLink/50 underline-offset-4 hover:text-contextLink hover:decoration-contextLink;
253253
}
254254

255255
.breadcrumbs {
256256
@apply whitespace-nowrap inline-flex gap-1 items-center;
257257

258-
> li, > ul {
259-
@apply py-1 px-2;
258+
> li:first-child {
259+
@apply text-xl lg:text-2xl leading-none font-bold;
260+
}
261+
262+
li {
263+
@apply inline lg:text-xl leading-[0.9em];
260264
}
261265
}
262266

src/html/templates/styles.gen.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/html/templates/usages.hbs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<div class="usage">
2-
{{~#each usages~}}
3-
<style scoped>
4-
{{{~additional_css~}}} {{! css }}
5-
</style>
1+
{{~#if (gte (len usages) 2) ~}}
2+
<div class="usage">
3+
{{~#each usages~}}
4+
<style scoped>
5+
{{{~additional_css~}}} {{! css }}
6+
</style>
67

7-
<input type="radio" name="usage" id="{{name}}" class="hidden" {{~#if @first~}}checked{{~/if~}} />
8-
{{~/each~}}
8+
<input type="radio" name="usage" id="{{name}}" class="hidden" {{~#if @first~}}checked{{~/if~}} />
9+
{{~/each~}}
910

10-
{{~#if ../show_tabs~}}
11-
<nav>
11+
<nav>
1212
<span>Usage instructions for</span>
1313

1414
<details id="usageSelector">
@@ -37,13 +37,17 @@
3737
</div>
3838
</details>
3939
</nav>
40-
{{~/if}}
4140

42-
<div>
43-
{{~#each usages~}}
44-
<div id="{{name}}_content">
45-
{{{~content~}}} {{! markdown rendering }}
46-
</div>
47-
{{~/each~}}
41+
<div>
42+
{{~#each usages~}}
43+
<div id="{{name}}_content" class="usageContent">
44+
{{{~content~}}} {{! markdown rendering }}
45+
</div>
46+
{{~/each~}}
47+
</div>
48+
</div>
49+
{{~else~}}
50+
<div class="usageContent">
51+
{{{~usages.[0].content~}}} {{! markdown rendering }}
4852
</div>
49-
</div>
53+
{{~/if~}}

src/html/usage.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ pub fn usage_to_md(
103103

104104
#[derive(Clone, Debug, Serialize)]
105105
pub struct UsagesCtx {
106-
show_tabs: bool,
107106
usages: Vec<UsageCtx>,
108107
}
109108

@@ -149,18 +148,14 @@ impl UsagesCtx {
149148
if usages.is_empty() {
150149
None
151150
} else {
152-
Some(UsagesCtx {
153-
show_tabs: true,
154-
usages,
155-
})
151+
Some(UsagesCtx { usages })
156152
}
157153
} else {
158154
let import_statement = usage_to_md(ctx, doc_nodes, &url);
159155
let rendered_import_statement =
160156
crate::html::jsdoc::render_markdown(ctx, &import_statement);
161157

162158
Some(UsagesCtx {
163-
show_tabs: false,
164159
usages: vec![UsageCtx {
165160
name: "".to_string(),
166161
content: rendered_import_statement,

0 commit comments

Comments
 (0)