bhasudha commented on code in PR #8518:
URL: https://github.com/apache/hudi/pull/8518#discussion_r1172858555
##########
website/src/theme/DocPage/index.js:
##########
@@ -0,0 +1,175 @@
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+import React, {useState, useCallback} from 'react';
+import {MDXProvider} from '@mdx-js/react';
+import renderRoutes from '@docusaurus/renderRoutes';
+import Layout from '@theme/Layout';
+import DocSidebar from '@theme/DocSidebar';
+import MDXComponents from '@theme/MDXComponents';
+import NotFound from '@theme/NotFound';
+import IconArrow from '@theme/IconArrow';
+import BackToTopButton from '@theme/BackToTopButton';
+import {matchPath} from '@docusaurus/router';
+import {translate} from '@docusaurus/Translate';
+import clsx from 'clsx';
+import styles from './styles.module.css';
+import {
+ ThemeClassNames,
+ docVersionSearchTag,
+ DocsSidebarProvider,
+ useDocsSidebar,
+ DocsVersionProvider,
+} from '@docusaurus/theme-common';
+import Head from '@docusaurus/Head';
+
+function DocPageContent({
+ currentDocRoute,
+ versionMetadata,
+ children,
+ sidebarName,
+}) {
+ const sidebar = useDocsSidebar();
+
+ const {pluginId, version} = versionMetadata;
+ const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false);
+ const [hiddenSidebar, setHiddenSidebar] = useState(false);
+ const toggleSidebar = useCallback(() => {
+ if (hiddenSidebar) {
+ setHiddenSidebar(false);
+ }
+
+ setHiddenSidebarContainer((value) => !value);
+ }, [hiddenSidebar]);
+ return (
+ <Layout
+ wrapperClassName={ThemeClassNames.wrapper.docsPages}
+ pageClassName={ThemeClassNames.page.docsDocPage}
+ searchMetadata={{
+ version,
+ tag: docVersionSearchTag(pluginId, version),
+ }}>
+ <div className={styles.docPage}>
+ <BackToTopButton />
+
+ {sidebar && (
+ <aside
+ className={clsx(styles.docSidebarContainer, {
+ [styles.docSidebarContainerHidden]: hiddenSidebarContainer,
+ })}
+ onTransitionEnd={(e) => {
+ if (
+ !e.currentTarget.classList.contains(styles.docSidebarContainer)
+ ) {
+ return;
+ }
+
+ if (hiddenSidebarContainer) {
+ setHiddenSidebar(true);
+ }
+ }}>
+ <DocSidebar
+ key={
+ // Reset sidebar state on sidebar changes
+ // See https://github.com/facebook/docusaurus/issues/3414
+ sidebarName
+ }
+ sidebar={sidebar}
+ path={currentDocRoute.path}
+ onCollapse={toggleSidebar}
+ isHidden={hiddenSidebar}
+ />
+
+ {hiddenSidebar && (
+ <div
+ className={styles.collapsedDocSidebar}
+ title={translate({
+ id: 'theme.docs.sidebar.expandButtonTitle',
+ message: 'Expand sidebar',
+ description:
+ 'The ARIA label and title attribute for expand button of
doc sidebar',
+ })}
+ aria-label={translate({
+ id: 'theme.docs.sidebar.expandButtonAriaLabel',
+ message: 'Expand sidebar',
+ description:
+ 'The ARIA label and title attribute for expand button of
doc sidebar',
+ })}
+ tabIndex={0}
+ role="button"
+ onKeyDown={toggleSidebar}
+ onClick={toggleSidebar}>
+ <IconArrow className={styles.expandSidebarButtonIcon} />
+ </div>
+ )}
+ </aside>
+ )}
+ <main
+ className={clsx(styles.docMainContainer, {
+ [styles.docMainContainerEnhanced]:
+ hiddenSidebarContainer || !sidebar,
+ })}>
+ <div
+ className={clsx(
+ 'container padding-top--md padding-bottom--lg',
+ styles.docItemWrapper,
+ {
+ [styles.docItemWrapperEnhanced]: hiddenSidebarContainer,
+ },
+ )}>
+ <MDXProvider components={MDXComponents}>{children}</MDXProvider>
+ </div>
+ </main>
+ </div>
+ </Layout>
+ );
+}
+
+const arrayOfPages = (matchPath) => [`${matchPath}/configurations`];
Review Comment:
fyi. This is added to customize ui styling in specific pages. Here is the
place where we can add other doc pages that will have configs listed in a table
format.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]