AutoDocs
AutoDocs is a powerful documentation generation tool designed to streamline the process of creating and maintaining documentation for core sections in our projects. This tool automatically generates markdown (.md) files from specified source files, ensuring consistency and ease in documentation.
How to Use AutoDocs
AutoDocs is invoked using the pnpm autodocs:core:sections command. This command triggers a script that searches through the ./sections directory for files containing the word 'core' and generates corresponding markdown files in the ./docs/docs/merchant/sections directory.
Prerequisites
- Ensure you have pnpm installed on your system.
- The script should be run from the root directory of your project.
What AutoDocs Does
Upon execution, AutoDocs performs the following actions:
- Searches for files in the ./sections directory that include 'core' in their names.
- Skips files that contain the string "autoDocs exclude."
- For each eligible file:
- Checks if a corresponding .md file exists in ./docs/docs/merchant/sections.
- If it doesn’t exist, the script creates it with the following characteristics:
- The title is derived from the original file name, with 'core-' removed, hyphens replaced with spaces, and each word capitalized.
- Adds a header with sidebar_position: 1.
- Includes a placeholder ## TODO: Add content for future documentation.