@seqera/docusaurus-theme-seqera 1.0.0
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/README.md +26 -0
- package/package.json +66 -0
- package/src/getSwizzleConfig.ts +433 -0
- package/src/index.ts +154 -0
- package/src/inlineScripts.ts +95 -0
- package/src/inlineSvgSprites.ts +7 -0
- package/src/main-styles.css +322 -0
- package/src/nprogress.css +36 -0
- package/src/nprogress.ts +27 -0
- package/src/options.ts +503 -0
- package/src/prism-include-languages.ts +6 -0
- package/src/styles/api.css +42 -0
- package/src/styles/typography.css +342 -0
- package/src/theme/Admonition/Icon/Danger.tsx +15 -0
- package/src/theme/Admonition/Icon/Info.tsx +15 -0
- package/src/theme/Admonition/Icon/Note.tsx +15 -0
- package/src/theme/Admonition/Icon/Tip.tsx +15 -0
- package/src/theme/Admonition/Icon/Warning.tsx +15 -0
- package/src/theme/Admonition/Layout/index.tsx +53 -0
- package/src/theme/Admonition/Layout/styles.module.css +39 -0
- package/src/theme/Admonition/Type/Caution.tsx +34 -0
- package/src/theme/Admonition/Type/Danger.tsx +32 -0
- package/src/theme/Admonition/Type/Info.tsx +32 -0
- package/src/theme/Admonition/Type/Note.tsx +32 -0
- package/src/theme/Admonition/Type/Tip.tsx +32 -0
- package/src/theme/Admonition/Type/Warning.tsx +32 -0
- package/src/theme/Admonition/Types.tsx +33 -0
- package/src/theme/Admonition/index.tsx +23 -0
- package/src/theme/AdmonitionVersioned/AddedInVersion.tsx +14 -0
- package/src/theme/AdmonitionVersioned/AdmonitionVersioned.tsx +66 -0
- package/src/theme/AdmonitionVersioned/ChangedInVersion.tsx +14 -0
- package/src/theme/AdmonitionVersioned/DeprecatedInVersion.tsx +15 -0
- package/src/theme/AdmonitionVersioned/getStableVersion.ts +30 -0
- package/src/theme/AdmonitionVersioned/index.ts +1 -0
- package/src/theme/AdmonitionVersioned/stableVersions.ts +119 -0
- package/src/theme/AnnouncementBar/CloseButton/index.tsx +24 -0
- package/src/theme/AnnouncementBar/CloseButton/styles.module.css +6 -0
- package/src/theme/AnnouncementBar/Content/index.tsx +21 -0
- package/src/theme/AnnouncementBar/Content/styles.module.css +12 -0
- package/src/theme/AnnouncementBar/index.tsx +37 -0
- package/src/theme/AnnouncementBar/styles.module.css +57 -0
- package/src/theme/BackToTopButton/index.tsx +30 -0
- package/src/theme/BackToTopButton/styles.module.css +39 -0
- package/src/theme/Blog/Components/Author/Socials/index.tsx +75 -0
- package/src/theme/Blog/Components/Author/Socials/styles.module.css +34 -0
- package/src/theme/Blog/Components/Author/index.tsx +98 -0
- package/src/theme/Blog/Components/Author/styles.module.css +69 -0
- package/src/theme/Blog/Pages/BlogAuthorsListPage/index.tsx +57 -0
- package/src/theme/Blog/Pages/BlogAuthorsListPage/styles.module.css +6 -0
- package/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx +77 -0
- package/src/theme/BlogArchivePage/index.tsx +102 -0
- package/src/theme/BlogLayout/index.tsx +31 -0
- package/src/theme/BlogListPage/StructuredData/index.tsx +17 -0
- package/src/theme/BlogListPage/index.tsx +57 -0
- package/src/theme/BlogListPaginator/index.tsx +47 -0
- package/src/theme/BlogPostItem/Container/index.tsx +11 -0
- package/src/theme/BlogPostItem/Content/index.tsx +23 -0
- package/src/theme/BlogPostItem/Footer/ReadMoreLink/index.tsx +39 -0
- package/src/theme/BlogPostItem/Footer/index.tsx +85 -0
- package/src/theme/BlogPostItem/Header/Authors/index.tsx +49 -0
- package/src/theme/BlogPostItem/Header/Authors/styles.module.css +15 -0
- package/src/theme/BlogPostItem/Header/Info/index.tsx +77 -0
- package/src/theme/BlogPostItem/Header/Info/styles.module.css +5 -0
- package/src/theme/BlogPostItem/Header/Title/index.tsx +20 -0
- package/src/theme/BlogPostItem/Header/Title/styles.module.css +14 -0
- package/src/theme/BlogPostItem/Header/index.tsx +16 -0
- package/src/theme/BlogPostItem/index.tsx +27 -0
- package/src/theme/BlogPostItems/index.tsx +25 -0
- package/src/theme/BlogPostPage/Metadata/index.tsx +39 -0
- package/src/theme/BlogPostPage/StructuredData/index.tsx +16 -0
- package/src/theme/BlogPostPage/index.tsx +74 -0
- package/src/theme/BlogPostPaginator/index.tsx +46 -0
- package/src/theme/BlogSidebar/Content/index.tsx +52 -0
- package/src/theme/BlogSidebar/Desktop/index.tsx +52 -0
- package/src/theme/BlogSidebar/Desktop/styles.module.css +46 -0
- package/src/theme/BlogSidebar/Mobile/index.tsx +47 -0
- package/src/theme/BlogSidebar/Mobile/styles.module.css +5 -0
- package/src/theme/BlogSidebar/index.tsx +19 -0
- package/src/theme/BlogTagsListPage/index.tsx +33 -0
- package/src/theme/BlogTagsPostsPage/index.tsx +68 -0
- package/src/theme/CodeBlock/Buttons/Button/index.tsx +14 -0
- package/src/theme/CodeBlock/Buttons/CopyButton/index.tsx +82 -0
- package/src/theme/CodeBlock/Buttons/CopyButton/styles.module.css +42 -0
- package/src/theme/CodeBlock/Buttons/WordWrapButton/index.tsx +40 -0
- package/src/theme/CodeBlock/Buttons/WordWrapButton/styles.module.css +10 -0
- package/src/theme/CodeBlock/Buttons/index.tsx +27 -0
- package/src/theme/CodeBlock/Buttons/styles.module.css +32 -0
- package/src/theme/CodeBlock/Container/index.tsx +27 -0
- package/src/theme/CodeBlock/Container/styles.module.css +9 -0
- package/src/theme/CodeBlock/Content/Element.tsx +24 -0
- package/src/theme/CodeBlock/Content/String.tsx +37 -0
- package/src/theme/CodeBlock/Content/index.tsx +79 -0
- package/src/theme/CodeBlock/Content/styles.module.css +30 -0
- package/src/theme/CodeBlock/Layout/index.tsx +29 -0
- package/src/theme/CodeBlock/Layout/styles.module.css +22 -0
- package/src/theme/CodeBlock/Line/Token/index.tsx +13 -0
- package/src/theme/CodeBlock/Line/index.tsx +61 -0
- package/src/theme/CodeBlock/Line/styles.module.css +47 -0
- package/src/theme/CodeBlock/Title/index.tsx +10 -0
- package/src/theme/CodeBlock/index.tsx +40 -0
- package/src/theme/CodeInline/index.tsx +11 -0
- package/src/theme/ColorModeToggle/index.tsx +140 -0
- package/src/theme/ColorModeToggle/styles.module.css +35 -0
- package/src/theme/ContentVisibility/Draft/index.tsx +22 -0
- package/src/theme/ContentVisibility/Unlisted/index.tsx +37 -0
- package/src/theme/ContentVisibility/index.tsx +20 -0
- package/src/theme/Details/index.tsx +21 -0
- package/src/theme/Details/styles.module.css +8 -0
- package/src/theme/DocBreadcrumbs/Items/Home/index.tsx +29 -0
- package/src/theme/DocBreadcrumbs/Items/Home/styles.module.css +9 -0
- package/src/theme/DocBreadcrumbs/StructuredData/index.tsx +19 -0
- package/src/theme/DocBreadcrumbs/index.tsx +98 -0
- package/src/theme/DocBreadcrumbs/styles.module.css +14 -0
- package/src/theme/DocCard/index.tsx +133 -0
- package/src/theme/DocCard/styles.module.css +29 -0
- package/src/theme/DocCardList/index.tsx +43 -0
- package/src/theme/DocCardList/styles.module.css +9 -0
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +68 -0
- package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +13 -0
- package/src/theme/DocItem/Content/index.tsx +43 -0
- package/src/theme/DocItem/Footer/index.tsx +51 -0
- package/src/theme/DocItem/Layout/index.tsx +66 -0
- package/src/theme/DocItem/Layout/styles.module.css +12 -0
- package/src/theme/DocItem/Metadata/index.tsx +17 -0
- package/src/theme/DocItem/Paginator/index.tsx +20 -0
- package/src/theme/DocItem/TOC/Desktop/index.tsx +19 -0
- package/src/theme/DocItem/TOC/Mobile/index.tsx +22 -0
- package/src/theme/DocItem/TOC/Mobile/styles.module.css +26 -0
- package/src/theme/DocItem/index.tsx +23 -0
- package/src/theme/DocPaginator/index.tsx +46 -0
- package/src/theme/DocRoot/Layout/Main/index.tsx +31 -0
- package/src/theme/DocRoot/Layout/Main/styles.module.css +23 -0
- package/src/theme/DocRoot/Layout/Sidebar/ExpandButton/index.tsx +36 -0
- package/src/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css +29 -0
- package/src/theme/DocRoot/Layout/Sidebar/index.tsx +79 -0
- package/src/theme/DocRoot/Layout/Sidebar/styles.module.css +34 -0
- package/src/theme/DocRoot/Layout/index.tsx +32 -0
- package/src/theme/DocRoot/Layout/styles.module.css +11 -0
- package/src/theme/DocRoot/index.tsx +29 -0
- package/src/theme/DocSidebar/Desktop/CollapseButton/index.tsx +34 -0
- package/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +42 -0
- package/src/theme/DocSidebar/Desktop/Content/index.tsx +56 -0
- package/src/theme/DocSidebar/Desktop/Content/styles.module.css +18 -0
- package/src/theme/DocSidebar/Desktop/index.tsx +36 -0
- package/src/theme/DocSidebar/Desktop/styles.module.css +39 -0
- package/src/theme/DocSidebar/Mobile/index.tsx +49 -0
- package/src/theme/DocSidebar/index.tsx +25 -0
- package/src/theme/DocSidebarItem/Category/index.tsx +309 -0
- package/src/theme/DocSidebarItem/Category/styles.module.css +35 -0
- package/src/theme/DocSidebarItem/Html/index.tsx +30 -0
- package/src/theme/DocSidebarItem/Html/styles.module.css +8 -0
- package/src/theme/DocSidebarItem/Link/index.tsx +62 -0
- package/src/theme/DocSidebarItem/Link/styles.module.css +13 -0
- package/src/theme/DocSidebarItem/index.tsx +19 -0
- package/src/theme/DocSidebarItems/index.tsx +24 -0
- package/src/theme/DocTagDocListPage/index.tsx +113 -0
- package/src/theme/DocTagsListPage/index.tsx +52 -0
- package/src/theme/DocVersionBadge/index.tsx +29 -0
- package/src/theme/DocVersionBanner/index.tsx +171 -0
- package/src/theme/DocVersionRoot/index.tsx +46 -0
- package/src/theme/DocsRoot/index.tsx +17 -0
- package/src/theme/EditMetaRow/index.tsx +31 -0
- package/src/theme/EditMetaRow/styles.module.css +19 -0
- package/src/theme/EditThisPage/index.tsx +21 -0
- package/src/theme/ErrorPageContent.tsx +38 -0
- package/src/theme/Footer/Copyright/index.tsx +15 -0
- package/src/theme/Footer/Layout/index.tsx +42 -0
- package/src/theme/Footer/LinkItem/index.tsx +31 -0
- package/src/theme/Footer/Links/MultiColumn/index.tsx +53 -0
- package/src/theme/Footer/Links/Simple/index.tsx +38 -0
- package/src/theme/Footer/Links/index.tsx +16 -0
- package/src/theme/Footer/Logo/index.tsx +41 -0
- package/src/theme/Footer/Logo/styles.module.css +11 -0
- package/src/theme/Footer/index.tsx +28 -0
- package/src/theme/Heading/index.tsx +50 -0
- package/src/theme/Heading/styles.module.css +17 -0
- package/src/theme/Homepage/index.tsx +178 -0
- package/src/theme/Icon/AI/index.tsx +21 -0
- package/src/theme/Icon/AWS/index.tsx +22 -0
- package/src/theme/Icon/Arrow/index.tsx +15 -0
- package/src/theme/Icon/Azure/index.tsx +28 -0
- package/src/theme/Icon/Changelog/index.tsx +26 -0
- package/src/theme/Icon/ChatBubble/index.tsx +29 -0
- package/src/theme/Icon/ChatBubbles/index.tsx +42 -0
- package/src/theme/Icon/Close/index.tsx +21 -0
- package/src/theme/Icon/Cog/index.tsx +45 -0
- package/src/theme/Icon/Copy/index.tsx +15 -0
- package/src/theme/Icon/DarkMode/index.tsx +15 -0
- package/src/theme/Icon/Edit/index.tsx +24 -0
- package/src/theme/Icon/Edit/styles.module.css +6 -0
- package/src/theme/Icon/Envelope/index.tsx +33 -0
- package/src/theme/Icon/ExternalLink/index.tsx +30 -0
- package/src/theme/Icon/ExternalLink/styles.module.css +5 -0
- package/src/theme/Icon/Fusion/index.tsx +32 -0
- package/src/theme/Icon/GoogleCloud/index.tsx +56 -0
- package/src/theme/Icon/Home/index.tsx +15 -0
- package/src/theme/Icon/Language/index.tsx +24 -0
- package/src/theme/Icon/LightMode/index.tsx +15 -0
- package/src/theme/Icon/MCP/index.tsx +84 -0
- package/src/theme/Icon/Menu/index.tsx +29 -0
- package/src/theme/Icon/MultiQC/index.tsx +25 -0
- package/src/theme/Icon/Nextflow/index.tsx +25 -0
- package/src/theme/Icon/QuestionMark/index.tsx +46 -0
- package/src/theme/Icon/SeqeraCloud/index.tsx +35 -0
- package/src/theme/Icon/SeqeraEnterprise/index.tsx +372 -0
- package/src/theme/Icon/SeqeraLogo/index.tsx +22 -0
- package/src/theme/Icon/ServiceStatus/index.tsx +101 -0
- package/src/theme/Icon/Sidebar/index.tsx +8 -0
- package/src/theme/Icon/Socials/Bluesky/index.tsx +23 -0
- package/src/theme/Icon/Socials/Bluesky/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Default/index.tsx +28 -0
- package/src/theme/Icon/Socials/Email/index.tsx +23 -0
- package/src/theme/Icon/Socials/GitHub/index.tsx +24 -0
- package/src/theme/Icon/Socials/GitHub/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Instagram/index.tsx +23 -0
- package/src/theme/Icon/Socials/Instagram/styles.module.css +9 -0
- package/src/theme/Icon/Socials/LinkedIn/index.tsx +23 -0
- package/src/theme/Icon/Socials/LinkedIn/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Mastodon/index.tsx +40 -0
- package/src/theme/Icon/Socials/StackOverflow/index.tsx +25 -0
- package/src/theme/Icon/Socials/Threads/index.tsx +25 -0
- package/src/theme/Icon/Socials/Threads/styles.module.css +9 -0
- package/src/theme/Icon/Socials/Twitch/index.tsx +32 -0
- package/src/theme/Icon/Socials/Twitter/index.tsx +22 -0
- package/src/theme/Icon/Socials/X/index.tsx +24 -0
- package/src/theme/Icon/Socials/X/styles.module.css +9 -0
- package/src/theme/Icon/Socials/YouTube/index.tsx +22 -0
- package/src/theme/Icon/Success/index.tsx +15 -0
- package/src/theme/Icon/SystemColorMode/index.tsx +15 -0
- package/src/theme/Icon/Wave/index.tsx +32 -0
- package/src/theme/Icon/WordWrap/index.tsx +15 -0
- package/src/theme/LastUpdated/index.tsx +91 -0
- package/src/theme/Layout/Provider/index.tsx +26 -0
- package/src/theme/Layout/index.tsx +59 -0
- package/src/theme/Layout/styles.module.css +23 -0
- package/src/theme/Logo/index.tsx +78 -0
- package/src/theme/MDXComponents/A/index.tsx +16 -0
- package/src/theme/MDXComponents/Button/index.tsx +43 -0
- package/src/theme/MDXComponents/Code.tsx +26 -0
- package/src/theme/MDXComponents/Details.tsx +26 -0
- package/src/theme/MDXComponents/Heading.tsx +9 -0
- package/src/theme/MDXComponents/Img/index.tsx +23 -0
- package/src/theme/MDXComponents/Img/styles.module.css +5 -0
- package/src/theme/MDXComponents/Li.tsx +17 -0
- package/src/theme/MDXComponents/Pre.tsx +10 -0
- package/src/theme/MDXComponents/Ul/index.tsx +25 -0
- package/src/theme/MDXComponents/Ul/styles.module.css +9 -0
- package/src/theme/MDXComponents/index.tsx +47 -0
- package/src/theme/MDXContent/index.tsx +10 -0
- package/src/theme/MDXPage/index.tsx +87 -0
- package/src/theme/MDXPage/styles.module.css +5 -0
- package/src/theme/Mermaid.tsx +11 -0
- package/src/theme/Navbar/ColorModeToggle/index.tsx +29 -0
- package/src/theme/Navbar/ColorModeToggle/styles.module.css +5 -0
- package/src/theme/Navbar/Content/index.tsx +152 -0
- package/src/theme/Navbar/Content/styles.module.css +19 -0
- package/src/theme/Navbar/Layout/index.tsx +59 -0
- package/src/theme/Navbar/Layout/styles.module.css +9 -0
- package/src/theme/Navbar/Logo/index.tsx +14 -0
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +37 -0
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +72 -0
- package/src/theme/Navbar/MobileSidebar/Layout/styles.module.css +11 -0
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +90 -0
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +34 -0
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +25 -0
- package/src/theme/Navbar/MobileSidebar/index.tsx +28 -0
- package/src/theme/Navbar/Search/index.tsx +15 -0
- package/src/theme/Navbar/Search/styles.module.css +22 -0
- package/src/theme/Navbar/Submenu/SubmenuLinks.tsx +136 -0
- package/src/theme/Navbar/Submenu/index.tsx +84 -0
- package/src/theme/Navbar/Submenu/styles.module.css +82 -0
- package/src/theme/Navbar/index.tsx +13 -0
- package/src/theme/NavbarItem/ComponentTypes.tsx +27 -0
- package/src/theme/NavbarItem/DefaultNavbarItem/Desktop/index.tsx +29 -0
- package/src/theme/NavbarItem/DefaultNavbarItem/Mobile/index.tsx +18 -0
- package/src/theme/NavbarItem/DefaultNavbarItem/index.tsx +23 -0
- package/src/theme/NavbarItem/DocNavbarItem.tsx +38 -0
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +33 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +189 -0
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +22 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/Desktop/index.tsx +81 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/Mobile/index.tsx +161 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/Mobile/styles.module.css +5 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/index.tsx +14 -0
- package/src/theme/NavbarItem/HtmlNavbarItem.tsx +27 -0
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +128 -0
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +6 -0
- package/src/theme/NavbarItem/NavbarNavLink.tsx +69 -0
- package/src/theme/NavbarItem/SearchNavbarItem.tsx +21 -0
- package/src/theme/NavbarItem/index.tsx +23 -0
- package/src/theme/NotFound/Content/index.tsx +34 -0
- package/src/theme/NotFound/index.tsx +22 -0
- package/src/theme/PaginatorNavLink/index.tsx +21 -0
- package/src/theme/SearchBar.tsx +8 -0
- package/src/theme/SearchMetadata/index.tsx +38 -0
- package/src/theme/SiteMetadata/index.tsx +153 -0
- package/src/theme/SkipToContent/index.tsx +9 -0
- package/src/theme/SkipToContent/styles.module.css +16 -0
- package/src/theme/TOC/index.tsx +26 -0
- package/src/theme/TOC/styles.module.css +23 -0
- package/src/theme/TOCCollapsible/CollapseButton/index.tsx +30 -0
- package/src/theme/TOCCollapsible/CollapseButton/styles.module.css +27 -0
- package/src/theme/TOCCollapsible/index.tsx +42 -0
- package/src/theme/TOCCollapsible/styles.module.css +26 -0
- package/src/theme/TOCInline/index.tsx +25 -0
- package/src/theme/TOCInline/styles.module.css +7 -0
- package/src/theme/TOCItems/Tree.tsx +40 -0
- package/src/theme/TOCItems/index.tsx +56 -0
- package/src/theme/TabItem/index.tsx +22 -0
- package/src/theme/TabItem/styles.module.css +5 -0
- package/src/theme/Tabs/index.tsx +167 -0
- package/src/theme/Tabs/styles.module.css +9 -0
- package/src/theme/Tag/index.tsx +30 -0
- package/src/theme/Tag/styles.module.css +65 -0
- package/src/theme/TagsListByLetter/index.tsx +40 -0
- package/src/theme/TagsListByLetter/styles.module.css +6 -0
- package/src/theme/TagsListInline/index.tsx +30 -0
- package/src/theme/TagsListInline/styles.module.css +10 -0
- package/src/theme/ThemeProvider/TitleFormatter/index.tsx +22 -0
- package/src/theme/ThemeProvider/index.tsx +9 -0
- package/src/theme/ThemedImage/index.tsx +21 -0
- package/src/theme/ThemedImage/styles.module.css +13 -0
- package/src/theme/pages/Home/index.tsx +19 -0
- package/src/theme/prism-include-languages.ts +39 -0
- package/src/theme-seqera.d.ts +2277 -0
- package/src/translations.ts +240 -0
- package/tailwind.config.js +7 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import Link from '@docusaurus/Link';
|
|
6
|
+
import {
|
|
7
|
+
useDocById,
|
|
8
|
+
findFirstSidebarItemLink,
|
|
9
|
+
} from '@docusaurus/plugin-content-docs/client';
|
|
10
|
+
import {usePluralForm} from '@docusaurus/theme-common';
|
|
11
|
+
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
12
|
+
import {translate} from '@docusaurus/Translate';
|
|
13
|
+
|
|
14
|
+
import type {Props} from '@theme/DocCard';
|
|
15
|
+
import Heading from '@theme/Heading';
|
|
16
|
+
import type {
|
|
17
|
+
PropSidebarItemCategory,
|
|
18
|
+
PropSidebarItemLink,
|
|
19
|
+
} from '@docusaurus/plugin-content-docs';
|
|
20
|
+
|
|
21
|
+
import styles from './styles.module.css';
|
|
22
|
+
|
|
23
|
+
function useCategoryItemsPlural() {
|
|
24
|
+
const {selectMessage} = usePluralForm();
|
|
25
|
+
return (count: number) =>
|
|
26
|
+
selectMessage(
|
|
27
|
+
count,
|
|
28
|
+
translate(
|
|
29
|
+
{
|
|
30
|
+
message: '1 item|{count} items',
|
|
31
|
+
id: 'theme.docs.DocCard.categoryDescription.plurals',
|
|
32
|
+
description:
|
|
33
|
+
'The default description for a category card in the generated index about how many items this category includes',
|
|
34
|
+
},
|
|
35
|
+
{count},
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function CardContainer({
|
|
41
|
+
className,
|
|
42
|
+
href,
|
|
43
|
+
children,
|
|
44
|
+
}: {
|
|
45
|
+
className?: string;
|
|
46
|
+
href: string;
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
}): ReactNode {
|
|
49
|
+
return (
|
|
50
|
+
<Link
|
|
51
|
+
href={href}
|
|
52
|
+
className={clsx('card padding--lg', styles.cardContainer, className)}>
|
|
53
|
+
{children}
|
|
54
|
+
</Link>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function CardLayout({
|
|
59
|
+
className,
|
|
60
|
+
href,
|
|
61
|
+
icon,
|
|
62
|
+
title,
|
|
63
|
+
description,
|
|
64
|
+
}: {
|
|
65
|
+
className?: string;
|
|
66
|
+
href: string;
|
|
67
|
+
icon: ReactNode;
|
|
68
|
+
title: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
}): ReactNode {
|
|
71
|
+
return (
|
|
72
|
+
<CardContainer href={href} className={className}>
|
|
73
|
+
<Heading
|
|
74
|
+
as="h2"
|
|
75
|
+
className={clsx('text--truncate', styles.cardTitle)}
|
|
76
|
+
title={title}>
|
|
77
|
+
{icon} {title}
|
|
78
|
+
</Heading>
|
|
79
|
+
{description && (
|
|
80
|
+
<p
|
|
81
|
+
className={clsx('text--truncate', styles.cardDescription)}
|
|
82
|
+
title={description}>
|
|
83
|
+
{description}
|
|
84
|
+
</p>
|
|
85
|
+
)}
|
|
86
|
+
</CardContainer>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function CardCategory({item}: {item: PropSidebarItemCategory}): ReactNode {
|
|
91
|
+
const href = findFirstSidebarItemLink(item);
|
|
92
|
+
const categoryItemsPlural = useCategoryItemsPlural();
|
|
93
|
+
|
|
94
|
+
// Unexpected: categories that don't have a link have been filtered upfront
|
|
95
|
+
if (!href) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<CardLayout
|
|
101
|
+
className={item.className}
|
|
102
|
+
href={href}
|
|
103
|
+
icon="🗃️"
|
|
104
|
+
title={item.label}
|
|
105
|
+
description={item.description ?? categoryItemsPlural(item.items.length)}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function CardLink({item}: {item: PropSidebarItemLink}): ReactNode {
|
|
111
|
+
const icon = isInternalUrl(item.href) ? '📄️' : '🔗';
|
|
112
|
+
const doc = useDocById(item.docId ?? undefined);
|
|
113
|
+
return (
|
|
114
|
+
<CardLayout
|
|
115
|
+
className={item.className}
|
|
116
|
+
href={item.href}
|
|
117
|
+
icon={icon}
|
|
118
|
+
title={item.label}
|
|
119
|
+
description={item.description ?? doc?.description}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export default function DocCard({item}: Props): ReactNode {
|
|
125
|
+
switch (item.type) {
|
|
126
|
+
case 'link':
|
|
127
|
+
return <CardLink item={item} />;
|
|
128
|
+
case 'category':
|
|
129
|
+
return <CardCategory item={item} />;
|
|
130
|
+
default:
|
|
131
|
+
throw new Error(`unknown item type ${JSON.stringify(item)}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.cardContainer {
|
|
4
|
+
--ifm-link-color: var(--ifm-color-emphasis-800);
|
|
5
|
+
--ifm-link-hover-color: var(--ifm-color-emphasis-700);
|
|
6
|
+
--ifm-link-hover-decoration: none;
|
|
7
|
+
|
|
8
|
+
box-shadow: 0 1.5px 3px 0 rgb(0 0 0 / 15%);
|
|
9
|
+
border: 1px solid var(--ifm-color-emphasis-200);
|
|
10
|
+
transition: all var(--ifm-transition-fast) ease;
|
|
11
|
+
transition-property: border, box-shadow;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.cardContainer:hover {
|
|
15
|
+
border-color: var(--ifm-color-primary);
|
|
16
|
+
box-shadow: 0 3px 6px 0 rgb(0 0 0 / 20%);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.cardContainer *:last-child {
|
|
20
|
+
margin-bottom: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cardTitle {
|
|
24
|
+
font-size: 1.2rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.cardDescription {
|
|
28
|
+
font-size: 0.8rem;
|
|
29
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ComponentProps, type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {
|
|
6
|
+
useCurrentSidebarSiblings,
|
|
7
|
+
filterDocCardListItems,
|
|
8
|
+
} from '@docusaurus/plugin-content-docs/client';
|
|
9
|
+
import DocCard from '@theme/DocCard';
|
|
10
|
+
import type {Props} from '@theme/DocCardList';
|
|
11
|
+
import styles from './styles.module.css';
|
|
12
|
+
|
|
13
|
+
function DocCardListForCurrentSidebarCategory({className}: Props) {
|
|
14
|
+
const items = useCurrentSidebarSiblings();
|
|
15
|
+
return <DocCardList items={items} className={className} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function DocCardListItem({
|
|
19
|
+
item,
|
|
20
|
+
}: {
|
|
21
|
+
item: ComponentProps<typeof DocCard>['item'];
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<article className={clsx(styles.docCardListItem, 'col col--6')}>
|
|
25
|
+
<DocCard item={item} />
|
|
26
|
+
</article>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default function DocCardList(props: Props): ReactNode {
|
|
31
|
+
const {items, className} = props;
|
|
32
|
+
if (!items) {
|
|
33
|
+
return <DocCardListForCurrentSidebarCategory {...props} />;
|
|
34
|
+
}
|
|
35
|
+
const filteredItems = filterDocCardListItems(items);
|
|
36
|
+
return (
|
|
37
|
+
<section className={clsx('row', className)}>
|
|
38
|
+
{filteredItems.map((item, index) => (
|
|
39
|
+
<DocCardListItem key={index} item={item} />
|
|
40
|
+
))}
|
|
41
|
+
</section>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import {PageMetadata} from '@docusaurus/theme-common';
|
|
5
|
+
import {useCurrentSidebarCategory} from '@docusaurus/plugin-content-docs/client';
|
|
6
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
7
|
+
import DocCardList from '@theme/DocCardList';
|
|
8
|
+
import DocPaginator from '@theme/DocPaginator';
|
|
9
|
+
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
10
|
+
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
11
|
+
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
|
|
12
|
+
import Heading from '@theme/Heading';
|
|
13
|
+
import type {Props} from '@theme/DocCategoryGeneratedIndexPage';
|
|
14
|
+
|
|
15
|
+
import styles from './styles.module.css';
|
|
16
|
+
|
|
17
|
+
function DocCategoryGeneratedIndexPageMetadata({
|
|
18
|
+
categoryGeneratedIndex,
|
|
19
|
+
}: Props): ReactNode {
|
|
20
|
+
return (
|
|
21
|
+
<PageMetadata
|
|
22
|
+
title={categoryGeneratedIndex.title}
|
|
23
|
+
description={categoryGeneratedIndex.description}
|
|
24
|
+
keywords={categoryGeneratedIndex.keywords}
|
|
25
|
+
// TODO `require` this?
|
|
26
|
+
image={useBaseUrl(categoryGeneratedIndex.image)}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function DocCategoryGeneratedIndexPageContent({
|
|
32
|
+
categoryGeneratedIndex,
|
|
33
|
+
}: Props): ReactNode {
|
|
34
|
+
const category = useCurrentSidebarCategory();
|
|
35
|
+
return (
|
|
36
|
+
<div className={styles.generatedIndexPage}>
|
|
37
|
+
<DocVersionBanner />
|
|
38
|
+
<DocBreadcrumbs />
|
|
39
|
+
<DocVersionBadge />
|
|
40
|
+
<header>
|
|
41
|
+
<Heading as="h1" className={styles.title}>
|
|
42
|
+
{categoryGeneratedIndex.title}
|
|
43
|
+
</Heading>
|
|
44
|
+
{categoryGeneratedIndex.description && (
|
|
45
|
+
<p>{categoryGeneratedIndex.description}</p>
|
|
46
|
+
)}
|
|
47
|
+
</header>
|
|
48
|
+
<article className="margin-top--lg">
|
|
49
|
+
<DocCardList items={category.items} className={styles.list} />
|
|
50
|
+
</article>
|
|
51
|
+
<footer className="margin-top--md">
|
|
52
|
+
<DocPaginator
|
|
53
|
+
previous={categoryGeneratedIndex.navigation.previous}
|
|
54
|
+
next={categoryGeneratedIndex.navigation.next}
|
|
55
|
+
/>
|
|
56
|
+
</footer>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default function DocCategoryGeneratedIndexPage(props: Props): ReactNode {
|
|
62
|
+
return (
|
|
63
|
+
<>
|
|
64
|
+
<DocCategoryGeneratedIndexPageMetadata {...props} />
|
|
65
|
+
<DocCategoryGeneratedIndexPageContent {...props} />
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
6
|
+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
|
7
|
+
import Heading from '@theme/Heading';
|
|
8
|
+
import MDXContent from '@theme/MDXContent';
|
|
9
|
+
import type {Props} from '@theme/DocItem/Content';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
Title can be declared inside md content or declared through
|
|
13
|
+
front matter and added manually. To make both cases consistent,
|
|
14
|
+
the added title is added under the same div.markdown block
|
|
15
|
+
See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
|
|
16
|
+
|
|
17
|
+
We render a "synthetic title" if:
|
|
18
|
+
- user doesn't ask to hide it with front matter
|
|
19
|
+
- the markdown content does not already contain a top-level h1 heading
|
|
20
|
+
*/
|
|
21
|
+
function useSyntheticTitle(): string | null {
|
|
22
|
+
const {metadata, frontMatter, contentTitle} = useDoc();
|
|
23
|
+
const shouldRender =
|
|
24
|
+
!frontMatter.hide_title && typeof contentTitle === 'undefined';
|
|
25
|
+
if (!shouldRender) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return metadata.title;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function DocItemContent({children}: Props): ReactNode {
|
|
32
|
+
const syntheticTitle = useSyntheticTitle();
|
|
33
|
+
return (
|
|
34
|
+
<div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
|
35
|
+
{syntheticTitle && (
|
|
36
|
+
<header>
|
|
37
|
+
<Heading as="h1">{syntheticTitle}</Heading>
|
|
38
|
+
</header>
|
|
39
|
+
)}
|
|
40
|
+
<MDXContent>{children}</MDXContent>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
6
|
+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
|
7
|
+
import TagsListInline from '@theme/TagsListInline';
|
|
8
|
+
|
|
9
|
+
import EditMetaRow from '@theme/EditMetaRow';
|
|
10
|
+
|
|
11
|
+
export default function DocItemFooter(): ReactNode {
|
|
12
|
+
const {metadata} = useDoc();
|
|
13
|
+
const {editUrl, lastUpdatedAt, lastUpdatedBy, tags} = metadata;
|
|
14
|
+
|
|
15
|
+
const canDisplayTagsRow = tags.length > 0;
|
|
16
|
+
const canDisplayEditMetaRow = !!(editUrl || lastUpdatedAt || lastUpdatedBy);
|
|
17
|
+
|
|
18
|
+
const canDisplayFooter = canDisplayTagsRow || canDisplayEditMetaRow;
|
|
19
|
+
|
|
20
|
+
if (!canDisplayFooter) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<footer
|
|
26
|
+
className={clsx(ThemeClassNames.docs.docFooter, 'docusaurus-mt-lg')}>
|
|
27
|
+
{canDisplayTagsRow && (
|
|
28
|
+
<div
|
|
29
|
+
className={clsx(
|
|
30
|
+
'row margin-top--sm',
|
|
31
|
+
ThemeClassNames.docs.docFooterTagsRow,
|
|
32
|
+
)}>
|
|
33
|
+
<div className="col">
|
|
34
|
+
<TagsListInline tags={tags} />
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
)}
|
|
38
|
+
{canDisplayEditMetaRow && (
|
|
39
|
+
<EditMetaRow
|
|
40
|
+
className={clsx(
|
|
41
|
+
'margin-top--sm',
|
|
42
|
+
ThemeClassNames.docs.docFooterEditMetaRow,
|
|
43
|
+
)}
|
|
44
|
+
editUrl={editUrl}
|
|
45
|
+
lastUpdatedAt={lastUpdatedAt}
|
|
46
|
+
lastUpdatedBy={lastUpdatedBy}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
</footer>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {useWindowSize} from '@docusaurus/theme-common';
|
|
6
|
+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
|
7
|
+
import DocItemPaginator from '@theme/DocItem/Paginator';
|
|
8
|
+
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
9
|
+
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
10
|
+
import DocItemFooter from '@theme/DocItem/Footer';
|
|
11
|
+
import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile';
|
|
12
|
+
import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
|
|
13
|
+
import DocItemContent from '@theme/DocItem/Content';
|
|
14
|
+
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
|
|
15
|
+
import ContentVisibility from '@theme/ContentVisibility';
|
|
16
|
+
import type {Props} from '@theme/DocItem/Layout';
|
|
17
|
+
|
|
18
|
+
import styles from './styles.module.css';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Decide if the toc should be rendered, on mobile or desktop viewports
|
|
22
|
+
*/
|
|
23
|
+
function useDocTOC() {
|
|
24
|
+
const {frontMatter, toc} = useDoc();
|
|
25
|
+
const windowSize = useWindowSize();
|
|
26
|
+
|
|
27
|
+
const hidden = frontMatter.hide_table_of_contents;
|
|
28
|
+
const canRender = !hidden && toc.length > 0;
|
|
29
|
+
|
|
30
|
+
const mobile = canRender ? <DocItemTOCMobile /> : undefined;
|
|
31
|
+
|
|
32
|
+
const desktop =
|
|
33
|
+
canRender && (windowSize === 'desktop' || windowSize === 'ssr') ? (
|
|
34
|
+
<DocItemTOCDesktop />
|
|
35
|
+
) : undefined;
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
hidden,
|
|
39
|
+
mobile,
|
|
40
|
+
desktop,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default function DocItemLayout({children}: Props): ReactNode {
|
|
45
|
+
const docTOC = useDocTOC();
|
|
46
|
+
const {metadata} = useDoc();
|
|
47
|
+
return (
|
|
48
|
+
<div className="row">
|
|
49
|
+
<div className={clsx('prose__wrapper mx-auto px-4', !docTOC.hidden && styles.docItemCol)}>
|
|
50
|
+
<ContentVisibility metadata={metadata} />
|
|
51
|
+
<DocVersionBanner />
|
|
52
|
+
<div className={styles.docItemContainer}>
|
|
53
|
+
<article className="max-w-3xl">
|
|
54
|
+
<DocBreadcrumbs />
|
|
55
|
+
<DocVersionBadge />
|
|
56
|
+
{docTOC.mobile}
|
|
57
|
+
<DocItemContent>{children}</DocItemContent>
|
|
58
|
+
<DocItemFooter />
|
|
59
|
+
</article>
|
|
60
|
+
<DocItemPaginator />
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
{docTOC.desktop && <div className="col col--3">{docTOC.desktop}</div>}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import {PageMetadata} from '@docusaurus/theme-common';
|
|
5
|
+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
|
6
|
+
|
|
7
|
+
export default function DocItemMetadata(): ReactNode {
|
|
8
|
+
const {metadata, frontMatter, assets} = useDoc();
|
|
9
|
+
return (
|
|
10
|
+
<PageMetadata
|
|
11
|
+
title={metadata.title}
|
|
12
|
+
description={metadata.description}
|
|
13
|
+
keywords={frontMatter.keywords}
|
|
14
|
+
image={assets.image ?? frontMatter.image}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
|
5
|
+
import DocPaginator from '@theme/DocPaginator';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This extra component is needed, because <DocPaginator> should remain generic.
|
|
9
|
+
* DocPaginator is used in non-docs contexts too: generated-index pages...
|
|
10
|
+
*/
|
|
11
|
+
export default function DocItemPaginator(): ReactNode {
|
|
12
|
+
const {metadata} = useDoc();
|
|
13
|
+
return (
|
|
14
|
+
<DocPaginator
|
|
15
|
+
className="docusaurus-mt-lg"
|
|
16
|
+
previous={metadata.previous}
|
|
17
|
+
next={metadata.next}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
5
|
+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
|
6
|
+
|
|
7
|
+
import TOC from '@theme/TOC';
|
|
8
|
+
|
|
9
|
+
export default function DocItemTOCDesktop(): ReactNode {
|
|
10
|
+
const {toc, frontMatter} = useDoc();
|
|
11
|
+
return (
|
|
12
|
+
<TOC
|
|
13
|
+
toc={toc}
|
|
14
|
+
minHeadingLevel={frontMatter.toc_min_heading_level}
|
|
15
|
+
maxHeadingLevel={frontMatter.toc_max_heading_level}
|
|
16
|
+
className={ThemeClassNames.docs.docTocDesktop}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
6
|
+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
|
7
|
+
|
|
8
|
+
import TOCCollapsible from '@theme/TOCCollapsible';
|
|
9
|
+
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
|
|
12
|
+
export default function DocItemTOCMobile(): ReactNode {
|
|
13
|
+
const {toc, frontMatter} = useDoc();
|
|
14
|
+
return (
|
|
15
|
+
<TOCCollapsible
|
|
16
|
+
toc={toc}
|
|
17
|
+
minHeadingLevel={frontMatter.toc_min_heading_level}
|
|
18
|
+
maxHeadingLevel={frontMatter.toc_max_heading_level}
|
|
19
|
+
className={clsx(ThemeClassNames.docs.docTocMobile, styles.tocMobile)}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
@media (min-width: 997px) {
|
|
4
|
+
/* Prevent hydration FOUC, as the mobile TOC needs to be server-rendered */
|
|
5
|
+
.tocMobile {
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media print {
|
|
11
|
+
.tocMobile {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Use :global() for non-module classes */
|
|
17
|
+
.tocMobile ul {
|
|
18
|
+
list-style: none;
|
|
19
|
+
padding-left: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.tocMobile :global(.undefined) {
|
|
24
|
+
border-left: 1px solid var(--color-gray-400);
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import {HtmlClassNameProvider} from '@docusaurus/theme-common';
|
|
5
|
+
import {DocProvider} from '@docusaurus/plugin-content-docs/client';
|
|
6
|
+
import DocItemMetadata from '@theme/DocItem/Metadata';
|
|
7
|
+
import DocItemLayout from '@theme/DocItem/Layout';
|
|
8
|
+
import type {Props} from '@theme/DocItem';
|
|
9
|
+
|
|
10
|
+
export default function DocItem(props: Props): ReactNode {
|
|
11
|
+
const docHtmlClassName = `docs-doc-id-${props.content.metadata.id}`;
|
|
12
|
+
const MDXComponent = props.content;
|
|
13
|
+
return (
|
|
14
|
+
<DocProvider content={props.content}>
|
|
15
|
+
<HtmlClassNameProvider className={docHtmlClassName}>
|
|
16
|
+
<DocItemMetadata />
|
|
17
|
+
<DocItemLayout>
|
|
18
|
+
<MDXComponent />
|
|
19
|
+
</DocItemLayout>
|
|
20
|
+
</HtmlClassNameProvider>
|
|
21
|
+
</DocProvider>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import Translate, {translate} from '@docusaurus/Translate';
|
|
6
|
+
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
|
7
|
+
import type {Props} from '@theme/DocPaginator';
|
|
8
|
+
|
|
9
|
+
export default function DocPaginator(props: Props): ReactNode {
|
|
10
|
+
const {className, previous, next} = props;
|
|
11
|
+
return (
|
|
12
|
+
<nav
|
|
13
|
+
className={clsx(className, 'pagination-nav')}
|
|
14
|
+
aria-label={translate({
|
|
15
|
+
id: 'theme.docs.paginator.navAriaLabel',
|
|
16
|
+
message: 'Docs pages',
|
|
17
|
+
description: 'The ARIA label for the docs pagination',
|
|
18
|
+
})}>
|
|
19
|
+
{previous && (
|
|
20
|
+
<PaginatorNavLink
|
|
21
|
+
{...previous}
|
|
22
|
+
subLabel={
|
|
23
|
+
<Translate
|
|
24
|
+
id="theme.docs.paginator.previous"
|
|
25
|
+
description="The label used to navigate to the previous doc">
|
|
26
|
+
Previous
|
|
27
|
+
</Translate>
|
|
28
|
+
}
|
|
29
|
+
/>
|
|
30
|
+
)}
|
|
31
|
+
{next && (
|
|
32
|
+
<PaginatorNavLink
|
|
33
|
+
{...next}
|
|
34
|
+
subLabel={
|
|
35
|
+
<Translate
|
|
36
|
+
id="theme.docs.paginator.next"
|
|
37
|
+
description="The label used to navigate to the next doc">
|
|
38
|
+
Next
|
|
39
|
+
</Translate>
|
|
40
|
+
}
|
|
41
|
+
isNext
|
|
42
|
+
/>
|
|
43
|
+
)}
|
|
44
|
+
</nav>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React, {type ReactNode} from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
|
|
6
|
+
import type {Props} from '@theme/DocRoot/Layout/Main';
|
|
7
|
+
|
|
8
|
+
import styles from './styles.module.css';
|
|
9
|
+
|
|
10
|
+
export default function DocRootLayoutMain({
|
|
11
|
+
hiddenSidebarContainer,
|
|
12
|
+
children,
|
|
13
|
+
}: Props): ReactNode {
|
|
14
|
+
const sidebar = useDocsSidebar();
|
|
15
|
+
return (
|
|
16
|
+
<main
|
|
17
|
+
className={clsx(
|
|
18
|
+
styles.docMainContainer,
|
|
19
|
+
(hiddenSidebarContainer || !sidebar) && styles.docMainContainerEnhanced,
|
|
20
|
+
)}>
|
|
21
|
+
<div
|
|
22
|
+
className={clsx(
|
|
23
|
+
'container padding-top--md padding-bottom--lg',
|
|
24
|
+
styles.docItemWrapper,
|
|
25
|
+
hiddenSidebarContainer && styles.docItemWrapperEnhanced,
|
|
26
|
+
)}>
|
|
27
|
+
{children}
|
|
28
|
+
</div>
|
|
29
|
+
</main>
|
|
30
|
+
);
|
|
31
|
+
}
|