create-trellis-docs 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.
Files changed (148) hide show
  1. package/bin/index.js +29 -0
  2. package/lib/index.js +178 -0
  3. package/package.json +23 -0
  4. package/template/_gitignore +6 -0
  5. package/template/blog/2025-01-01-welcome.md +15 -0
  6. package/template/design-tokens.json +218 -0
  7. package/template/docs/faq/general.mdx +16 -0
  8. package/template/docs/faq/index.mdx +13 -0
  9. package/template/docs/getting-started.mdx +54 -0
  10. package/template/docs/guides/writing-docs.mdx +90 -0
  11. package/template/docusaurus.config.js.tpl +200 -0
  12. package/template/package.json.tpl +60 -0
  13. package/template/packages/faq-index-plugin/README.md +104 -0
  14. package/template/packages/faq-index-plugin/index.js +91 -0
  15. package/template/packages/faq-index-plugin/package.json +15 -0
  16. package/template/packages/redirects-plugin/README.md +186 -0
  17. package/template/packages/redirects-plugin/index.js +167 -0
  18. package/template/packages/redirects-plugin/package.json +15 -0
  19. package/template/packages/redirects-plugin/yarn.lock +31 -0
  20. package/template/redirects.json +1 -0
  21. package/template/scripts/build-tokens.js +34 -0
  22. package/template/sidebars.js +17 -0
  23. package/template/src/components/CustomSearch/CustomSearch.js +241 -0
  24. package/template/src/components/CustomSearch/CustomSearchContent.js +171 -0
  25. package/template/src/components/CustomSearch/NavbarSearch.js +211 -0
  26. package/template/src/components/CustomSearch/SearchContext.js +26 -0
  27. package/template/src/components/CustomSearch/styles.module.css +171 -0
  28. package/template/src/components/CustomSearch/wrapperInit.js +11 -0
  29. package/template/src/components/FaqTableOfContents/index.jsx +176 -0
  30. package/template/src/components/FaqTableOfContents/styles.module.css +167 -0
  31. package/template/src/components/Feedback/Feedback.js +310 -0
  32. package/template/src/components/Feedback/api.js +77 -0
  33. package/template/src/components/FlippingCard/FlippingCard.js +197 -0
  34. package/template/src/components/FlippingCard/styles.module.css +248 -0
  35. package/template/src/components/Glossary.js +57 -0
  36. package/template/src/css/custom.css +765 -0
  37. package/template/src/data/glossary.json +1 -0
  38. package/template/src/pages/index.js.tpl +38 -0
  39. package/template/src/theme/Admonition/Icon/Danger.js +11 -0
  40. package/template/src/theme/Admonition/Icon/Info.js +11 -0
  41. package/template/src/theme/Admonition/Icon/Note.js +11 -0
  42. package/template/src/theme/Admonition/Icon/Tip.js +11 -0
  43. package/template/src/theme/Admonition/Icon/Warning.js +11 -0
  44. package/template/src/theme/Admonition/Layout/index.js +39 -0
  45. package/template/src/theme/Admonition/Layout/styles.module.css +36 -0
  46. package/template/src/theme/Admonition/Type/Caution.js +28 -0
  47. package/template/src/theme/Admonition/Type/Danger.js +26 -0
  48. package/template/src/theme/Admonition/Type/Info.js +26 -0
  49. package/template/src/theme/Admonition/Type/Note.js +26 -0
  50. package/template/src/theme/Admonition/Type/Tip.js +26 -0
  51. package/template/src/theme/Admonition/Type/Warning.js +26 -0
  52. package/template/src/theme/Admonition/Types.js +27 -0
  53. package/template/src/theme/Admonition/index.js +18 -0
  54. package/template/src/theme/AnnouncementBar/CloseButton/index.js +20 -0
  55. package/template/src/theme/AnnouncementBar/CloseButton/styles.module.css +4 -0
  56. package/template/src/theme/AnnouncementBar/Content/index.js +17 -0
  57. package/template/src/theme/AnnouncementBar/Content/styles.module.css +10 -0
  58. package/template/src/theme/AnnouncementBar/index.js +33 -0
  59. package/template/src/theme/AnnouncementBar/styles.module.css +55 -0
  60. package/template/src/theme/BlogSidebar/Content/index.js +35 -0
  61. package/template/src/theme/BlogSidebar/Desktop/index.js +44 -0
  62. package/template/src/theme/BlogSidebar/Desktop/styles.module.css +60 -0
  63. package/template/src/theme/BlogSidebar/Mobile/index.js +38 -0
  64. package/template/src/theme/BlogSidebar/Mobile/styles.module.css +3 -0
  65. package/template/src/theme/BlogSidebar/index.js +15 -0
  66. package/template/src/theme/Details/index.js +23 -0
  67. package/template/src/theme/Details/styles.module.css +52 -0
  68. package/template/src/theme/DocBreadcrumbs/Items/Home/index.js +22 -0
  69. package/template/src/theme/DocBreadcrumbs/Items/Home/styles.module.css +7 -0
  70. package/template/src/theme/DocBreadcrumbs/StructuredData/index.js +15 -0
  71. package/template/src/theme/DocBreadcrumbs/index.js +75 -0
  72. package/template/src/theme/DocBreadcrumbs/styles.module.css +5 -0
  73. package/template/src/theme/DocCard/index.js +93 -0
  74. package/template/src/theme/DocCard/styles.module.css +53 -0
  75. package/template/src/theme/DocCardList/index.js +27 -0
  76. package/template/src/theme/DocCardList/styles.module.css +7 -0
  77. package/template/src/theme/DocItem/Content/index.js +121 -0
  78. package/template/src/theme/DocItem/Content/styles.module.css +96 -0
  79. package/template/src/theme/DocItem/Footer/index.js +43 -0
  80. package/template/src/theme/DocItem/Footer/styles.module.css +19 -0
  81. package/template/src/theme/DocItem/Layout/index.js +55 -0
  82. package/template/src/theme/DocItem/Layout/styles.module.css +14 -0
  83. package/template/src/theme/DocItem/Metadata/index.js +17 -0
  84. package/template/src/theme/DocItem/Paginator/index.js +17 -0
  85. package/template/src/theme/DocItem/TOC/Desktop/index.js +15 -0
  86. package/template/src/theme/DocItem/TOC/Mobile/index.js +17 -0
  87. package/template/src/theme/DocItem/TOC/Mobile/styles.module.css +12 -0
  88. package/template/src/theme/DocItem/index.js +19 -0
  89. package/template/src/theme/DocItem/styles.module.css +28 -0
  90. package/template/src/theme/DocRoot/Layout/Main/index.js +23 -0
  91. package/template/src/theme/DocRoot/Layout/Main/styles.module.css +31 -0
  92. package/template/src/theme/DocRoot/Layout/Sidebar/ExpandButton/index.js +28 -0
  93. package/template/src/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css +27 -0
  94. package/template/src/theme/DocRoot/Layout/Sidebar/index.js +70 -0
  95. package/template/src/theme/DocRoot/Layout/Sidebar/styles.module.css +32 -0
  96. package/template/src/theme/DocRoot/Layout/index.js +27 -0
  97. package/template/src/theme/DocRoot/Layout/styles.module.css +9 -0
  98. package/template/src/theme/DocRoot/index.js +25 -0
  99. package/template/src/theme/DocSidebar/Desktop/CollapseButton/index.js +28 -0
  100. package/template/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +40 -0
  101. package/template/src/theme/DocSidebar/Desktop/Content/index.js +44 -0
  102. package/template/src/theme/DocSidebar/Desktop/Content/styles.module.css +16 -0
  103. package/template/src/theme/DocSidebar/Desktop/index.js +28 -0
  104. package/template/src/theme/DocSidebar/Desktop/styles.module.css +37 -0
  105. package/template/src/theme/DocSidebar/Mobile/index.js +39 -0
  106. package/template/src/theme/DocSidebar/index.js +18 -0
  107. package/template/src/theme/DocSidebarItem/Category/index.js +203 -0
  108. package/template/src/theme/DocSidebarItem/Html/index.js +20 -0
  109. package/template/src/theme/DocSidebarItem/Html/styles.module.css +6 -0
  110. package/template/src/theme/DocSidebarItem/Link/index.js +49 -0
  111. package/template/src/theme/DocSidebarItem/Link/styles.module.css +3 -0
  112. package/template/src/theme/DocSidebarItem/index.js +15 -0
  113. package/template/src/theme/EditMetaRow/index.js +25 -0
  114. package/template/src/theme/EditMetaRow/styles.module.css +11 -0
  115. package/template/src/theme/EditThisPage/index.js +29 -0
  116. package/template/src/theme/ErrorPageContent.js +34 -0
  117. package/template/src/theme/Footer/Copyright/index.js +11 -0
  118. package/template/src/theme/Footer/Layout/index.js +21 -0
  119. package/template/src/theme/Footer/LinkItem/index.js +26 -0
  120. package/template/src/theme/Footer/Links/MultiColumn/index.js +44 -0
  121. package/template/src/theme/Footer/Links/Simple/index.js +32 -0
  122. package/template/src/theme/Footer/Links/index.js +11 -0
  123. package/template/src/theme/Footer/Logo/index.js +35 -0
  124. package/template/src/theme/Footer/Logo/styles.module.css +9 -0
  125. package/template/src/theme/Footer/index.js +22 -0
  126. package/template/src/theme/MDXComponents/Heading.js +120 -0
  127. package/template/src/theme/MDXComponents/index.js +17 -0
  128. package/template/src/theme/MDXComponents/styles.module.css +110 -0
  129. package/template/src/theme/MDXContent/index.js +6 -0
  130. package/template/src/theme/NavbarItem/DropdownNavbarItem/Desktop/index.js +110 -0
  131. package/template/src/theme/NavbarItem/DropdownNavbarItem/Mobile/index.js +136 -0
  132. package/template/src/theme/NavbarItem/DropdownNavbarItem/Mobile/styles.module.css +3 -0
  133. package/template/src/theme/NavbarItem/DropdownNavbarItem/index.js +7 -0
  134. package/template/src/theme/NotFound/Content/index.js +46 -0
  135. package/template/src/theme/NotFound/index.js +19 -0
  136. package/template/src/theme/NotFound.js +49 -0
  137. package/template/src/theme/PaginatorNavLink/index.js +17 -0
  138. package/template/src/theme/TOC/index.js +19 -0
  139. package/template/src/theme/TOC/styles.module.css +16 -0
  140. package/template/src/theme/TOCItems/Tree.js +30 -0
  141. package/template/src/theme/TOCItems/index.js +47 -0
  142. package/template/src/theme/TabItem/index.js +15 -0
  143. package/template/src/theme/TabItem/styles.module.css +10 -0
  144. package/template/src/theme/Tabs/index.js +189 -0
  145. package/template/src/theme/Tabs/styles.module.css +74 -0
  146. package/template/static/img/favicon.svg +4 -0
  147. package/template/static/img/oops-404.svg +11 -0
  148. package/template/static/searchIndex.json +1 -0
@@ -0,0 +1,96 @@
1
+ /* last updated */
2
+
3
+ .lastUpdated {
4
+ flex: 1;
5
+ font-style: normal;
6
+ font-size: 12px;
7
+ margin-top: 3px;
8
+ }
9
+
10
+ .editThisPage {
11
+ font-style: normal;
12
+ font-size: 12px;
13
+ text-align: right;
14
+ padding-top: 0; /* Changed from 33px */
15
+ margin-top: 2px;
16
+ }
17
+
18
+ .row {
19
+ display: flex;
20
+ flex-wrap: wrap;
21
+ justify-content: space-between;
22
+ align-items: flex-start; /* Changed from center to flex-start */
23
+ margin-top: -45px;
24
+ padding-bottom: 3rem;
25
+ margin-left: 4px;
26
+ }
27
+
28
+
29
+
30
+ .role {
31
+ margin-left: -2px;
32
+ margin-top: 10px;
33
+ padding-bottom: 0.05rem;
34
+ display: flex;
35
+ gap: 8px;
36
+ }
37
+
38
+ /* Media query for smaller screens */
39
+ @media (max-width: 768px) {
40
+ .lastUpdated, .editThisPage {
41
+ flex: 100%;
42
+ text-align: left;
43
+
44
+ }
45
+ .editThisPage {
46
+ padding-top: 0.5rem;
47
+ }
48
+
49
+
50
+ }
51
+
52
+ @media (max-width: 996px) {
53
+ .lastUpdated, .editThisPage {
54
+ flex: 100%;
55
+ text-align: left;
56
+
57
+ }
58
+ .editThisPage {
59
+ padding-top: 0.5rem;
60
+ }
61
+
62
+ }
63
+
64
+ @media (min-width: 997px) {
65
+ .lastUpdated {
66
+ text-align: left;
67
+ }
68
+ .editThisPage {
69
+ margin-top: 0; /* Changed from -38px */
70
+ }
71
+ }
72
+
73
+
74
+
75
+ @media only screen and (min-width: 997px) {
76
+ .docItemCol {
77
+ max-width: 75% !important;
78
+ }
79
+ }
80
+
81
+ .docItemContainer {
82
+ margin: 0 auto;
83
+ padding: 0 0.5rem;
84
+ }
85
+
86
+ @media only screen and (max-width: 996px) {
87
+ .docItemContainer {
88
+ padding: 0 0.3rem;
89
+ }
90
+ }
91
+
92
+ .docTitle {
93
+ font-size: 3rem;
94
+ margin-bottom: -calc(var(--ifm-leading-desktop) * var(--ifm-leading));
95
+ }
96
+
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {ThemeClassNames} from '@docusaurus/theme-common';
4
+ import {useDoc} from '@docusaurus/plugin-content-docs/client';
5
+ import TagsListInline from '@theme/TagsListInline';
6
+ import EditMetaRow from '@theme/EditMetaRow';
7
+ export default function DocItemFooter() {
8
+ const {metadata} = useDoc();
9
+ const {editUrl, lastUpdatedAt, lastUpdatedBy, tags} = metadata;
10
+ const canDisplayTagsRow = tags.length > 0;
11
+ const canDisplayEditMetaRow = !!(editUrl || lastUpdatedAt || lastUpdatedBy);
12
+ const canDisplayFooter = canDisplayTagsRow || canDisplayEditMetaRow;
13
+ if (!canDisplayFooter) {
14
+ return null;
15
+ }
16
+ return (
17
+ <footer
18
+ className={clsx(ThemeClassNames.docs.docFooter, 'docusaurus-mt-lg')}>
19
+ {canDisplayTagsRow && (
20
+ <div
21
+ className={clsx(
22
+ 'row margin-top--sm',
23
+ ThemeClassNames.docs.docFooterTagsRow,
24
+ )}>
25
+ <div className="col">
26
+ <TagsListInline tags={tags} />
27
+ </div>
28
+ </div>
29
+ )}
30
+ {canDisplayEditMetaRow && (
31
+ <EditMetaRow
32
+ className={clsx(
33
+ 'margin-top--sm',
34
+ ThemeClassNames.docs.docFooterEditMetaRow,
35
+ )}
36
+ editUrl={editUrl}
37
+ lastUpdatedAt={lastUpdatedAt}
38
+ lastUpdatedBy={lastUpdatedBy}
39
+ />
40
+ )}
41
+ </footer>
42
+ );
43
+ }
@@ -0,0 +1,19 @@
1
+ .pagination {
2
+ align-items: center;
3
+ }
4
+
5
+ .pagination li {
6
+
7
+ font-style: normal;
8
+ font-size: 14px;
9
+ margin-bottom: 14px;
10
+ }
11
+
12
+ ul.no-style {
13
+ list-style-type: none;
14
+ margin-left: 20px;
15
+ }
16
+
17
+ .indent {
18
+ margin-left: 10px;
19
+ }
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {useWindowSize} from '@docusaurus/theme-common';
4
+ import {useDoc} from '@docusaurus/plugin-content-docs/client';
5
+ import DocItemPaginator from '@theme/DocItem/Paginator';
6
+ import DocVersionBanner from '@theme/DocVersionBanner';
7
+ import DocVersionBadge from '@theme/DocVersionBadge';
8
+ import DocItemFooter from '@theme/DocItem/Footer';
9
+ import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile';
10
+ import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
11
+ import DocItemContent from '@theme/DocItem/Content';
12
+ import DocBreadcrumbs from '@theme/DocBreadcrumbs';
13
+ import ContentVisibility from '@theme/ContentVisibility';
14
+ import styles from './styles.module.css';
15
+ /**
16
+ * Decide if the toc should be rendered, on mobile or desktop viewports
17
+ */
18
+ function useDocTOC() {
19
+ const {frontMatter, toc} = useDoc();
20
+ const windowSize = useWindowSize();
21
+ const hidden = frontMatter.hide_table_of_contents;
22
+ const canRender = !hidden && toc.length > 0;
23
+ const mobile = canRender ? <DocItemTOCMobile /> : undefined;
24
+ const desktop =
25
+ canRender && (windowSize === 'desktop' || windowSize === 'ssr') ? (
26
+ <DocItemTOCDesktop />
27
+ ) : undefined;
28
+ return {
29
+ hidden,
30
+ mobile,
31
+ desktop,
32
+ };
33
+ }
34
+ export default function DocItemLayout({children}) {
35
+ const docTOC = useDocTOC();
36
+ const {metadata} = useDoc();
37
+ return (
38
+ <div className="row">
39
+ <div className={clsx('col', !docTOC.hidden && styles.docItemCol)}>
40
+ <ContentVisibility metadata={metadata} />
41
+ <DocVersionBanner />
42
+ <div className={styles.docItemContainer}>
43
+ <article>
44
+ <DocBreadcrumbs />
45
+ <DocVersionBadge />
46
+ {docTOC.mobile}
47
+ <DocItemContent>{children}</DocItemContent>
48
+
49
+ </article>
50
+ </div>
51
+ </div>
52
+ {docTOC.desktop && <div className="col col--3">{docTOC.desktop}</div>}
53
+ </div>
54
+ );
55
+ }
@@ -0,0 +1,14 @@
1
+ .docItemContainer header + *,
2
+ .docItemContainer article > *:first-child {
3
+ margin-top: 0rem;
4
+ }
5
+
6
+ .docItemContainer {
7
+ margin-top: -2.25rem;
8
+ }
9
+
10
+ @media (min-width: 997px) {
11
+ .docItemCol {
12
+ max-width: 75% !important;
13
+ }
14
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import {PageMetadata} from '@docusaurus/theme-common';
3
+ import {useDoc} from '@docusaurus/plugin-content-docs/client';
4
+ export default function DocItemMetadata() {
5
+ const {metadata, frontMatter, assets} = useDoc();
6
+ return (
7
+ <PageMetadata
8
+ title={metadata.title}
9
+ description={metadata.description}
10
+ keywords={frontMatter.keywords}
11
+ image={assets.image ?? frontMatter.image}
12
+ doc_type={frontMatter.docType}
13
+ product={frontMatter.product}
14
+ role={frontMatter.role}
15
+ />
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import {useDoc} from '@docusaurus/plugin-content-docs/client';
3
+ import DocPaginator from '@theme/DocPaginator';
4
+ /**
5
+ * This extra component is needed, because <DocPaginator> should remain generic.
6
+ * DocPaginator is used in non-docs contexts too: generated-index pages...
7
+ */
8
+ export default function DocItemPaginator() {
9
+ const {metadata} = useDoc();
10
+ return (
11
+ <DocPaginator
12
+ className="docusaurus-mt-lg"
13
+ previous={metadata.previous}
14
+ next={metadata.next}
15
+ />
16
+ );
17
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import {ThemeClassNames} from '@docusaurus/theme-common';
3
+ import {useDoc} from '@docusaurus/plugin-content-docs/client';
4
+ import TOC from '@theme/TOC';
5
+ export default function DocItemTOCDesktop() {
6
+ const {toc, frontMatter} = useDoc();
7
+ return (
8
+ <TOC
9
+ toc={toc}
10
+ minHeadingLevel={frontMatter.toc_min_heading_level}
11
+ maxHeadingLevel={frontMatter.toc_max_heading_level}
12
+ className={ThemeClassNames.docs.docTocDesktop}
13
+ />
14
+ );
15
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {ThemeClassNames} from '@docusaurus/theme-common';
4
+ import {useDoc} from '@docusaurus/plugin-content-docs/client';
5
+ import TOCCollapsible from '@theme/TOCCollapsible';
6
+ import styles from './styles.module.css';
7
+ export default function DocItemTOCMobile() {
8
+ const {toc, frontMatter} = useDoc();
9
+ return (
10
+ <TOCCollapsible
11
+ toc={toc}
12
+ minHeadingLevel={frontMatter.toc_min_heading_level}
13
+ maxHeadingLevel={frontMatter.toc_max_heading_level}
14
+ className={clsx(ThemeClassNames.docs.docTocMobile, styles.tocMobile)}
15
+ />
16
+ );
17
+ }
@@ -0,0 +1,12 @@
1
+ @media (min-width: 997px) {
2
+ /* Prevent hydration FOUC, as the mobile TOC needs to be server-rendered */
3
+ .tocMobile {
4
+ display: none;
5
+ }
6
+ }
7
+
8
+ @media print {
9
+ .tocMobile {
10
+ display: none;
11
+ }
12
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import {HtmlClassNameProvider} from '@docusaurus/theme-common';
3
+ import {DocProvider} from '@docusaurus/plugin-content-docs/client';
4
+ import DocItemMetadata from '@theme/DocItem/Metadata';
5
+ import DocItemLayout from '@theme/DocItem/Layout';
6
+ export default function DocItem(props) {
7
+ const docHtmlClassName = `docs-doc-id-${props.content.metadata.id}`;
8
+ const MDXComponent = props.content;
9
+ return (
10
+ <DocProvider content={props.content}>
11
+ <HtmlClassNameProvider className={docHtmlClassName}>
12
+ <DocItemMetadata />
13
+ <DocItemLayout>
14
+ <MDXComponent />
15
+ </DocItemLayout>
16
+ </HtmlClassNameProvider>
17
+ </DocProvider>
18
+ );
19
+ }
@@ -0,0 +1,28 @@
1
+ @media only screen and (min-width: 997px) {
2
+ .docItemCol {
3
+ max-width: 75% !important;
4
+ }
5
+ }
6
+
7
+ .docItemContainer {
8
+ margin: 0 auto;
9
+ padding: 0 0.5rem;
10
+
11
+ }
12
+
13
+ @media only screen and (max-width: 996px) {
14
+ .docItemContainer {
15
+ padding: 0 0.3rem;
16
+ }
17
+ }
18
+
19
+ .docTitle {
20
+ font-size: 3rem;
21
+ margin-bottom: -calc(var(--ifm-leading-desktop) * var(--ifm-leading));
22
+ }
23
+
24
+ .docLastUpdatedAt {
25
+ font-weight: bold;
26
+ }
27
+
28
+
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
4
+ import styles from './styles.module.css';
5
+ export default function DocRootLayoutMain({hiddenSidebarContainer, children}) {
6
+ const sidebar = useDocsSidebar();
7
+ return (
8
+ <main
9
+ className={clsx(
10
+ styles.docMainContainer,
11
+ (hiddenSidebarContainer || !sidebar) && styles.docMainContainerEnhanced,
12
+ )}>
13
+ <div
14
+ className={clsx(
15
+ 'container padding-top--md padding-bottom--lg',
16
+ styles.docItemWrapper,
17
+ hiddenSidebarContainer && styles.docItemWrapperEnhanced,
18
+ )}>
19
+ {children}
20
+ </div>
21
+ </main>
22
+ );
23
+ }
@@ -0,0 +1,31 @@
1
+ .docMainContainer {
2
+ display: flex;
3
+ width: 100%;
4
+ margin-left: 0px;
5
+ /* box-shadow: var(--ifm-global-shadow-lw); */
6
+ }
7
+
8
+ article,
9
+ .paper {
10
+ margin: 0 calc(var(--ifm-spacing-horizontal) * -0.5);
11
+ padding: 1rem 2rem;
12
+ /* box-shadow: var(--ifm-global-shadow-lw); */
13
+ }
14
+
15
+
16
+ @media (min-width: 997px) {
17
+ .docMainContainer {
18
+ flex-grow: 1;
19
+ max-width: calc(100% - var(--doc-sidebar-width));
20
+ }
21
+
22
+ .docMainContainerEnhanced {
23
+ max-width: calc(100% - var(--doc-sidebar-hidden-width));
24
+ }
25
+
26
+ .docItemWrapperEnhanced {
27
+ max-width: calc(
28
+ var(--ifm-container-width) + var(--doc-sidebar-width)
29
+ ) !important;
30
+ }
31
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import {translate} from '@docusaurus/Translate';
3
+ import IconArrow from '@theme/Icon/Arrow';
4
+ import styles from './styles.module.css';
5
+ export default function DocRootLayoutSidebarExpandButton({toggleSidebar}) {
6
+ return (
7
+ <div
8
+ className={styles.expandButton}
9
+ title={translate({
10
+ id: 'theme.docs.sidebar.expandButtonTitle',
11
+ message: 'Expand sidebar',
12
+ description:
13
+ 'The ARIA label and title attribute for expand button of doc sidebar',
14
+ })}
15
+ aria-label={translate({
16
+ id: 'theme.docs.sidebar.expandButtonAriaLabel',
17
+ message: 'Expand sidebar',
18
+ description:
19
+ 'The ARIA label and title attribute for expand button of doc sidebar',
20
+ })}
21
+ tabIndex={0}
22
+ role="button"
23
+ onKeyDown={toggleSidebar}
24
+ onClick={toggleSidebar}>
25
+ <IconArrow className={styles.expandButtonIcon} />
26
+ </div>
27
+ );
28
+ }
@@ -0,0 +1,27 @@
1
+ @media (min-width: 997px) {
2
+ .expandButton {
3
+ position: absolute;
4
+ top: 0;
5
+ right: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ transition: background-color var(--ifm-transition-fast) ease;
12
+ background-color: var(--docusaurus-collapse-button-bg);
13
+ }
14
+
15
+ .expandButton:hover,
16
+ .expandButton:focus {
17
+ background-color: var(--docusaurus-collapse-button-bg-hover);
18
+ }
19
+
20
+ .expandButtonIcon {
21
+ transform: rotate(0);
22
+ }
23
+
24
+ [dir='rtl'] .expandButtonIcon {
25
+ transform: rotate(180deg);
26
+ }
27
+ }
@@ -0,0 +1,70 @@
1
+ import React, {useState, useCallback} from 'react';
2
+ import clsx from 'clsx';
3
+ import {prefersReducedMotion, ThemeClassNames} from '@docusaurus/theme-common';
4
+ import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
5
+ import {useLocation} from '@docusaurus/router';
6
+ import DocSidebar from '@theme/DocSidebar';
7
+ import ExpandButton from '@theme/DocRoot/Layout/Sidebar/ExpandButton';
8
+ import styles from './styles.module.css';
9
+ // Reset sidebar state when sidebar changes
10
+ // Use React key to unmount/remount the children
11
+ // See https://github.com/facebook/docusaurus/issues/3414
12
+ function ResetOnSidebarChange({children}) {
13
+ const sidebar = useDocsSidebar();
14
+ return (
15
+ <React.Fragment key={sidebar?.name ?? 'noSidebar'}>
16
+ {children}
17
+ </React.Fragment>
18
+ );
19
+ }
20
+ export default function DocRootLayoutSidebar({
21
+ sidebar,
22
+ hiddenSidebarContainer,
23
+ setHiddenSidebarContainer,
24
+ }) {
25
+ const {pathname} = useLocation();
26
+ const [hiddenSidebar, setHiddenSidebar] = useState(false);
27
+ const toggleSidebar = useCallback(() => {
28
+ if (hiddenSidebar) {
29
+ setHiddenSidebar(false);
30
+ }
31
+ // onTransitionEnd won't fire when sidebar animation is disabled
32
+ // fixes https://github.com/facebook/docusaurus/issues/8918
33
+ if (!hiddenSidebar && prefersReducedMotion()) {
34
+ setHiddenSidebar(true);
35
+ }
36
+ setHiddenSidebarContainer((value) => !value);
37
+ }, [setHiddenSidebarContainer, hiddenSidebar]);
38
+ return (
39
+ <aside
40
+ className={clsx(
41
+ ThemeClassNames.docs.docSidebarContainer,
42
+ styles.docSidebarContainer,
43
+ hiddenSidebarContainer && styles.docSidebarContainerHidden,
44
+ )}
45
+ onTransitionEnd={(e) => {
46
+ if (!e.currentTarget.classList.contains(styles.docSidebarContainer)) {
47
+ return;
48
+ }
49
+ if (hiddenSidebarContainer) {
50
+ setHiddenSidebar(true);
51
+ }
52
+ }}>
53
+ <ResetOnSidebarChange>
54
+ <div
55
+ className={clsx(
56
+ styles.sidebarViewport,
57
+ hiddenSidebar && styles.sidebarViewportHidden,
58
+ )}>
59
+ <DocSidebar
60
+ sidebar={sidebar}
61
+ path={pathname}
62
+ onCollapse={toggleSidebar}
63
+ isHidden={hiddenSidebar}
64
+ />
65
+ {hiddenSidebar && <ExpandButton toggleSidebar={toggleSidebar} />}
66
+ </div>
67
+ </ResetOnSidebarChange>
68
+ </aside>
69
+ );
70
+ }
@@ -0,0 +1,32 @@
1
+ :root {
2
+ --doc-sidebar-width: 300px;
3
+ --doc-sidebar-hidden-width: 30px;
4
+ }
5
+
6
+ .docSidebarContainer {
7
+ display: none;
8
+ }
9
+
10
+ @media (min-width: 997px) {
11
+ .docSidebarContainer {
12
+ display: block;
13
+ width: var(--doc-sidebar-width);
14
+ margin-top: calc(-1 * var(--ifm-navbar-height));
15
+ border-right: 1px solid var(--ifm-toc-border-color);
16
+ will-change: width;
17
+ transition: width var(--ifm-transition-fast) ease;
18
+ clip-path: inset(0);
19
+ }
20
+
21
+ .docSidebarContainerHidden {
22
+ width: var(--doc-sidebar-hidden-width);
23
+ cursor: pointer;
24
+ }
25
+
26
+ .sidebarViewport {
27
+ top: 0;
28
+ position: sticky;
29
+ height: 100%;
30
+ max-height: 100vh;
31
+ }
32
+ }
@@ -0,0 +1,27 @@
1
+ import React, {useState} from 'react';
2
+ import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
3
+ import BackToTopButton from '@theme/BackToTopButton';
4
+ import DocRootLayoutSidebar from '@theme/DocRoot/Layout/Sidebar';
5
+ import DocRootLayoutMain from '@theme/DocRoot/Layout/Main';
6
+ import styles from './styles.module.css';
7
+ export default function DocRootLayout({children}) {
8
+ const sidebar = useDocsSidebar();
9
+ const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false);
10
+ return (
11
+ <div className={styles.docsWrapper}>
12
+ <BackToTopButton />
13
+ <div className={styles.docRoot}>
14
+ {sidebar && (
15
+ <DocRootLayoutSidebar
16
+ sidebar={sidebar.items}
17
+ hiddenSidebarContainer={hiddenSidebarContainer}
18
+ setHiddenSidebarContainer={setHiddenSidebarContainer}
19
+ />
20
+ )}
21
+ <DocRootLayoutMain hiddenSidebarContainer={hiddenSidebarContainer}>
22
+ {children}
23
+ </DocRootLayoutMain>
24
+ </div>
25
+ </div>
26
+ );
27
+ }
@@ -0,0 +1,9 @@
1
+ .docRoot {
2
+ display: flex;
3
+ width: 100%;
4
+ }
5
+
6
+ .docsWrapper {
7
+ display: flex;
8
+ flex: 1 0 auto;
9
+ }
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {HtmlClassNameProvider, ThemeClassNames} from '@docusaurus/theme-common';
4
+ import {
5
+ DocsSidebarProvider,
6
+ useDocRootMetadata,
7
+ } from '@docusaurus/plugin-content-docs/client';
8
+ import DocRootLayout from '@theme/DocRoot/Layout';
9
+ import NotFoundContent from '@theme/NotFound/Content';
10
+ export default function DocRoot(props) {
11
+ const currentDocRouteMetadata = useDocRootMetadata(props);
12
+ if (!currentDocRouteMetadata) {
13
+ // We only render the not found content to avoid a double layout
14
+ // see https://github.com/facebook/docusaurus/pull/7966#pullrequestreview-1077276692
15
+ return <NotFoundContent />;
16
+ }
17
+ const {docElement, sidebarName, sidebarItems} = currentDocRouteMetadata;
18
+ return (
19
+ <HtmlClassNameProvider className={clsx(ThemeClassNames.page.docsDocPage)}>
20
+ <DocsSidebarProvider name={sidebarName} items={sidebarItems}>
21
+ <DocRootLayout>{docElement}</DocRootLayout>
22
+ </DocsSidebarProvider>
23
+ </HtmlClassNameProvider>
24
+ );
25
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {translate} from '@docusaurus/Translate';
4
+ import IconArrow from '@theme/Icon/Arrow';
5
+ import styles from './styles.module.css';
6
+ export default function CollapseButton({onClick}) {
7
+ return (
8
+ <button
9
+ type="button"
10
+ title={translate({
11
+ id: 'theme.docs.sidebar.collapseButtonTitle',
12
+ message: 'Collapse sidebar',
13
+ description: 'The title attribute for collapse button of doc sidebar',
14
+ })}
15
+ aria-label={translate({
16
+ id: 'theme.docs.sidebar.collapseButtonAriaLabel',
17
+ message: 'Collapse sidebar',
18
+ description: 'The title attribute for collapse button of doc sidebar',
19
+ })}
20
+ className={clsx(
21
+ 'button button--secondary button--outline',
22
+ styles.collapseSidebarButton,
23
+ )}
24
+ onClick={onClick}>
25
+ <IconArrow className={styles.collapseSidebarButtonIcon} />
26
+ </button>
27
+ );
28
+ }