@sp-days-framework/create-sp-days 1.0.4 → 1.1.0-beta2

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 (75) hide show
  1. package/README.md +14 -0
  2. package/bin/index.js +2 -0
  3. package/docs/advanced-config.mdx +412 -0
  4. package/docs/changelog.mdx +129 -0
  5. package/docs/index.mdx +206 -0
  6. package/docs/install.mdx +199 -0
  7. package/docs/sidebar-sections.mdx +268 -0
  8. package/docs/sp-days-plugin-color-light.svg +53 -0
  9. package/lib/.tsbuildinfo +1 -0
  10. package/lib/.tsbuildinfo-build +1 -0
  11. package/lib/index.d.ts +1 -0
  12. package/lib/index.js +36 -7
  13. package/package.json +31 -7
  14. package/publish-package-docs.js +12 -0
  15. package/templates/addon-resources/resources/api-reference.mdx +132 -0
  16. package/templates/addon-resources/resources/best-practice.mdx +407 -0
  17. package/templates/addon-resources/resources/cheat-sheet.mdx +120 -0
  18. package/templates/addon-resources/resources/cli-reference.mdx +280 -0
  19. package/templates/addon-resources/resources/configuration-guide.mdx +211 -0
  20. package/templates/addon-resources/resources/environment-setup.mdx +317 -0
  21. package/templates/addon-resources/resources/faq.mdx +146 -0
  22. package/templates/addon-resources/resources/glossary.mdx +78 -0
  23. package/templates/addon-resources/resources/index.mdx +67 -16
  24. package/templates/addon-resources/resources/quick-start.mdx +193 -0
  25. package/templates/addon-resources/resources/troubleshooting.mdx +263 -0
  26. package/templates/addon-resources/resources/useful-links.mdx +61 -0
  27. package/templates/page-course/README.md +87 -0
  28. package/templates/page-course/docusaurus.config.ts +103 -10
  29. package/templates/page-course/package.json +12 -2
  30. package/templates/page-course/sidebarSections.js +118 -0
  31. package/templates/page-course/src/css/sp-days-theme.scss +428 -211
  32. package/tsconfig.base.client.json +10 -0
  33. package/tsconfig.base.json +71 -0
  34. package/tsconfig.build.json +9 -0
  35. package/sp-days-framework-create-sp-days-1.0.3.tgz +0 -0
  36. package/templates/addon-resources/resources/interactive-tasks/creating-tasks.mdx +0 -254
  37. package/templates/addon-resources/resources/interactive-tasks/examples/_category_.yml +0 -3
  38. package/templates/addon-resources/resources/interactive-tasks/examples/advanced-usage.mdx +0 -304
  39. package/templates/addon-resources/resources/interactive-tasks/examples/basic-usage.mdx +0 -128
  40. package/templates/addon-resources/resources/interactive-tasks/index.mdx +0 -93
  41. package/templates/addon-resources/resources/interactive-tasks/setup/advanced-configuration.mdx +0 -273
  42. package/templates/addon-resources/resources/interactive-tasks/setup/index.mdx +0 -120
  43. package/templates/addon-resources/resources/interactive-tasks/task-progression.mdx +0 -140
  44. package/templates/addon-resources/resources/slidev-integration/index.mdx +0 -106
  45. package/templates/addon-resources/resources/slidev-integration/setup/advanced-configuration.mdx +0 -144
  46. package/templates/addon-resources/resources/slidev-integration/setup/index.mdx +0 -200
  47. package/templates/addon-resources/resources/sykehuspartner-theme/index.mdx +0 -105
  48. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/_category_.yml +0 -2
  49. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/content/_category_.yml +0 -2
  50. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/content/center.mdx +0 -33
  51. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/content/default.mdx +0 -59
  52. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/content/full.mdx +0 -49
  53. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/image/_category_.yml +0 -2
  54. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/image/image-left.mdx +0 -37
  55. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/image/image-right.mdx +0 -37
  56. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/image/image.mdx +0 -56
  57. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/multi-column/_category_.yml +0 -2
  58. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/multi-column/three-cols-header.mdx +0 -49
  59. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/multi-column/three-cols.mdx +0 -47
  60. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/multi-column/two-cols-header.mdx +0 -43
  61. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/multi-column/two-cols.mdx +0 -38
  62. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/section/_category_.yml +0 -2
  63. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/section/cover.mdx +0 -43
  64. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/section/end.mdx +0 -33
  65. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/section/intro.mdx +0 -49
  66. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/section/section.mdx +0 -41
  67. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/special/_category_.yml +0 -2
  68. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/special/about-me.mdx +0 -92
  69. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/special/fact.mdx +0 -47
  70. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/special/quote.mdx +0 -27
  71. package/templates/addon-resources/resources/sykehuspartner-theme/layouts/special/statement.mdx +0 -28
  72. package/templates/addon-resources/resources/sykehuspartner-theme/setup/advanced-configuration.mdx +0 -79
  73. package/templates/addon-resources/resources/sykehuspartner-theme/setup/index.mdx +0 -104
  74. package/templates/addon-resources/resources/sykehuspartner-theme/syntax-and-icons.mdx +0 -89
  75. package/templates/addon-slidev/package.json +0 -54
package/docs/index.mdx ADDED
@@ -0,0 +1,206 @@
1
+ ---
2
+ title: Create SP Days
3
+ hide_title: true
4
+ sidebar_class_name: title-logo-sidebar-sp-days
5
+ sidebar_label: "Create SP Days"
6
+ sidebar_position: 0
7
+ ---
8
+
9
+ import Tabs from "@theme/Tabs";
10
+ import TabItem from "@theme/TabItem";
11
+ import LogoSPDays from './sp-days-plugin-color-light.svg';
12
+
13
+ <div align="center">
14
+ <div style={{ display: 'flex', justifyContent: 'center', margin: '1rem' }}>
15
+ <LogoSPDays width="110" height="110"/>
16
+ </div>
17
+ <div align="center">
18
+ # Create SP Days
19
+ </div>
20
+ <div align="center">
21
+ <p>
22
+ *Scaffolding tool for creating SP Days course websites!*
23
+ </p>
24
+ <h4>
25
+ <a href="./create-sp-days/install/">🔧 Setup</a> ·
26
+ <a href="https://www.npmjs.com/package/@sp-days-framework/create-sp-days">📦 NPM Package</a> ·
27
+ <a href="https://github.com/helse-sorost/sp-days-framework">💻 Source Code</a>
28
+ </h4>
29
+ </div>
30
+ </div>
31
+
32
+ ---
33
+
34
+ ## Features
35
+
36
+ - **Zero-Config Setup** - Get started with a fully configured course website in minutes
37
+ - **Interactive CLI** - Guided setup process with sensible defaults
38
+ - **Flexible Templates** - Base course structure with optional Slidev and Resources addons
39
+ - **TypeScript Ready** - Full TypeScript support out of the box
40
+ - **Multiple Package Managers** - Works with npm, yarn, pnpm, and bun
41
+ - **GitHub Integration** - Pre-configured for GitHub Pages deployment
42
+
43
+ ## Quick Start
44
+
45
+ ### Interactive Mode (Recommended)
46
+
47
+ Run the scaffolding tool and follow the prompts:
48
+
49
+ ```bash
50
+ npx @sp-days-framework/create-sp-days
51
+ ```
52
+
53
+ You'll be asked for:
54
+
55
+ - **Site name** - Directory name for your project
56
+ - **Project details** - Name, GitHub org, repository
57
+ - **Branding** - Site title and tagline
58
+ - **Features** - Enable Slidev presentations and/or Resources documentation
59
+
60
+ ### Quick Create
61
+
62
+ Create a new course with one command:
63
+
64
+ ```bash
65
+ npx @sp-days-framework/create-sp-days my-course
66
+ ```
67
+
68
+ This creates a basic course structure in the `my-course` directory. You can customize it later.
69
+
70
+ ## What You Get
71
+
72
+ ### Base Template (Always Included)
73
+
74
+ Every SP-Days course comes with:
75
+
76
+ - **Docusaurus 3.x** - Modern documentation framework
77
+ - **Interactive Tasks** - Hands-on learning exercises with built-in task tracking
78
+ - **Frontpage Components** - Beautiful landing page components and layouts
79
+ - **Course Structure** - Pre-configured `/course` directory ready for your content
80
+ - **TypeScript** - Full type safety and IntelliSense support
81
+ - **SASS Support** - Custom styling capabilities
82
+ - **Mermaid Diagrams** - Create flowcharts, sequence diagrams, and more
83
+
84
+ ### Optional Addons
85
+
86
+ <Tabs>
87
+ <TabItem value="slidev" label="Slidev Integration" default>
88
+ Add presentation capabilities to your course:
89
+
90
+ ```bash
91
+ npx @sp-days-framework/create-sp-days my-course --addon-slidev
92
+ ```
93
+
94
+ Includes:
95
+
96
+ - Slidev integration plugin
97
+ - Sykehuspartner theme
98
+ - Example presentations
99
+ - `npm run slidev` command
100
+ </TabItem>
101
+ <TabItem value="resources" label="Resources Documentation">
102
+ Add comprehensive documentation:
103
+
104
+ ```bash
105
+ npx @sp-days-framework/create-sp-days my-course --addon-resources
106
+ ```
107
+
108
+ Includes:
109
+
110
+ - Separate documentation instance
111
+ - Component usage guides
112
+ - Setup examples
113
+ - Best practices
114
+ </TabItem>
115
+ <TabItem value="package-docs" label="Package Documentation">
116
+ Add developer documentation for all installed plugins:
117
+
118
+ ```bash
119
+ npx @sp-days-framework/create-sp-days my-course --include-package-docs
120
+ ```
121
+
122
+ Includes:
123
+
124
+ - Plugin API documentation
125
+ - Developer guides
126
+ - Accessible via "Plugin Docs" dropdown
127
+ - Routes: `/package-docs/interactive-tasks`, etc.
128
+
129
+ :::info Package Documentation Feature
130
+ Starting from version 1.1.0, all `@sp-days-framework` packages include their documentation as pre-made Docusaurus MDX files. This feature is useful for package development and easier documentation access, but adds unnecessary dependencies for production builds.
131
+
132
+ **Note:** Enabling package documentation automatically installs the Slidev addon (even if not explicitly requested) because package docs include Slidev theme documentation.
133
+ :::
134
+ </TabItem>
135
+ </Tabs>
136
+
137
+ ## Getting Started
138
+
139
+ ### 1. Create Your Course
140
+
141
+ <Tabs>
142
+ <TabItem value="interactive" label="Interactive Mode" default>
143
+ ```bash
144
+ npx @sp-days-framework/create-sp-days
145
+ ```
146
+
147
+ Follow the prompts to configure your course. The interactive mode guides you through all options with helpful defaults and suggestions.
148
+ </TabItem>
149
+ <TabItem value="cli" label="CLI Mode">
150
+ ```bash
151
+ npx @sp-days-framework/create-sp-days docker-course \
152
+ --title "Docker Fundamentals" \
153
+ --tagline "Master containerization" \
154
+ --addon-slidev
155
+ ```
156
+
157
+ Specify all options upfront. Perfect for scripting or when you know exactly what you want.
158
+ </TabItem>
159
+ </Tabs>
160
+
161
+ ### 2. Add Your Content
162
+
163
+ Create your course content in the generated project:
164
+
165
+ **Main landing page:**
166
+ - Edit `src/pages/index.mdx` to customize your course homepage
167
+
168
+ **Course modules:**
169
+ - Add lessons in `course/` directory
170
+ - Each `.mdx` file becomes a page
171
+
172
+ **Presentations (if `--addon-slidev` enabled):**
173
+ - Create slides in `slidev/` directory
174
+ - Run `npm run slidev ./slidev/your-presentation.md` for live preview
175
+
176
+ **Resources (if `--addon-resources` enabled):**
177
+ - Add documentation in `resources/` directory
178
+
179
+ ### 3. Development
180
+
181
+ Start the development server:
182
+
183
+ ```bash
184
+ npm start
185
+ ```
186
+
187
+ Open `http://localhost:3000` to see your course site. The server will hot-reload as you edit content.
188
+
189
+ See [Installation](./install.mdx) for detailed configuration options.
190
+
191
+ ## Available Commands
192
+
193
+ After creating your course, use these commands:
194
+
195
+ | Command | Description |
196
+ |---------|-------------|
197
+ | `npm start` | Start development server with hot-reload |
198
+ | `npm run build` | Build for production |
199
+ | `npm run serve` | Preview production build locally |
200
+ | `npm run slidev` | Launch Slidev (if `--addon-slidev` enabled) |
201
+ | `npm run typecheck` | Run TypeScript type checking |
202
+
203
+ ## Requirements
204
+
205
+ - **Node.js** >= 20.0
206
+ - **Package Manager** - npm, yarn, pnpm, or bun
@@ -0,0 +1,199 @@
1
+ ---
2
+ sidebar_position: 1.1
3
+ sidebar_custom_props:
4
+ section: "Setup"
5
+ section_position: 1
6
+ ---
7
+
8
+ import Tabs from "@theme/Tabs";
9
+ import TabItem from "@theme/TabItem";
10
+
11
+ # Installation
12
+
13
+ No installation required! Use `npx` to run the latest version:
14
+
15
+ ```bash
16
+ npx @sp-days-framework/create-sp-days
17
+ ```
18
+
19
+ Or install globally if you create courses frequently:
20
+
21
+ <Tabs>
22
+ <TabItem value="npm" label="npm" default>
23
+ ```bash
24
+ npm install -g @sp-days-framework/create-sp-days
25
+ ```
26
+ </TabItem>
27
+ <TabItem value="yarn" label="Yarn">
28
+ ```bash
29
+ yarn global add @sp-days-framework/create-sp-days
30
+ ```
31
+ </TabItem>
32
+ <TabItem value="pnpm" label="pnpm">
33
+ ```bash
34
+ pnpm add -g @sp-days-framework/create-sp-days
35
+ ```
36
+ </TabItem>
37
+ <TabItem value="bun" label="Bun">
38
+ ```bash
39
+ bun add -g @sp-days-framework/create-sp-days
40
+ ```
41
+ </TabItem>
42
+ </Tabs>
43
+
44
+ Then run the tool:
45
+
46
+ ```bash
47
+ create-sp-days my-course
48
+ ```
49
+
50
+ ## Usage Examples
51
+
52
+ ### Interactive Setup (Recommended)
53
+
54
+ The easiest way to get started is interactive mode:
55
+
56
+ ```bash
57
+ npx @sp-days-framework/create-sp-days
58
+ ```
59
+
60
+ **What you'll be asked:**
61
+
62
+ 1. **Site name** - Directory name (e.g., `docs`)
63
+ 2. **Project name** - Package name (defaults to site name)
64
+ 3. **GitHub organization** - Your org (defaults to `helse-sorost`)
65
+ 4. **Repository name** - Repo name (defaults to project name)
66
+ 5. **Site title** - Display title (e.g., `Docker Fundamentals`)
67
+ 6. **Tagline** - Brief description (e.g., `Master containerization`)
68
+ 7. **Add Slidev?** - Enable presentations (yes/no)
69
+ 8. **Add Resources?** - Enable documentation (yes/no)
70
+
71
+ :::tip[Auto-detection]
72
+ The package manager is auto-detected from your system. You can override it by selecting a different option.
73
+ :::
74
+
75
+ ### Minimal Setup
76
+
77
+ Create a basic course with defaults:
78
+
79
+ ```bash
80
+ npx @sp-days-framework/create-sp-days my-course
81
+ ```
82
+
83
+ This creates a project with:
84
+
85
+ - Directory: `my-course`
86
+ - Title: `SP Days Template`
87
+ - Tagline: `Empowered by Docusaurus and Slidev`
88
+ - Organization: `helse-sorost`
89
+ - No addons
90
+
91
+ ### Skip Dependency Installation
92
+
93
+ Create the structure without installing dependencies:
94
+
95
+ ```bash
96
+ npx @sp-days-framework/create-sp-days my-course --skip-install
97
+ cd my-course
98
+ npm install
99
+ ```
100
+
101
+ Useful when:
102
+
103
+ - You want to review the structure first
104
+ - You need to configure proxies or registries
105
+ - You're working offline
106
+
107
+ ## Understanding Addons
108
+
109
+ ### Base Template Features
110
+
111
+ Every course includes:
112
+
113
+ ```json title="package.json" {3-5}
114
+ {
115
+ "dependencies": {
116
+ "@docusaurus/core": "3.9.2",
117
+ "@sp-days-framework/docusaurus-plugin-interactive-tasks": "^1.0.0",
118
+ "@sp-days-framework/docusaurus-frontpage-collection": "^1.0.0"
119
+ }
120
+ }
121
+ ```
122
+
123
+ **Pre-configured:**
124
+
125
+ - Docusaurus preset-classic
126
+ - Interactive task system
127
+ - Frontpage component library
128
+ - TypeScript support
129
+ - SASS/SCSS styling
130
+ - Mermaid diagram support
131
+
132
+ ### Slidev Addon (`--addon-slidev`)
133
+
134
+ Adds presentation capabilities:
135
+
136
+ ```json title="package.json" {6-7}
137
+ {
138
+ "dependencies": {
139
+ "@docusaurus/core": "3.9.2",
140
+ "@sp-days-framework/docusaurus-plugin-interactive-tasks": "^1.0.0",
141
+ "@sp-days-framework/docusaurus-frontpage-collection": "^1.0.0",
142
+ "@sp-days-framework/docusaurus-plugin-slidev": "^1.0.0",
143
+ "@sp-days-framework/slidev-theme-sykehuspartner": "^1.0.0"
144
+ }
145
+ }
146
+ ```
147
+
148
+ **Adds:**
149
+
150
+ - `/slidev` directory with example presentations
151
+ - Slidev plugin configuration
152
+ - `npm run slidev` script
153
+ - Presentation overview page
154
+
155
+ **When to use:**
156
+
157
+ - Course includes lectures or presentations
158
+ - You want slide-based content alongside documentation
159
+ - You need speaker notes and presenter mode
160
+
161
+ ### Resources Addon (`--addon-resources`)
162
+
163
+ Adds comprehensive documentation:
164
+
165
+ **Adds:**
166
+
167
+ - `/resources` directory structure
168
+ - Component usage guides
169
+ - Setup and configuration examples
170
+ - Best practices documentation
171
+
172
+ **When to use:**
173
+
174
+ - Large courses needing separate documentation
175
+ - Multiple instructors needing reference materials
176
+ - Courses with complex component usage
177
+
178
+ ### Package Documentation (`--include-package-docs`)
179
+
180
+ Adds comprehensive developer documentation:
181
+
182
+ **Adds:**
183
+
184
+ - Documentation instances for all installed plugins
185
+ - API references and developer guides
186
+ - "Plugin Docs" dropdown in navbar
187
+ - Routes like `/package-docs/interactive-tasks`
188
+
189
+ **When to use:**
190
+
191
+ - Package development and testing
192
+ - Easier access to plugin documentation
193
+ - Demoing framework capabilities
194
+
195
+ :::warning Production Considerations
196
+ Starting from version 1.1.0, all `@sp-days-framework` packages include their documentation as pre-made Docusaurus MDX files. While useful for development, this feature adds unnecessary dependencies to production builds. Consider removing it before deploying (see generated README for instructions).
197
+
198
+ **Important:** Enabling package documentation automatically installs the Slidev addon because package docs include Slidev theme documentation.
199
+ :::
@@ -0,0 +1,268 @@
1
+ ---
2
+ sidebar_position: 2
3
+ sidebar_label: "Sidebar Sections"
4
+ sidebar_custom_props:
5
+ section: "Components"
6
+ section_position: 2
7
+ ---
8
+
9
+ import Tabs from "@theme/Tabs";
10
+ import TabItem from "@theme/TabItem";
11
+
12
+ # Dynamic Sidebar Sections
13
+
14
+ Group related documentation pages under visual separators in the sidebar without creating static category structures.
15
+
16
+ ## Overview
17
+
18
+ The dynamic sidebar sections feature allows you to organize documentation by adding custom section separators that group related pages together. Pages are grouped based on a `section` property in their frontmatter, and sections appear with visual separators in the sidebar.
19
+
20
+ **Benefits:**
21
+ - Keep files in a flat structure (no nested folders required)
22
+ - Flexible grouping without static `_category_.json` files
23
+ - Multiple sections per documentation instance
24
+ - Visual separation for better navigation
25
+ - Maintains alphabetical or position-based ordering within sections
26
+
27
+ ## Setup
28
+
29
+ The `sidebarSections.js` file is included by default in projects created with `create-sp-days`. Simply configure it in your Docusaurus config:
30
+
31
+ ### Configure Docusaurus
32
+
33
+ Add the `sidebarItemsGenerator` option to your docs plugin configuration:
34
+
35
+ ```typescript title="docusaurus.config.ts"
36
+ {
37
+ plugins: [
38
+ [
39
+ "@docusaurus/plugin-content-docs",
40
+ {
41
+ id: "resources",
42
+ path: "resources",
43
+ routeBasePath: "resources",
44
+ // highlight-next-line
45
+ sidebarItemsGenerator: require('./sidebarSections'),
46
+ },
47
+ ],
48
+ ],
49
+ }
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ ### Add Section to Pages
55
+
56
+ In the frontmatter of any documentation page, add the `sidebar_custom_props.section` field:
57
+
58
+ ```mdx title="api-reference.mdx"
59
+ ---
60
+ sidebar_label: "API Reference"
61
+ sidebar_custom_props:
62
+ section: "Templates"
63
+ section_position: 2
64
+ ---
65
+
66
+ # API Reference Template
67
+
68
+ Your content here...
69
+ ```
70
+
71
+ ```mdx title="quick-start.mdx"
72
+ ---
73
+ sidebar_label: "Quick Start"
74
+ sidebar_custom_props:
75
+ section: "Getting Started"
76
+ section_position: 1
77
+ ---
78
+
79
+ # Quick Start Guide
80
+
81
+ Your content here...
82
+ ```
83
+
84
+ The `section_position` field is optional and controls the order in which sections appear. Sections without a position will be sorted alphabetically after positioned sections.
85
+
86
+ ### Add Section to Categories
87
+
88
+ You can also apply sections to entire directories (categories) using `_category_.yml` or `_category_.json` files:
89
+
90
+ <Tabs>
91
+ <TabItem value="yaml" label="YAML" default>
92
+ ```yaml title="docs/layouts/_category_.yml"
93
+ position: 3
94
+ label: "Layouts"
95
+ customProps:
96
+ section: "Components"
97
+ section_position: 2
98
+ ```
99
+ </TabItem>
100
+ <TabItem value="json" label="JSON">
101
+ ```json title="docs/templates/_category_.json"
102
+ {
103
+ "position": 2,
104
+ "label": "Templates",
105
+ "customProps": {
106
+ "section": "Reference",
107
+ "section_position": 3
108
+ }
109
+ }
110
+ ```
111
+ </TabItem>
112
+ </Tabs>
113
+
114
+ This groups the entire category under the specified section, allowing you to organize both individual pages and directories together.
115
+
116
+ ### Pages Without Sections
117
+
118
+ Pages without a `section` property will appear at the top of the sidebar in their natural order:
119
+
120
+ ```mdx title="introduction.mdx"
121
+ ---
122
+ sidebar_label: "Introduction"
123
+ sidebar_position: 1
124
+ ---
125
+
126
+ # Introduction
127
+
128
+ This page appears before any sections.
129
+ ```
130
+
131
+ ## Example Sidebar Structure
132
+
133
+ With the following pages:
134
+
135
+ - `introduction.mdx` (no section, `sidebar_position: 1`)
136
+ - `best-practices.mdx` (no section, `sidebar_position: 2`)
137
+ - `quick-start.mdx` (`section: "Getting Started"`)
138
+ - `installation.mdx` (`section: "Getting Started"`)
139
+ - `api-reference.mdx` (`section: "Templates"`)
140
+ - `cheat-sheet.mdx` (`section: "Templates"`)
141
+
142
+ The sidebar will display as:
143
+
144
+ ```
145
+ Introduction
146
+ Best Practices
147
+ ───── Getting Started ─────
148
+ Quick Start
149
+ Installation
150
+ ───── Templates ─────
151
+ API Reference
152
+ Cheat Sheet
153
+ ```
154
+
155
+ ## Multiple Sections
156
+
157
+ You can create as many sections as needed. Each unique `section` value creates a new separator:
158
+
159
+ ```mdx
160
+ sidebar_custom_props:
161
+ section: "Advanced Topics"
162
+ ```
163
+
164
+ ```mdx
165
+ sidebar_custom_props:
166
+ section: "Reference"
167
+ ```
168
+
169
+ ```mdx
170
+ sidebar_custom_props:
171
+ section: "Troubleshooting"
172
+ ```
173
+
174
+ ## Ordering
175
+
176
+ ### Within Sections
177
+
178
+ Use `sidebar_position` to control the order of pages within a section:
179
+
180
+ ```mdx
181
+ ---
182
+ sidebar_label: "Basic Usage"
183
+ sidebar_position: 1
184
+ sidebar_custom_props:
185
+ section: "Templates"
186
+ section_position: 2
187
+ ---
188
+ ```
189
+
190
+ ```mdx
191
+ ---
192
+ sidebar_label: "Advanced Usage"
193
+ sidebar_position: 2
194
+ sidebar_custom_props:
195
+ section: "Templates"
196
+ section_position: 2
197
+ ---
198
+ ```
199
+
200
+ ### Section Order
201
+
202
+ Use `section_position` to control the order in which sections appear:
203
+
204
+ - Sections with `section_position: 1` appear first
205
+ - Sections with `section_position: 2` appear second, etc.
206
+ - Sections without `section_position` are sorted alphabetically and appear last
207
+
208
+ **Important:** All pages within the same section must use the same `section_position` value (or all omit it). Mixing different `section_position` values within a section will throw a validation error.
209
+
210
+ ```mdx title="✅ Correct - Same section_position for all pages in section"
211
+ # Page 1
212
+ sidebar_custom_props:
213
+ section: "Templates"
214
+ section_position: 2
215
+
216
+ # Page 2
217
+ sidebar_custom_props:
218
+ section: "Templates"
219
+ section_position: 2
220
+ ```
221
+
222
+ ```mdx title="❌ Incorrect - Different section_position values"
223
+ # Page 1
224
+ sidebar_custom_props:
225
+ section: "Templates"
226
+ section_position: 2
227
+
228
+ # Page 2
229
+ sidebar_custom_props:
230
+ section: "Templates"
231
+ section_position: 3 # ❌ Error!
232
+ ```
233
+
234
+ :::tip
235
+ You only need to add `section_position` to one page in each section - if omitted on other pages in the same section, they'll inherit the behavior. However, adding it to all pages makes the intent clearer.
236
+ :::
237
+
238
+ :::warning Limitations
239
+ - Use only **one** `section` value per page
240
+ - All pages in a section must have the same `section_position` (or none)
241
+ :::
242
+
243
+ ## Styling Customization
244
+
245
+ The separator styling uses CSS custom properties for theming:
246
+
247
+ - `--ifm-color-emphasis-600` - Text color
248
+ - `--ifm-color-emphasis-300` - Border color
249
+
250
+ To customize the separator appearance, edit the inline styles in `sidebarSections.js`:
251
+
252
+ ```javascript title="sidebarSections.js"
253
+ value: `<div style="margin: 1rem 0 0.5rem; padding: 0.25rem 0; font-size: 0.75rem; ...">${sectionName}</div>`,
254
+ ```
255
+
256
+ You can also target the generated class names with CSS:
257
+
258
+ ```css title="custom.css"
259
+ [class*="sidebar-section-"] {
260
+ /* Custom styles for all section separators */
261
+ }
262
+
263
+ .sidebar-section-templates {
264
+ /* Styles specific to "Templates" section */
265
+ }
266
+ ```
267
+
268
+ Class names are auto-generated from section names: `"Templates"` → `sidebar-section-templates`, `"Getting Started"` → `sidebar-section-getting-started`.