import - Import Legacy Documents
Import legacy Markdown or MDX content into an Anydocs project.
`import` stages legacy source content but does not turn it into canonical pages yet. The standard path is: import first, then run `convert-import` with the resulting importId.
Steps
- Stage the legacy directory
- Inspect the staged output
- Continue with convert-import
- Clean up in Studio or MCP before publishing
Stage the legacy directory
`import` reads `.md` and `.mdx` files from the source directory and writes the staged result into `imports/<importId>/` in the target project.
npx @anydocs/cli import ./legacy-docs ./my-docs-project zhInspect the staged output
After the import completes, inspect `imports/<importId>/manifest.json` and `items/*.json` to confirm the language, item count, and basic inferred fields.
Continue with convert-import
Once you have the `importId`, convert that batch into canonical draft pages and a navigation section.
npx @anydocs/cli convert-import <importId> ./my-docs-projectClean up in Studio or MCP before publishing
Converted output starts as `draft`. Fill metadata, refine navigation and body content, then publish only the pages that should ship.