import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';

const sidebars: SidebarsConfig = {
  docs: [
    {
      type: 'category',
      label: 'Introduction',
      collapsed: false,
      items: ['index', 'build', 'bug'],
    },
    {
      type: 'category',
      label: 'CLI',
      collapsed: false,
      items: [
        'cli/driver',
        'cli/lpcc',
        'cli/o2json',
        'cli/json2o',
      ],
    },
    {
      type: 'category',
      label: 'LPC',
      link: { type: 'doc', id: 'lpc/index' },
      items: [
        {
          type: 'category',
          label: 'Types',
          link: { type: 'doc', id: 'lpc/types/index' },
          items: [
            'lpc/types/general',
            'lpc/types/array',
            'lpc/types/buffer',
            'lpc/types/classes',
            'lpc/types/float',
            'lpc/types/function',
            'lpc/types/mappings',
            'lpc/types/strings',
            'lpc/types/substructures',
          ],
        },
        {
          type: 'category',
          label: 'Constructs',
          link: { type: 'doc', id: 'lpc/constructs/index' },
          items: [
            'lpc/constructs/for',
            'lpc/constructs/function',
            'lpc/constructs/if',
            'lpc/constructs/include',
            'lpc/constructs/inherit',
            'lpc/constructs/prototypes',
            'lpc/constructs/switch',
            'lpc/constructs/while',
          ],
        },
        {
          type: 'category',
          label: 'Preprocessor',
          link: { type: 'doc', id: 'lpc/preprocessor/index' },
          items: [
            'lpc/preprocessor/define',
            'lpc/preprocessor/include',
          ],
        },
      ],
    },
    {
      type: 'category',
      label: 'Driver',
      link: { type: 'doc', id: 'driver/index' },
      items: [
        'driver/config',
        'driver/adding_efuns',
        'driver/stackmachine',
        'driver/parse_tree',
        'driver/call_into_vm',
        'driver/malloc',
      ],
    },
    {
      type: 'category',
      label: 'Reference',
      items: [
        {
          type: 'category',
          label: 'Apply',
          link: { type: 'doc', id: 'apply/index' },
          items: [
            { type: 'doc', id: 'apply/master/index', label: 'Master' },
            { type: 'doc', id: 'apply/interactive/index', label: 'Interactive' },
            { type: 'doc', id: 'apply/object/index', label: 'Object' },
          ],
        },
        { type: 'doc', id: 'efun/index', label: 'EFUN' },
        { type: 'doc', id: 'stdlib/index', label: 'LPC Library' },
      ],
    },
    {
      type: 'category',
      label: 'Concepts',
      link: { type: 'doc', id: 'concepts/index' },
      items: [
        { type: 'autogenerated', dirName: 'concepts' },
      ],
    },
    {
      type: 'category',
      label: '中文文档',
      items: [
        { type: 'doc', id: 'zh-CN/build/index', label: '编译文档' },
        { type: 'doc', id: 'zh-CN/apply/index', label: 'Apply 文档' },
        { type: 'doc', id: 'zh-CN/efun/index', label: 'EFUN 文档' },
      ],
    },
    {
      type: 'category',
      label: 'Historical',
      items: ['build_v2017'],
    },
  ],
};

export default sidebars;
