Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

1.2 KB
Raw Blame
import BrowserOnly from '@docusaurus/BrowserOnly';
import { useDoc } from '@docusaurus/plugin-content-docs/client';
import { ThemeClassNames } from '@docusaurus/theme-common';
import LLMButtons from '@site/src/components/LLMButtons';
import Heading from '@theme/Heading';
import MDXContent from '@theme/MDXContent';
import clsx from 'clsx';
import React from 'react';

import styles from './styles.module.css';

function useSyntheticTitle() {
    const { metadata, frontMatter, contentTitle } = useDoc();
    const shouldRender = !frontMatter.hide_title && typeof contentTitle === 'undefined';
  
    if (!shouldRender) {
      return null;
    }
  
    return metadata.title;
  }

export default function DocItemContent({ children }) {
    const syntheticTitle = useSyntheticTitle();

    return (
        <div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
            {syntheticTitle && (
                <div className={styles.docItemContent}>
                    {syntheticTitle && <Heading as="h1">{syntheticTitle}</Heading>}
                    <BrowserOnly>{() => <LLMButtons />}</BrowserOnly>
                </div>
            )}
            <MDXContent>{children}</MDXContent>
        </div>
    );
}