{"id":29945272,"url":"https://github.com/fsegurai/manifest-generator","last_synced_at":"2026-05-09T05:05:23.487Z","repository":{"id":305984014,"uuid":"1024564620","full_name":"fsegurai/manifest-generator","owner":"fsegurai","description":"Manifest Generator is a tool to generate manifest files and search indexes based on a given documentation structure.","archived":false,"fork":false,"pushed_at":"2025-07-23T03:05:30.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-23T03:07:20.849Z","etag":null,"topics":["cli","docs","documentation","generator","javascript","javascript-library","manifest","markdown","search-index","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fsegurai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-22T22:57:13.000Z","updated_at":"2025-07-23T03:05:33.000Z","dependencies_parsed_at":"2025-07-23T03:07:24.609Z","dependency_job_id":"ec22f8be-17c7-4ab7-bca5-1081fb6dce52","html_url":"https://github.com/fsegurai/manifest-generator","commit_stats":null,"previous_names":["fsegurai/manifest-generator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/fsegurai/manifest-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsegurai%2Fmanifest-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsegurai%2Fmanifest-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsegurai%2Fmanifest-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsegurai%2Fmanifest-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsegurai","download_url":"https://codeload.github.com/fsegurai/manifest-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsegurai%2Fmanifest-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268496093,"owners_count":24259410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","docs","documentation","generator","javascript","javascript-library","manifest","markdown","search-index","typescript","typescript-library"],"created_at":"2025-08-03T05:01:15.602Z","updated_at":"2026-05-09T05:05:23.481Z","avatar_url":"https://github.com/fsegurai.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" class=\"intro\"\u003e\r\n  \u003cimg alt=\"Manifest Generator Logo\" src=\"https://raw.githubusercontent.com/fsegurai/manifest-generator/main/public/manifest-generator.svg\"\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\" class=\"intro\"\u003e\r\n  \u003ca href=\"https://github.com/fsegurai/manifest-generator\"\u003e\r\n      \u003cimg src=\"https://img.shields.io/azure-devops/build/fsegurai/06cb8729-d71a-43f5-a4b8-f387da813f19/27/main?label=Build%20Status\u0026\"\r\n          alt=\"Build Main Status\"\u003e\r\n  \u003c/a\u003e\r\n  \u003ca href=\"https://github.com/fsegurai/manifest-generator/releases/latest\"\u003e\r\n      \u003cimg src=\"https://img.shields.io/github/v/release/fsegurai/manifest-generator\"\r\n          alt=\"Latest Release\"\u003e\r\n  \u003c/a\u003e\r\n  \u003cbr\u003e\r\n  \u003cimg alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/fsegurai/manifest-generator\"\u003e\r\n  \u003cimg alt=\"Dependency status for repo\" src=\"https://img.shields.io/librariesio/github/fsegurai/manifest-generator\"\u003e\r\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\r\n    \u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/fsegurai/manifest-generator\"\u003e\r\n  \u003c/a\u003e\r\n  \u003cbr\u003e\r\n  \u003cimg alt=\"Stars\" src=\"https://img.shields.io/github/stars/fsegurai/manifest-generator?style=square\u0026labelColor=343b41\"/\u003e\r\n  \u003cimg alt=\"Forks\" src=\"https://img.shields.io/github/forks/fsegurai/manifest-generator?style=square\u0026labelColor=343b41\"/\u003e\r\n\u003c/p\u003e\r\n\r\n# @fsegurai/manifest-generator\r\n\r\n**A library and CLI tool for generating documentation manifests and search indexes from Markdown files.**\r\n\r\nA powerful and flexible documentation manifest generator that automatically creates\r\nnavigation structures and search indexes for your Markdown documentation.\r\n\r\n### 📋 Table of Contents\r\n\r\n- [🚀 Features](#-features)\r\n- [📦 Installation](#-installation)\r\n- [🖥️ CLI Usage](#️-cli-usage)\r\n    - [Global Installation](#global-installation)\r\n    - [Using npx (Recommended)](#using-npx-recommended)\r\n    - [CLI Commands](#cli-commands)\r\n    - [Production Examples](#production-examples)\r\n- [📚 API Usage](#-api-usage)\r\n    - [ES Modules](#es-modules)\r\n    - [CommonJS](#commonjs)\r\n    - [API Reference](#api-reference)\r\n- [📁 Project Structure Detection](#-project-structure-detection)\r\n- [📄 Output Files](#-output-files)\r\n- [⚙️ Configuration](#️-configuration)\r\n- [🔧 Integration Examples](#-integration-examples)\r\n- [📝 Frontmatter Support](#-frontmatter-support)\r\n- [🤝 Contributing](#-contributing)\r\n- [📄 License](#-license)\r\n\r\n---\r\n\r\n## 🚀 Features\r\n\r\n- **Automatic Discovery**: Intelligently finds documentation projects in various folder structures\r\n- **Flexible Input**: Supports both direct markdown files and docs subfolders\r\n- **CLI \u0026 API**: Use via command line or programmatically in your code\r\n- **Frontmatter Parsing**: Extracts metadata from YAML frontmatter\r\n- **Search Index Generation**: Creates searchable indexes for your documentation\r\n- **TypeScript Support**: Full TypeScript definitions included\r\n- **Cross-Platform**: Works on Windows, macOS, and Linux\r\n- **Multiple Output Formats**: Generates both navigation manifests and search indexes\r\n\r\n## 📦 Installation\r\n\r\n### Global Installation\r\n\r\n```bash\r\nnpm install -g @fsegurai/manifest-generator\r\n```\r\n\r\n### Project Dependency\r\n\r\n```bash\r\n# As a dev dependency\r\nnpm install --save-dev @fsegurai/manifest-generator\r\n\r\n# As a regular dependency\r\nnpm install @fsegurai/manifest-generator\r\n```\r\n\r\n## 🖥️ CLI Usage\r\n\r\n### Using npx (Recommended)\r\n\r\nNo installation required—run directly:\r\n\r\n```bash\r\n# Process all projects in current directory\r\nnpx @fsegurai/manifest-generator --all\r\n\r\n# Process specific project\r\nnpx @fsegurai/manifest-generator --project my-docs\r\n\r\n# Get help\r\nnpx @fsegurai/manifest-generator --help\r\n```\r\n\r\n### Global Installation\r\n\r\nIf installed globally, use the `manifest-generator` command:\r\n\r\n```bash\r\nmanifest-generator --all\r\nmanifest-generator --project my-docs\r\n```\r\n\r\n### CLI Commands\r\n\r\n#### Basic Usage\r\n\r\n```bash\r\n# Process all projects automatically\r\nnpx @fsegurai/manifest-generator --all\r\n\r\n# Process a specific project by name\r\nnpx @fsegurai/manifest-generator --project sample-project\r\n\r\n# Process a specific documentation path\r\nnpx @fsegurai/manifest-generator --route ./docs\r\n\r\n# Discover projects without processing\r\nnpx @fsegurai/manifest-generator --discover\r\n```\r\n\r\n#### Advanced Options\r\n\r\n```bash\r\n# Specify custom docs root directory\r\nnpx @fsegurai/manifest-generator --all --docs-root ./my-projects\r\n\r\n# Custom output directory\r\nnpx @fsegurai/manifest-generator --route ./docs --output ./dist\r\n\r\n# Custom docs subfolder name (default: 'docs')\r\nnpx @fsegurai/manifest-generator --all --docs-subfolder documentation\r\n\r\n# Process positional path argument\r\nnpx @fsegurai/manifest-generator ./path/to/documentation\r\n```\r\n\r\n#### Help and Information\r\n\r\n```bash\r\n# Show help\r\nnpx @fsegurai/manifest-generator --help\r\n\r\n# Show version\r\nnpx @fsegurai/manifest-generator --version\r\n```\r\n\r\n### Production Examples\r\n\r\n#### CI/CD Pipeline (GitHub Actions)\r\n\r\n```yaml\r\n-   name: Generate Documentation Manifests\r\n    run: npx @fsegurai/manifest-generator --all --docs-root ./projects\r\n```\r\n\r\n#### Monorepo Processing\r\n\r\n```bash\r\n# Process all packages in a monorepo\r\nnpx @fsegurai/manifest-generator --all --docs-root ./packages\r\n\r\n# Process specific package\r\nnpx @fsegurai/manifest-generator --project my-package --docs-root ./packages\r\n```\r\n\r\n#### Build Pipeline Integration\r\n\r\n```bash\r\n# Generate manifests for built documentation\r\nnpx @fsegurai/manifest-generator --route ./dist/docs --output ./public\r\n```\r\n\r\n#### Package.json Scripts\r\n\r\n```json\r\n{\r\n    \"scripts\": {\r\n        \"build:docs\": \"manifest-generator --all\",\r\n        \"docs:manifest\": \"manifest-generator --route ./documentation\",\r\n        \"docs:discover\": \"manifest-generator --discover\"\r\n    }\r\n}\r\n```\r\n\r\n## 📚 API Usage\r\n\r\n### ES Modules\r\n\r\n```javascript\r\nimport {\r\n    generateManifest,\r\n    generateDocsManifests,\r\n    generateManifestsWithDiscovery,\r\n    discoverProjects\r\n} from '@fsegurai/manifest-generator';\r\n\r\n// Generate manifest for a single project\r\nconst result = generateManifest('./docs');\r\nconsole.log('Generated:', result.manifest);\r\nconsole.log('Search Index:', result.searchIndex);\r\n\r\n// Process all projects with auto-discovery\r\nconst results = generateManifestsWithDiscovery('./projects', {\r\n    autoDetect: true,\r\n    docsSubfolder: 'docs'\r\n});\r\n\r\n// Discover projects without processing\r\nconst projects = discoverProjects('./projects');\r\nconsole.log('Found projects:', projects);\r\n```\r\n\r\n### CommonJS\r\n\r\n```javascript\r\nconst {\r\n    generateManifest,\r\n    generateManifestsWithDiscovery\r\n} = require('@fsegurai/manifest-generator');\r\n\r\n// Process specific project\r\ngenerateManifestsWithDiscovery('./projects', {\r\n    project: 'my-app',\r\n    outputDir: './dist'\r\n});\r\n```\r\n\r\n### API Reference\r\n\r\n#### Core Functions\r\n\r\n##### `generateManifest(projectPath: string): ManifestResult`\r\n\r\nGenerates a manifest for a single documentation project.\r\n\r\n```javascript\r\nconst result = generateManifest('./my-docs');\r\n// Returns: { manifest: NavigationItem[], searchIndex: SearchEntry[] }\r\n```\r\n\r\n##### `generateDocsManifests(docsRoot: string): void`\r\n\r\nProcesses all subdirectories as separate projects.\r\n\r\n```javascript\r\ngenerateDocsManifests('./projects');\r\n// Generates manifest.json and search-index.json in each subdirectory\r\n```\r\n\r\n##### `generateManifestsWithDiscovery(rootDir: string, options?: GenerationOptions): ProcessingResult[]`\r\n\r\nAdvanced function with flexible options and auto-discovery.\r\n\r\n```javascript\r\nconst results = generateManifestsWithDiscovery('./projects', {\r\n    project: 'specific-project',     // Process specific project\r\n    route: './custom/path',          // Process specific path\r\n    outputDir: './output',           // Custom output directory\r\n    docsSubfolder: 'documentation',  // Custom docs folder name\r\n    autoDetect: true                 // Auto-discover projects\r\n});\r\n```\r\n\r\n##### `discoverProjects(rootDir: string, options?: DiscoveryOptions): DiscoveredProject[]`\r\n\r\nDiscovers documentation projects without processing them.\r\n\r\n```javascript\r\nconst projects = discoverProjects('./projects', {\r\n    docsSubfolder: 'docs',  // Folder name to look for\r\n    pattern: null           // Future: regex pattern support\r\n});\r\n```\r\n\r\n#### Utility Functions\r\n\r\n##### `formatTitle(name: string): string`\r\n\r\nConverts filenames to readable titles.\r\n\r\n```javascript\r\nformatTitle('getting-started-guide.md'); // \"Getting Started Guide\"\r\n```\r\n\r\n##### `parseFrontmatter(content: string): Record\u003cstring, any\u003e`\r\n\r\nExtracts YAML frontmatter from Markdown content.\r\n\r\n```javascript\r\nconst frontmatter = parseFrontmatter(`---\r\nlabel: My Document\r\ntags: [\"guide\", \"tutorial\"]\r\n---\r\n# Content here`);\r\n// Returns: { label: \"My Document\", tags: [\"guide\", \"tutorial\"] }\r\n```\r\n\r\n#### TypeScript Interfaces\r\n\r\n```typescript\r\ninterface NavigationItem {\r\n    label: string;\r\n    path?: string;\r\n    tags?: string[];\r\n    children?: NavigationItem[];\r\n}\r\n\r\ninterface SearchEntry {\r\n    label: string;\r\n    path: string;\r\n    tags?: string[];\r\n}\r\n\r\ninterface ManifestResult {\r\n    manifest: NavigationItem[];\r\n    searchIndex: SearchEntry[];\r\n}\r\n\r\ninterface DiscoveredProject {\r\n    name: string;\r\n    projectPath: string;\r\n    docsPath: string;\r\n    type: 'subfolder' | 'direct';\r\n}\r\n\r\ninterface GenerationOptions {\r\n    project?: string | null;\r\n    route?: string | null;\r\n    outputDir?: string | null;\r\n    docsSubfolder?: string;\r\n    autoDetect?: boolean;\r\n}\r\n```\r\n\r\n## 📁 Project Structure Detection\r\n\r\nThe generator automatically detects different documentation structures:\r\n\r\n### Structure 1: Docs Subfolders\r\n\r\n```\r\nprojects/\r\n├── project-a/\r\n│   ├── docs/           ← Documentation here\r\n│   │   ├── README.md\r\n│   │   ├── guide.md\r\n│   │   └── api/\r\n│   ├── manifest.json   ← Generated here\r\n│   └── search-index.json\r\n└── project-b/\r\n    └── docs/\r\n        └── *.md files\r\n```\r\n\r\n### Structure 2: Direct Markdown Files\r\n\r\n```\r\nprojects/\r\n├── project-a/\r\n│   ├── README.md       ← Documentation here\r\n│   ├── guide.md\r\n│   ├── manifest.json   ← Generated here\r\n│   └── search-index.json\r\n└── project-b/\r\n    └── *.md files\r\n```\r\n\r\n### Structure 3: Custom Documentation Folders\r\n\r\n```\r\nprojects/\r\n├── project-a/\r\n│   ├── documentation/  ← Custom folder name\r\n│   │   └── *.md files\r\n│   ├── manifest.json\r\n│   └── search-index.json\r\n```\r\n\r\n## 📄 Output Files\r\n\r\n### manifest.json\r\n\r\nContains the hierarchical navigation structure:\r\n\r\n```json\r\n[\r\n    {\r\n        \"title\": \"Getting Started\",\r\n        \"path\": \"getting-started\",\r\n        \"tags\": [\r\n            \"tutorial\",\r\n            \"beginner\"\r\n        ]\r\n    },\r\n    {\r\n        \"title\": \"API Reference\",\r\n        \"children\": [\r\n            {\r\n                \"title\": \"Authentication\",\r\n                \"path\": \"api/auth\",\r\n                \"tags\": [\r\n                    \"api\",\r\n                    \"security\"\r\n                ]\r\n            }\r\n        ]\r\n    }\r\n]\r\n```\r\n\r\n### search-index.json\r\n\r\nContains flattened search data:\r\n\r\n```json\r\n[\r\n    {\r\n        \"title\": \"Getting Started\",\r\n        \"path\": \"getting-started\",\r\n        \"tags\": [\r\n            \"tutorial\",\r\n            \"beginner\"\r\n        ]\r\n    },\r\n    {\r\n        \"title\": \"Authentication\",\r\n        \"path\": \"api/auth\",\r\n        \"tags\": [\r\n            \"api\",\r\n            \"security\"\r\n        ]\r\n    }\r\n]\r\n```\r\n\r\n## ⚙️ Configuration\r\n\r\n### Frontmatter Options\r\n\r\nControl document processing with frontmatter:\r\n\r\n```markdown\r\n---\r\nlabel: \"Custom Title\"           # Override generated title\r\ntags: [\"api\", \"reference\"]     # Add searchable tags\r\ndraft: true                    # Exclude from manifest\r\nhidden: true                   # Hide from navigation\r\n---\r\n\r\n# Your content here\r\n```\r\n\r\n### CLI Options Reference\r\n\r\n| Option                    | Short | Description                      | Default           |\r\n|---------------------------|-------|----------------------------------|-------------------|\r\n| `--all`                   | `-a`  | Process all projects             | `false`           |\r\n| `--project \u003cname\u003e`        | `-p`  | Process specific project         | `null`            |\r\n| `--route \u003cpath\u003e`          | `-r`  | Process specific path            | `null`            |\r\n| `--docs-root \u003cpath\u003e`      | `-d`  | Root directory for docs          | Current directory |\r\n| `--output \u003cpath\u003e`         | `-o`  | Output directory                 | Project directory |\r\n| `--docs-subfolder \u003cname\u003e` | `-s`  | Docs folder name                 | `'docs'`          |\r\n| `--discover`              |       | List projects without processing | `false`           |\r\n| `--help`                  | `-h`  | Show help                        |                   |\r\n| `--version`               | `-v`  | Show version                     |                   |\r\n\r\n## 🔧 Integration Examples\r\n\r\n### Webpack Integration\r\n\r\n```javascript\r\n// webpack.config.js\r\nconst {generateManifest} = require('@fsegurai/manifest-generator');\r\n\r\nmodule.exports = {\r\n    // ...existing config\r\n    plugins: [\r\n        {\r\n            apply: (compiler) =\u003e {\r\n                compiler.hooks.afterEmit.tap('ManifestGenerator', () =\u003e {\r\n                    generateManifest('./src/docs');\r\n                });\r\n            }\r\n        }\r\n    ]\r\n};\r\n```\r\n\r\n### Gulp Integration\r\n\r\n```javascript\r\n// gulpfile.js\r\nconst {generateManifestsWithDiscovery} = require('@fsegurai/manifest-generator');\r\n\r\ngulp.task('docs:manifest', () =\u003e {\r\n    return generateManifestsWithDiscovery('./src/projects', {\r\n        autoDetect: true,\r\n        outputDir: './dist'\r\n    });\r\n});\r\n```\r\n\r\n### Node.js Script\r\n\r\n```javascript\r\n#!/usr/bin/env node\r\nimport {generateManifestsWithDiscovery} from '@fsegurai/manifest-generator';\r\n\r\nasync function buildDocs() {\r\n    try {\r\n        const results = generateManifestsWithDiscovery(process.cwd(), {\r\n            autoDetect: true\r\n        });\r\n\r\n        console.log(`✅ Processed ${results.length} projects`);\r\n    } catch (error) {\r\n        console.error('❌ Error:', error.message);\r\n        process.exit(1);\r\n    }\r\n}\r\n\r\nbuildDocs();\r\n```\r\n\r\n## 📝 Frontmatter Support\r\n\r\nSupported frontmatter fields:\r\n\r\n```yaml\r\n---\r\nlabel: \"Document Title\"        # Custom title (overrides filename)\r\ntags: [ \"api\", \"guide\" ]        # Searchable tags\r\ndraft: true                   # Exclude from processing\r\nhidden: true                  # Hide from navigation\r\nweight: 10                    # Future: custom ordering\r\ndescription: \"Brief summary\"   # Future: meta description\r\n---\r\n```\r\n\r\n## 🤝 Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to\r\ndiscuss what you would like to change.\r\n\r\nFor more information, check out the [Contributing Guide](CONTRIBUTING.md).\r\n\r\n## 🧼 License\r\n\r\nLicensed under [MIT](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsegurai%2Fmanifest-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsegurai%2Fmanifest-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsegurai%2Fmanifest-generator/lists"}