Docusaurus file naming, syntax, and structure conventions for RoboLearn platform
Think like a Docusaurus expert who ensures all content builds successfully on the first attempt. You understand the quirks of MDX parsing, file naming conventions, and how Docusaurus resolves document IDs.
Before creating or modifying any Docusaurus content, ask yourself:
Q: What file extension should I use?
.md (NOT .mdx).mdx causes unnecessary complexityQ: What should chapter/module index files be named?
README.md (NOT index.md)README.md as the index; index.md can cause duplicate ID errorsQ: What naming pattern for lesson files?
NN-descriptive-name.md (e.g., 01-digital-to-physical.md)Q: Does my content contain < characters outside of code blocks?
<2 seconds ā less than 2 seconds<10 hours ā under 10 hours[<10 hrs ā [under 10 hrs< as JSX tag start, causing build errorsQ: Am I using comparison operators in prose?
latency < 100ms ā latency under 100ms or use inline code: latency < 100msif (x < 5) in code block is fine (code blocks are not parsed as MDX)A: NO - Mermaid plugin is not configured
Alternatives:
Example replacement:
# Instead of mermaid:
```mermaid
graph TD
A --> B
A ā B ā C
āāā D
.md extension[Next](./02-next-lesson.md)[Overview](../chapter-2-topic/README.md)[Module](../README.md).mdx extension or index.mdBefore committing any content, verify it builds.
npm run build 2>&1 | tail -30
Expected: [SUCCESS] Generated static files in "build"
If errors:
id frontmatter)Module structure:
docs/module-N-name/
āāā README.md # Module overview (NOT index.md)
āāā chapter-1-topic/
ā āāā README.md # Chapter overview
ā āāā 01-first-lesson.md
ā āāā 02-second-lesson.md
ā āāā ...
āāā chapter-2-topic/
ā āāā ...
āāā ...
Every lesson must have unique id:
---
id: lesson-1-1-digital-to-physical # Unique across entire docs folder
title: "Lesson 1.1: From ChatGPT to Walking Robots"
---
ID pattern: lesson-{chapter}-{lesson}-{slug}
lesson-1-1-digital-to-physicallesson-3-2-turtlesim-actioncustom-messages (for standalone topics)Avoid these patterns in prose (outside code blocks):
| Pattern | Problem | Solution |
|---|---|---|
<N |
JSX parsing | less than N, under N |
>N |
JSX parsing | more than N, over N |
{var} |
JSX interpolation | Use code: `{var}` |
<Component> |
JSX component | Use code or escape |
Safe in code blocks:
if x < 5: # This is fine - inside code block
pass
.md (not .mdx)README.md (not index.md)id in frontmatter< or > in prose outside code blocks.md extensionREADME.md not index.mdnpm run buildError: The docs plugin found docs sharing the same id
Solution:
id in frontmatter to be uniqueUnexpected character 'N' (U+004E) before name
Solution:
< character in proseless than, under)Solution:
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2025-11-29 | Initial skill from Module 1 lessons learned |