Skip to content

Commit 5c0aa28

Browse files
authored
docs: fix client links rendering in dark mode (#1964)
Improves contrast for the Client buttons in dark mode. Replaces the original SVG buttons with a logo and a text node. Removes unused `.redocusaurus` styles to improve CSS readability. Expands documentation on the Get Dataset endpoint so that the admonition clears the `float: right` client box. Closes #1949
1 parent 1e14608 commit 5c0aa28

File tree

3 files changed

+31
-42
lines changed

3 files changed

+31
-42
lines changed

apify-api/openapi/paths/datasets/datasets@{datasetId}.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ get:
55
description: |
66
Returns dataset object for given dataset ID.
77
8+
This does not return dataset items, only information about the storage itself.
9+
To retrieve dataset items, use the [List dataset items](/api/v2/dataset-items-get) endpoint.
10+
811
:::note
912
1013
Keep in mind that attributes `itemCount` and `cleanItemCount` are not propagated right away after data are pushed into a dataset.

apify-api/plugins/decorators/client-references-links-decorator.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function ClientReferencesLinksDecorator(target) {
3434
const pyLink = target[X_PY_DOC_URLS_PROPERTY];
3535
const jsLink = target[X_JS_DOC_URLS_PROPERTY];
3636

37-
const jsImgUrl = 'https://raw.githubusercontent.com/apify/openapi/b1206ac2adf8f39b05e5a09bf32c2802af58d851/assets/javascript.svg';
38-
const pyImgUrl = 'https://raw.githubusercontent.com/apify/openapi/b1206ac2adf8f39b05e5a09bf32c2802af58d851/assets/python.svg';
37+
const jsImgUrl = '/img/javascript-40x40.svg';
38+
const pyImgUrl = '/img/python-40x40.svg';
3939

4040
const jsAlt = 'Apify API JavaScript Client Reference';
4141
const pyAlt = 'Apify API Python Client Reference';
@@ -49,11 +49,13 @@ function ClientReferencesLinksDecorator(target) {
4949
}
5050

5151
if (pyLink) {
52-
prepend += `<a href="${pyLink}" target="_blank"><img src="${pyImgUrl}" class="openapi-clients-box-icon" alt="${pyAlt}"/></a>`;
52+
prepend += `<a href="${pyLink}" target="_blank" class="client-docs-link">
53+
<img src="${pyImgUrl}" class="openapi-clients-box-icon" width="24px" height="24px" alt="${pyAlt}"/>Python</a>`;
5354
}
5455

5556
if (jsLink) {
56-
prepend += `<a href="${jsLink}" target="_blank"><img src="${jsImgUrl}" class="openapi-clients-box-icon" alt="${jsAlt}" /></a>`;
57+
prepend += `<a href="${jsLink}" target="_blank" class="client-docs-link">
58+
<img src="${jsImgUrl}" class="openapi-clients-box-icon" width="24px" height="24px" alt="${jsAlt}" />JavaScript</a>`;
5759
}
5860

5961
prepend += `</span>`;

apify-docs-theme/src/theme/custom.css

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,18 +1740,6 @@ html[data-theme='dark'] .runnable-code-block svg .apify-logo {
17401740

17411741
}
17421742

1743-
.redocusaurus table code {
1744-
word-break: normal;
1745-
}
1746-
1747-
.redocusaurus .menu-content div:nth-child(2) ul {
1748-
padding-bottom: 0;
1749-
}
1750-
1751-
.redocusaurus .menu-content div:nth-child(2) div {
1752-
display: none;
1753-
}
1754-
17551743
.apiPage .tsd-panel-header .tsd-anchor-id {
17561744
top: -13rem;
17571745
}
@@ -1763,44 +1751,40 @@ iframe[src*="youtube"] {
17631751
margin-bottom: 1.6rem;
17641752
}
17651753

1766-
.redocusaurus div[data-section-id] span[id] {
1767-
margin-top: -130px;
1768-
position: absolute;
1769-
}
1770-
1771-
.redocusaurus .openapi-clients-box {
1754+
.theme-api-markdown .openapi-clients-box {
17721755
display: block;
17731756
float: right;
1774-
padding-left: 6px;
1757+
padding-left: 12px;
1758+
padding-right: 6px;
17751759
}
17761760

1777-
.redocusaurus .openapi-clients-box-heading {
1778-
display: inline-block;
1779-
font-family: 'San Francisco', Helvetica, Arial, sans-serif;
1780-
color: #6C7590;
1781-
font-style: normal;
1782-
font-weight: 700;
1783-
font-size: 14px;
1784-
line-height: 20px;
1785-
text-transform: uppercase;
1786-
padding-bottom: 6px;
1761+
.client-docs-link img {
1762+
border: 1px solid var(--color-neutral-action-secondary);
1763+
border-radius: 8px;
17871764
}
17881765

1789-
.redocusaurus .openapi-clients-box-icon {
1790-
display: block;
1791-
padding-bottom: 6px;
1766+
.client-docs-link {
1767+
display: flex;
1768+
flex-direction: row;
1769+
align-items: center;
1770+
justify-content: left;
1771+
gap: 8px;
1772+
padding: 4px 8px 8px 0px;
17921773
}
17931774

1794-
.theme-api-markdown .openapi-clients-box {
1795-
display: block;
1796-
float: right;
1797-
padding-left: 6px;
1775+
a.client-docs-link {
1776+
font-weight: 500;
1777+
color: var(--color-neutral-text-muted);
1778+
}
1779+
1780+
.theme-admonition {
1781+
clear: right;
17981782
}
17991783

18001784
.theme-api-markdown .openapi-clients-box-heading {
18011785
display: inline-block;
18021786
font-family: 'San Francisco', Helvetica, Arial, sans-serif;
1803-
color: #6C7590;
1787+
color: var(--color-neutral-text-muted);
18041788
font-style: normal;
18051789
font-weight: 700;
18061790
font-size: 14px;
@@ -1811,7 +1795,7 @@ iframe[src*="youtube"] {
18111795

18121796
.theme-api-markdown .openapi-clients-box-icon {
18131797
display: block;
1814-
padding-bottom: 6px;
1798+
padding: 2px;
18151799
margin: 0 !important;
18161800
}
18171801

0 commit comments

Comments
 (0)