@stainless-api/docs 0.1.0-beta.98 → 1.0.0-beta.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +404 -0
- package/ambient.d.ts +6 -0
- package/eslint-suppressions.json +22 -6
- package/{eslint.config.js → eslint.config.ts} +1 -7
- package/package.json +57 -40
- package/plugin/assets/languages/php.svg +4 -0
- package/plugin/buildAlgoliaIndex.ts +6 -12
- package/plugin/components/SDKSelect.astro +0 -6
- package/plugin/components/SnippetCode.tsx +6 -37
- package/plugin/components/search/SearchAlgolia.astro +1 -1
- package/plugin/components/search/SearchIsland.tsx +19 -13
- package/plugin/generateAPIReferenceLink.ts +0 -40
- package/plugin/globalJs/ai-dropdown-options.ts +26 -13
- package/plugin/globalJs/code-snippets.ts +5 -5
- package/plugin/globalJs/copy.ts +20 -91
- package/plugin/globalJs/navigation.ts +13 -13
- package/plugin/globalJs/summary-selection-tweak.ts +29 -0
- package/plugin/index.ts +107 -163
- package/plugin/languages.ts +2 -1
- package/plugin/loadPluginConfig.ts +50 -153
- package/plugin/markdown/highlighter.ts +100 -0
- package/plugin/markdown/index.ts +39 -0
- package/plugin/middlewareBuilder/stainlessMiddleware.d.ts +2 -0
- package/plugin/react/Routing.tsx +10 -244
- package/plugin/referencePlaceholderUtils.ts +1 -1
- package/plugin/replaceSidebarPlaceholderMiddleware.ts +1 -1
- package/plugin/routes/Docs.astro +3 -1
- package/plugin/routes/Overview.astro +14 -7
- package/plugin/routes/llms.ts +186 -0
- package/plugin/routes/markdown.ts +62 -13
- package/plugin/sidebar-utils/sidebar-builder.ts +38 -12
- package/plugin/specs/defaultSpecLoader.ts +192 -0
- package/plugin/specs/fetchSpecSSR.ts +1 -1
- package/plugin/specs/utils.ts +86 -0
- package/shared/conditionalIntegration.ts +28 -0
- package/shared/getProsePages.ts +6 -7
- package/shared/virtualModule.ts +1 -26
- package/stl-docs/aiChatExamples.ts +31 -0
- package/stl-docs/chat/docs-chat-handler.ts +17 -0
- package/stl-docs/chat/hook.ts +225 -0
- package/stl-docs/chat/schemas.ts +27 -0
- package/stl-docs/chat/ui/AiChat.module.css +591 -0
- package/stl-docs/chat/ui/AiChat.tsx +175 -0
- package/stl-docs/chat/ui/Trigger.tsx +154 -0
- package/stl-docs/chat/ui/components/ChatControls.tsx +51 -0
- package/stl-docs/chat/ui/components/ChatEmpty.tsx +42 -0
- package/stl-docs/chat/ui/components/ChatLog.tsx +93 -0
- package/stl-docs/chat/ui/components/ChatMessage.tsx +47 -0
- package/stl-docs/chat/ui/components/CodeBlock.tsx +33 -0
- package/stl-docs/chat/ui/components/MessageFeedback.tsx +106 -0
- package/stl-docs/chat/ui/components/Table.tsx +15 -0
- package/stl-docs/chat/ui/components/ToolCall.tsx +34 -0
- package/stl-docs/chat/ui/components/hljs-github.css +81 -0
- package/stl-docs/chat/ui/scroll-manager.ts +86 -0
- package/stl-docs/chat/ui/types.ts +45 -0
- package/stl-docs/components/AiChatIsland.tsx +10 -12
- package/stl-docs/components/ContentPanel.astro +9 -0
- package/stl-docs/components/Footer.astro +89 -0
- package/stl-docs/components/Header.astro +0 -5
- package/stl-docs/components/PageFrame.astro +23 -8
- package/stl-docs/components/PageSidebar.astro +11 -0
- package/stl-docs/components/StainlessLogo.svg +4 -0
- package/stl-docs/components/TwoColumnContent.astro +2 -0
- package/stl-docs/components/headers/DefaultHeader.astro +6 -8
- package/stl-docs/components/headers/StackedHeader.astro +5 -53
- package/stl-docs/components/mintlify-compat/Accordion.astro +2 -2
- package/stl-docs/components/mintlify-compat/AccordionGroup.astro +0 -4
- package/stl-docs/components/mintlify-compat/Columns.astro +2 -2
- package/stl-docs/components/mintlify-compat/Frame.astro +2 -2
- package/stl-docs/components/mintlify-compat/Tab.astro +2 -2
- package/stl-docs/components/mintlify-compat/callouts/Callout.astro +2 -2
- package/stl-docs/components/mintlify-compat/callouts/Check.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Danger.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Info.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Note.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Tip.astro +0 -4
- package/stl-docs/components/mintlify-compat/callouts/Warning.astro +0 -4
- package/stl-docs/components/nav-tabs/NavDropdown.astro +12 -7
- package/stl-docs/components/nav-tabs/NavTabs.astro +5 -3
- package/stl-docs/components/nav-tabs/buildNavLinks.ts +2 -0
- package/stl-docs/components/pagination/Pagination.astro +4 -2
- package/stl-docs/components/pagination/PaginationLinkEmphasized.astro +2 -2
- package/stl-docs/components/pagination/PaginationLinkQuiet.astro +2 -2
- package/stl-docs/components/pagination/util.ts +3 -3
- package/stl-docs/components/sidebars/BaseSidebar.astro +72 -1
- package/stl-docs/disableCalloutSyntax.ts +1 -1
- package/stl-docs/fonts.ts +5 -5
- package/stl-docs/index.ts +76 -53
- package/stl-docs/loadStlDocsConfig.ts +38 -8
- package/stl-docs/og-image/components/OpenGraphFunctionSignature.tsx +64 -0
- package/stl-docs/og-image/components/OpenGraphImage.tsx +126 -0
- package/stl-docs/og-image/config.ts +56 -0
- package/stl-docs/og-image/image-gen/generate-api-reference-og-image.tsx +188 -0
- package/stl-docs/og-image/image-gen/generate-og-image.tsx +119 -0
- package/stl-docs/og-image/image-gen/get-logo-url.ts +47 -0
- package/stl-docs/og-image/index.ts +135 -0
- package/stl-docs/og-image/routes/add-og-image.ts +45 -0
- package/stl-docs/og-image/routes/get-api-reference-og-image.ts +36 -0
- package/stl-docs/og-image/routes/get-og-image.ts +28 -0
- package/stl-docs/og-image/theme.ts +43 -0
- package/stl-docs/og-image/utils.ts +14 -0
- package/stl-docs/proseDocSync.test.ts +74 -0
- package/stl-docs/proseDocSync.ts +344 -0
- package/stl-docs/proseMarkdown/proseMarkdownIntegration.ts +4 -12
- package/stl-docs/schema-extension.ts +12 -0
- package/stl-docs/tabsMiddleware.ts +1 -1
- package/styles/overrides.css +2 -14
- package/styles/page.css +210 -71
- package/styles/sidebar.css +30 -17
- package/styles/sl-variables.css +3 -8
- package/styles/stldocs-variables.css +2 -2
- package/styles/toc.css +8 -0
- package/tsconfig.json +1 -1
- package/virtual-module.d.ts +35 -11
- package/playground-virtual-modules.d.ts +0 -96
- package/plugin/globalJs/create-playground.shim.ts +0 -3
- package/plugin/globalJs/playground-data.shim.ts +0 -1
- package/plugin/globalJs/playground-data.ts +0 -14
- package/plugin/specs/FileCache.ts +0 -99
- package/plugin/specs/generateSpec.ts +0 -112
- package/plugin/specs/index.ts +0 -132
- package/plugin/specs/inputResolver.ts +0 -146
- package/plugin/specs/worker.ts +0 -199
- package/plugin/vendor/preview.worker.docs.js +0 -26108
- package/plugin/vendor/templates/cli.md +0 -1
- package/plugin/vendor/templates/go.md +0 -316
- package/plugin/vendor/templates/java.md +0 -89
- package/plugin/vendor/templates/kotlin.md +0 -89
- package/plugin/vendor/templates/node.md +0 -235
- package/plugin/vendor/templates/python.md +0 -251
- package/plugin/vendor/templates/ruby.md +0 -147
- package/plugin/vendor/templates/terraform.md +0 -60
- package/plugin/vendor/templates/typescript.md +0 -319
- package/scripts/vendor_deps.ts +0 -50
- package/stl-docs/components/ClientRouterHead.astro +0 -41
- package/stl-docs/components/content-panel/ContentPanel.astro +0 -42
- package/stl-docs/components/headers/SplashMobileMenuToggle.astro +0 -65
- package/stl-docs/proseSearchIndexing.ts +0 -606
|
@@ -3,32 +3,26 @@ import LanguageSelect from 'virtual:starlight/components/LanguageSelect';
|
|
|
3
3
|
import Search from 'virtual:starlight/components/Search';
|
|
4
4
|
import SiteTitle from 'virtual:starlight/components/SiteTitle';
|
|
5
5
|
import HeaderLinks from './HeaderLinks.astro';
|
|
6
|
-
import { TABS } from 'virtual:stl-docs-virtual-module';
|
|
7
6
|
import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
|
|
8
7
|
import SecondaryNavTabs from '../nav-tabs/SecondaryNavTabs.astro';
|
|
9
|
-
import SplashMobileMenuToggle from './SplashMobileMenuToggle.astro';
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
type Props = {
|
|
12
10
|
shouldRenderSearch?: boolean;
|
|
13
|
-
}
|
|
11
|
+
};
|
|
14
12
|
|
|
15
13
|
const { shouldRenderSearch } = Astro.props;
|
|
16
|
-
const { hasSidebar } = Astro.locals.starlightRoute;
|
|
17
14
|
---
|
|
18
15
|
|
|
19
|
-
<div class="header
|
|
16
|
+
<div class="header">
|
|
20
17
|
<div class="left-group">
|
|
21
18
|
<div class="title-wrapper sl-flex">
|
|
22
19
|
<SiteTitle />
|
|
23
20
|
</div>
|
|
24
21
|
</div>
|
|
25
22
|
|
|
26
|
-
<
|
|
27
|
-
{shouldRenderSearch && <Search />}
|
|
28
|
-
{!hasSidebar && <SplashMobileMenuToggle />}
|
|
29
|
-
</div>
|
|
23
|
+
{shouldRenderSearch && <Search />}
|
|
30
24
|
|
|
31
|
-
<div class=
|
|
25
|
+
<div class="right-group">
|
|
32
26
|
<ThemeSelect />
|
|
33
27
|
<HeaderLinks />
|
|
34
28
|
<LanguageSelect />
|
|
@@ -36,45 +30,3 @@ const { hasSidebar } = Astro.locals.starlightRoute;
|
|
|
36
30
|
</div>
|
|
37
31
|
|
|
38
32
|
<SecondaryNavTabs />
|
|
39
|
-
|
|
40
|
-
<style is:inline>
|
|
41
|
-
.stl-top-container {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: row;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: end;
|
|
46
|
-
gap: 0.5rem;
|
|
47
|
-
width: 100%;
|
|
48
|
-
}
|
|
49
|
-
@media (min-width: 50rem) {
|
|
50
|
-
:root {
|
|
51
|
-
--sl-nav-height: 88px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
header.header {
|
|
55
|
-
display: flex;
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
gap: 0.29rem;
|
|
58
|
-
padding-bottom: 0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.stl-top-container {
|
|
62
|
-
justify-content: center;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
</style>
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
TABS.length === 0 && (
|
|
69
|
-
<style
|
|
70
|
-
is:inline
|
|
71
|
-
set:text={`
|
|
72
|
-
@media (min-width: 50rem) {
|
|
73
|
-
:root {
|
|
74
|
-
--sl-nav-height: 56px;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`}
|
|
78
|
-
/>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { Callout as StainlessCallout, type CalloutVariant } from '@stainless-api/ui-primitives';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type Props = {
|
|
5
5
|
variant?: CalloutVariant;
|
|
6
6
|
children: astroHTML.JSX.Children;
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
|
|
9
9
|
const { variant } = Astro.props;
|
|
10
10
|
---
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { Dropdown } from '@stainless-api/docs/components';
|
|
3
|
-
import { buildNavLinks } from './buildNavLinks';
|
|
4
2
|
import { ChevronsUpDownIcon } from 'lucide-react';
|
|
3
|
+
import { Dropdown } from '@stainless-api/docs/components';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
import type { NavLink } from './buildNavLinks';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
type Props = {
|
|
8
|
+
links: NavLink[];
|
|
9
|
+
currentItem: NavLink | null;
|
|
10
|
+
};
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
<Dropdown id="nav-dropdown" className="nav-dropdown-root">
|
|
12
14
|
<Dropdown.Trigger>
|
|
13
|
-
<Dropdown.TriggerSelectedItem>
|
|
15
|
+
<Dropdown.TriggerSelectedItem>
|
|
16
|
+
{Astro.props.currentItem ? Astro.props.currentItem.label : 'Navigation'}
|
|
17
|
+
</Dropdown.TriggerSelectedItem>
|
|
14
18
|
<Dropdown.TriggerIcon>
|
|
15
19
|
<ChevronsUpDownIcon size={16} />
|
|
16
20
|
</Dropdown.TriggerIcon>
|
|
17
21
|
</Dropdown.Trigger>
|
|
18
22
|
<Dropdown.Menu className="dropdown-menu">
|
|
19
23
|
{
|
|
20
|
-
|
|
24
|
+
Astro.props.links.map((item) => (
|
|
21
25
|
<Dropdown.MenuItem
|
|
22
26
|
key={item.link}
|
|
23
27
|
href={item.link}
|
|
24
28
|
className="dropdown-item"
|
|
25
29
|
value={item.label}
|
|
26
|
-
isSelected={item.
|
|
30
|
+
isSelected={item.active}
|
|
27
31
|
>
|
|
28
32
|
{item.label}
|
|
29
33
|
<Dropdown.MenuItemTemplate>{item.label}</Dropdown.MenuItemTemplate>
|
|
@@ -39,6 +43,7 @@ const buttonText = (navLinks.find((item) => item.active) ?? navLinks[0]!).label;
|
|
|
39
43
|
|
|
40
44
|
document.addEventListener(getPageLoadEvent(), () => {
|
|
41
45
|
initDropdown({
|
|
46
|
+
initialValue: null,
|
|
42
47
|
root: document.getElementById('nav-dropdown'),
|
|
43
48
|
});
|
|
44
49
|
});
|
|
@@ -5,6 +5,8 @@ import NavDropdown from './NavDropdown.astro';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
7
|
const navLinks = buildNavLinks(Astro.locals.starlightRoute);
|
|
8
|
+
|
|
9
|
+
const currentItem = navLinks.find((item) => item.active) ?? null;
|
|
8
10
|
---
|
|
9
11
|
|
|
10
12
|
<div id="nav-links-container" class="nav-links-container">
|
|
@@ -26,7 +28,7 @@ const navLinks = buildNavLinks(Astro.locals.starlightRoute);
|
|
|
26
28
|
</ul>
|
|
27
29
|
</div>
|
|
28
30
|
<div class="mobile-nav-dropdown" data-mobile-only>
|
|
29
|
-
<NavDropdown />
|
|
31
|
+
{navLinks.length > 0 && <NavDropdown links={navLinks} currentItem={currentItem} />}
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
34
|
|
|
@@ -90,8 +92,8 @@ const navLinks = buildNavLinks(Astro.locals.starlightRoute);
|
|
|
90
92
|
|
|
91
93
|
localStorage.setItem('stl-nav-links-mode', mode);
|
|
92
94
|
|
|
93
|
-
document.documentElement.classList.
|
|
94
|
-
document.documentElement.classList.
|
|
95
|
+
document.documentElement.classList.toggle('stl-nav-links-mode-desktop', mode === 'desktop');
|
|
96
|
+
document.documentElement.classList.toggle('stl-nav-links-mode-mobile', mode === 'mobile');
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -52,11 +52,14 @@ const { prev, next } = (await getPrevNextPage(Astro.locals.starlightRoute, confi
|
|
|
52
52
|
.pagination-links {
|
|
53
53
|
--stl-ui-pagination-padding: 8px;
|
|
54
54
|
--stl-ui-pagination-border-radius-inner: var(--stl-ui-layout-border-radius-sml);
|
|
55
|
+
--stl-ui-pagination-border-radius-outer: calc(
|
|
56
|
+
var(--stl-ui-pagination-border-radius-inner) + var(--stl-ui-pagination-padding)
|
|
57
|
+
);
|
|
55
58
|
|
|
56
59
|
padding: var(--stl-ui-pagination-padding);
|
|
57
60
|
background-color: var(--stl-color-faint-background);
|
|
58
61
|
border: 1px solid var(--stl-color-border);
|
|
59
|
-
border-radius:
|
|
62
|
+
border-radius: var(--stl-ui-pagination-border-radius-outer);
|
|
60
63
|
|
|
61
64
|
font-size: var(--stl-typography-scale-sm);
|
|
62
65
|
letter-spacing: normal;
|
|
@@ -64,7 +67,6 @@ const { prev, next } = (await getPrevNextPage(Astro.locals.starlightRoute, confi
|
|
|
64
67
|
display: flex;
|
|
65
68
|
gap: 8px;
|
|
66
69
|
|
|
67
|
-
margin-bottom: 2rem;
|
|
68
70
|
color: inherit; /* stl-ui-not-prose sets color: initial */
|
|
69
71
|
|
|
70
72
|
a {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
3
3
|
const { href, direction } = Astro.props;
|
|
4
|
-
|
|
4
|
+
type Props = {
|
|
5
5
|
href: string;
|
|
6
6
|
direction: 'prev' | 'next';
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
<a href={href} class="pagination-links__link pagination-links__link--emphasized">
|
|
@@ -2,10 +2,10 @@ import type { StarlightRouteData } from '@astrojs/starlight/route-data';
|
|
|
2
2
|
import { getCollection } from 'astro:content';
|
|
3
3
|
|
|
4
4
|
export type SidebarEntry = StarlightRouteData['sidebar'][number];
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type SidebarLink = Extract<SidebarEntry, { type: 'link' }>;
|
|
6
|
+
type SidebarGroup = Extract<SidebarEntry, { type: 'group' }>;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const flattenSidebar = (sidebar: SidebarEntry[]): SidebarLink[] =>
|
|
9
9
|
sidebar.flatMap((e) => (e.type === 'group' ? flattenSidebar(e.entries) : e));
|
|
10
10
|
|
|
11
11
|
function findParentOfSidebarEntry(sidebar: SidebarEntry[], targetEntry: SidebarEntry): SidebarGroup | null {
|
|
@@ -3,9 +3,80 @@ import HeaderLinks from '../headers/HeaderLinks.astro';
|
|
|
3
3
|
import { SidebarWithComponents } from './SidebarWithComponents';
|
|
4
4
|
import SidebarPersister from '@astrojs/starlight/components/SidebarPersister.astro';
|
|
5
5
|
import { convertAstroSidebarToStl } from './convertAstroSidebarToStl';
|
|
6
|
+
import { StlSidebarEntry, StlSidebarGroup, StlSidebarLink } from '@stainless-api/docs-ui/components';
|
|
7
|
+
import { LINK_GROUP_TITLES_TO_OVERVIEW_PAGES } from 'virtual:stl-docs-virtual-module';
|
|
6
8
|
|
|
7
9
|
const { sidebar } = Astro.locals.starlightRoute;
|
|
8
|
-
|
|
10
|
+
|
|
11
|
+
let stlSidebar = convertAstroSidebarToStl(sidebar);
|
|
12
|
+
|
|
13
|
+
function extractOverviewPage(entry: StlSidebarGroup): {
|
|
14
|
+
overviewLink: StlSidebarLink | null;
|
|
15
|
+
remainingEntries: StlSidebarEntry[];
|
|
16
|
+
} {
|
|
17
|
+
let overviewLink: StlSidebarLink | null = null;
|
|
18
|
+
|
|
19
|
+
const withoutOverview = entry.entries.filter((e) => {
|
|
20
|
+
if (e.type !== 'link') {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
const overviewAttr = e.attrs?.['data-stldocs-overview'];
|
|
24
|
+
if (!overviewAttr) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
overviewLink = e;
|
|
28
|
+
return false;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
overviewLink,
|
|
33
|
+
remainingEntries: withoutOverview,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function linkGroupTitleToOverviewPages(sidebar: StlSidebarEntry[]): StlSidebarEntry[] {
|
|
38
|
+
return sidebar.map((entry) => {
|
|
39
|
+
if (entry.type === 'group') {
|
|
40
|
+
const { overviewLink, remainingEntries } = extractOverviewPage(entry);
|
|
41
|
+
|
|
42
|
+
// group only contained an overview link
|
|
43
|
+
if (overviewLink && remainingEntries.length === 0) {
|
|
44
|
+
return {
|
|
45
|
+
...overviewLink,
|
|
46
|
+
label: entry.label, // keep the group label
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// set the group target to the overview link target
|
|
51
|
+
|
|
52
|
+
let target = entry.target;
|
|
53
|
+
let isCurrent = entry.isCurrent;
|
|
54
|
+
let collapsed = entry.collapsed;
|
|
55
|
+
if (overviewLink) {
|
|
56
|
+
target = overviewLink.target;
|
|
57
|
+
isCurrent = overviewLink.isCurrent;
|
|
58
|
+
if (isCurrent) {
|
|
59
|
+
collapsed = false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
...entry,
|
|
65
|
+
entries: linkGroupTitleToOverviewPages(remainingEntries),
|
|
66
|
+
target,
|
|
67
|
+
isCurrent,
|
|
68
|
+
collapsed,
|
|
69
|
+
};
|
|
70
|
+
} else {
|
|
71
|
+
return entry;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Since Terraform only renders the top level resource, we don't need to link group titles to overview pages.
|
|
77
|
+
if (LINK_GROUP_TITLES_TO_OVERVIEW_PAGES === true && Astro.locals.language !== 'terraform') {
|
|
78
|
+
stlSidebar = linkGroupTitleToOverviewPages(stlSidebar);
|
|
79
|
+
}
|
|
9
80
|
---
|
|
10
81
|
|
|
11
82
|
<div class="stl-sidebar-header-links">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AstroIntegration } from 'astro';
|
|
2
2
|
import type { StarlightPlugin } from '@astrojs/starlight/types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const disableCalloutSyntaxAstroIntegration = {
|
|
5
5
|
name: 'stl-starlight-remove-callout-syntax',
|
|
6
6
|
hooks: {
|
|
7
7
|
'astro:config:setup': ({ config: astroConfig }) => {
|
package/stl-docs/fonts.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type { Defined } from './loadStlDocsConfig';
|
|
|
3
3
|
import { fontProviders } from 'astro/config';
|
|
4
4
|
import type { FontPreloadFilter } from 'astro:assets';
|
|
5
5
|
|
|
6
|
-
type AstroFontConfigEntry = Defined<AstroConfig['
|
|
6
|
+
type AstroFontConfigEntry = Defined<AstroConfig['fonts']>[number];
|
|
7
7
|
|
|
8
8
|
// Apply Omit to each member of the union while preserving union structure
|
|
9
9
|
type PreloadFilter = { preload?: FontPreloadFilter };
|
|
10
|
-
|
|
10
|
+
type StlDocsFontConfigEntry = (AstroFontConfigEntry extends infer T
|
|
11
11
|
? T extends unknown
|
|
12
12
|
? Omit<T, 'cssVariable'>
|
|
13
13
|
: never
|
|
@@ -165,19 +165,19 @@ export function flattenFonts(fonts: StlDocsFontConfig | undefined): AstroFontCon
|
|
|
165
165
|
fontConfigs.push({
|
|
166
166
|
...fonts.primary,
|
|
167
167
|
cssVariable: '--stl-typography-font' as const,
|
|
168
|
-
}
|
|
168
|
+
});
|
|
169
169
|
}
|
|
170
170
|
if (fonts.heading) {
|
|
171
171
|
fontConfigs.push({
|
|
172
172
|
...fonts.heading,
|
|
173
173
|
cssVariable: '--stl-typography-font-heading' as const,
|
|
174
|
-
}
|
|
174
|
+
});
|
|
175
175
|
}
|
|
176
176
|
if (fonts.mono) {
|
|
177
177
|
fontConfigs.push({
|
|
178
178
|
...fonts.mono,
|
|
179
179
|
cssVariable: '--stl-typography-font-mono' as const,
|
|
180
|
-
}
|
|
180
|
+
});
|
|
181
181
|
}
|
|
182
182
|
if (fonts.additional) {
|
|
183
183
|
fontConfigs.push(...fonts.additional.map((font) => font as AstroFontConfigEntry));
|