Official documentation for wp-lemon - your go-to WordPress theme framework for creating good looking and lean websites.
This repository contains the documentation for wp-lemon, built with Docusaurus. The documentation covers everything from setup and basic usage to advanced topics like custom blocks, hooks, and extending functionality.
View the live documentation: https://studio-lemon.github.io/wp-lemon-docs/
- Node.js 18.0 or higher
- npm or yarn
npm installStart the development server:
npm startThis will start a local development server at http://localhost:3000 with live reloading.
Build the static site:
npm run buildThe static files will be generated in the build directory.
Preview the built site locally:
npm run serveWe welcome contributions to improve the documentation! This section explains how to write and structure documentation for wp-lemon.
Documentation files are organized in the docs/ directory:
docs/
├── index.mdx # Homepage
├── requirements.mdx # System requirements
├── setup.mdx # Setup guide
├── getting-started.mdx # Getting started guide
├── basics/ # Basic concepts
├── blocks/ # Block development
├── working-with-posts/ # Post types and taxonomies
├── extend/ # Extending functionality
├── reference/ # API reference (auto-generated)
└── migrations/ # Migration guides
- Create a new file: Add a
.mdxfile in the appropriate directory - Add frontmatter: Include title and optional description
---
title: "Your Page Title"
description: Optional description for SEO
---
# Your Content Here
Write your documentation using Markdown/MDX syntax.- Update sidebar: Add your new page to
sidebars.ts
{
type: 'category',
label: 'Your Category',
items: [
'path/to/your-file',
],
}Some documentation is automatically generated from the wp-lemon codebase and synced to this repository. These files should not be edited manually as they will be overwritten.
The sync-helper-functions.js script synchronizes generated markdown files from the generated/ directory into the docs/reference/ directory. This ensures that API documentation is always up-to-date.
How it works:
- Generated markdown files are created by tools in the main wp-lemon repository
- These files are placed in the
generated/directory - The sync script reads these files and copies them to
docs/reference/ - The script applies formatting fixes and adds proper frontmatter
- The resulting
.mdxfiles are ready for Docusaurus
Running the sync script:
npm run sync-docsThe sync script runs automatically during the build process (via prebuild script).
Files managed by sync script:
- API Functions:
generated/helper-functions.md→docs/reference/helper-functions.mdx - Query Functions:
generated/query-functions.md→docs/reference/query-functions.mdx - JavaScript Functions:
generated/javascript.md→docs/reference/javascript-functions.mdx - Hooks:
generated/hooks/*.md→docs/reference/hooks/*.mdx - Classes:
generated/reference/*.md→docs/reference/classes/*.mdx - Twig:
generated/twig-*.md→docs/reference/twig-*.mdx
See SYNC-DOCS.md for more details about the sync process.
- Use clear, concise language
- Include code examples where appropriate
- Use proper Markdown formatting
- Add links to related documentation
- Use admonitions for important notes:
:::tip
Helpful tip here
:::
:::warning
Warning message here
:::
:::danger
Critical warning here
:::- Docusaurus - Documentation framework
- React - UI framework
- MDX - Markdown with JSX support
- Prism - Syntax highlighting
MIT License - see LICENSE file for details
Built with ❤️ by Studio Lemon