Skip to content

Commit fb79cec

Browse files
committed
improve webhook anotations styles
1 parent eaba1d2 commit fb79cec

File tree

9 files changed

+19
-16
lines changed

9 files changed

+19
-16
lines changed

dist/rapidoc-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rapidoc-min.js.gz

99 Bytes
Binary file not shown.

dist/report.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/examples/open-api-3-1.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
show-info = "true"
2121
show-header = "false"
2222
allow-server-selection = "false"
23-
render-style = "view"
23+
render-style = "read"
2424
allow-try = "true"
25+
use-path-in-nav-bar = "true"
2526
regular-font = 'Open Sans'
2627
mono-font = "Roboto Mono"
2728
> </rapi-doc>

docs/rapidoc-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/specs/open-api-3-1.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ info:
1515
paths:
1616
/pet/findByTags:
1717
get:
18-
tags:
19-
- pet
2018
summary: Finds Pets by tags
2119
description: >-
2220
Muliple tags can be provided with comma seperated strings. Use tag1,

src/templates/endpoint-template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function endpointHeadTemplate(path) {
4646
<div class="method ${path.method} ${path.deprecated ? 'deprecated' : ''}"> ${path.method} </div>
4747
<div class="path ${path.deprecated ? 'deprecated' : ''}">
4848
${path.path}
49-
${path.isWebhook ? html`<span style="color:var(--primary-color)"> (Webhook) </span>` : ''}
49+
${path.isWebhook ? html`<span style="font-family: var(--font-regular); font-size: var(--); font-size: var(--font-size-small); color:var(--primary-color); margin-left: 16px"> Webhook</span>` : ''}
5050
</div>
5151
${path.deprecated
5252
? html`

src/templates/expanded-endpoint-template.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ export function expandedEndpointBodyTemplate(path, tagName = '') {
4141
${path.deprecated ? html`<div class="bold-text red-text"> DEPRECATED </div>` : ''}
4242
${html`
4343
<h2> ${path.shortSummary || `${path.method.toUpperCase()} ${path.path}`}</h2>
44-
<div class='mono-font part="section-operation-url" regular-font-size' style='padding: 8px 0; color:var(--fg3)'>
45-
${path.isWebhook ? html`<span style="color:var(--primary-color)"> WEBHOOK </span>` : ''}
46-
<span part="label-operation-method" class='regular-font upper method-fg bold-text ${path.method}'>${path.method}</span>
47-
<span part="label-operation-path">${path.path}</span>
48-
</div>
44+
${path.isWebhook
45+
? html`<span style="color:var(--primary-color); font-weight:bold; font-size: var(--font-size-regular);"> WEBHOOK </span>`
46+
: html`
47+
<div class='mono-font part="section-operation-url" regular-font-size' style='padding: 8px 0; color:var(--fg3)'>
48+
<span part="label-operation-method" class='regular-font upper method-fg bold-text ${path.method}'>${path.method}</span>
49+
<span part="label-operation-path">${path.path}</span>
50+
</div>
51+
`
52+
}
4953
<slot name="${path.elementId}"></slot>`
5054
}
5155
${path.description ? html`<div class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}

src/templates/navbar-template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ export default function navbarTemplate() {
193193
}}'
194194
>
195195
<span style = "${p.deprecated ? 'filter:opacity(0.5)' : ''}">
196+
${p.isWebhook ? html`<span style="font-weight:bold; margin-right:8px; font-size: calc(var(--font-size-small) - 2px)">WEBHOOK</span>` : ''}
196197
${this.usePathInNavBar === 'true'
197198
? html`<span class='mono-font'>${p.method.toUpperCase()} ${p.path}</span>`
198199
: p.summary || p.shortSummary
199200
}
200-
${p.isWebhook ? '(Webhook)' : ''}
201201
</span>
202202
</div>`)}
203203
</div>

0 commit comments

Comments
 (0)