{"id":30864977,"url":"https://github.com/ioncakephper/sidebar-navigation-model","last_synced_at":"2025-09-07T20:19:20.890Z","repository":{"id":304954448,"uuid":"1020333136","full_name":"ioncakephper/sidebar-navigation-model","owner":"ioncakephper","description":"A modular and extensible JSON Schema for defining hierarchical sidebar navigation structures in content platforms, documentation tools, and UI frameworks.","archived":false,"fork":false,"pushed_at":"2025-07-17T08:54:42.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T11:54:20.425Z","etag":null,"topics":["configuration","data-model","documentation-tool","front-end","json","json-sch","metadata","navigation","nested-navigation","reusable","sidebar","web-development"],"latest_commit_sha":null,"homepage":"https://ioncakephper.github.io/sidebar-navigation-model/","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/ioncakephper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-15T17:45:36.000Z","updated_at":"2025-07-17T08:33:20.000Z","dependencies_parsed_at":"2025-07-17T16:15:01.993Z","dependency_job_id":"be845a55-0064-495d-b604-b382733b2a63","html_url":"https://github.com/ioncakephper/sidebar-navigation-model","commit_stats":null,"previous_names":["ioncakephper/sidebar-navigation-model"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ioncakephper/sidebar-navigation-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fsidebar-navigation-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fsidebar-navigation-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fsidebar-navigation-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fsidebar-navigation-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioncakephper","download_url":"https://codeload.github.com/ioncakephper/sidebar-navigation-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fsidebar-navigation-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274088658,"owners_count":25220264,"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-09-07T02:00:09.463Z","response_time":67,"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":["configuration","data-model","documentation-tool","front-end","json","json-sch","metadata","navigation","nested-navigation","reusable","sidebar","web-development"],"created_at":"2025-09-07T20:19:18.828Z","updated_at":"2025-09-07T20:19:20.874Z","avatar_url":"https://github.com/ioncakephper.png","language":null,"readme":"# Sidebar Navigation Model\n\nA modular and extensible JSON Schema for defining hierarchical sidebar navigation structures in content platforms, documentation tools, and UI frameworks.\n\n\u003e Ideal for static site generators, developer portals, CMS integrations, or schema-driven UIs.\n\n## 📘 Overview\n\nThis repository contains a versioned specification for sidebar layout models. Built with composability and clarity in mind, the schema supports:\n\n- 🔹 Flat and nested sidebar items\n- 🔸 Categories and topics with structured children\n- 🧭 Headings and hierarchical depth\n- 🔗 Link items with URI validation\n- ✅ Rich validation through JSON Schema\n\nWhether you’re building a static site generator, documentation renderer, or a dynamic navigation engine—this model is adaptable to your workflow.\n\n---\n\n## 📁 Repository Structure\n\n```\n.\n├── README.md\n├── CHANGELOG.md\n├── package.json\n├── docs/\n│   ├── definitions.md\n│   ├── integrations-guide.md\n│   └── overview.md\n├── schema/\n│   ├── v1.0.0/\n│   │   ├── sidebar.schema.json\n│   │   └── samples/\n│   │       └── example.yaml\n│   └── latest/\n│       ├── sidebar.schema.json\n│       └── samples/\n│           └── example.yaml\n├── scripts/\n│   ├── yamlToMarkdown.js\n│   └── markdownToYaml.js\n```\n\n- `latest/` is a pointer to the most recent version of the schema for easy integration. Update it manually on each release, or use a script/symlink strategy.\n\n---\n\n## 📘 Features\n\n- Recursive sidebar modeling\n- Component inheritance via `$defs` and `allOf`\n- Regex-validated metadata: `id` (filename-like), `slug`, and flexible `path`\n- Deeply nested headings and categories\n- Ready for version tracking and changelog support\n\n---\n\n## 🛠️ Conversion Scripts\n\n### `yamlToMarkdown.js`\n\n**Description:**  \nConverts sidebar YAML files (matching the schema) into readable, structured Markdown navigation lists.  \nSupports preservation of YAML comments (before each sidebar entry) as Markdown paragraphs, and includes metadata such as the YAML filename and timestamp as Markdown comments.\n\n**Features:**\n\n- Converts all sidebar structure, including nested items, headings, and tags, into Markdown.\n- Scalar properties (string, number, boolean) are rendered as `_property_: value`.\n- Tags arrays are rendered as Markdown sub-lists.\n- YAML comments before each sidebar entry are rendered as Markdown paragraphs after the heading.\n- Prepends Markdown comments for the YAML filename and timestamp.\n\n**Usage Example:**\n\n```js\nconst fs = require('fs');\nconst { parseYamlWithSidebarComments, convertDataToMarkdown } = require('./scripts/yamlToMarkdown');\n\nconst yamlContent = fs.readFileSync('sidebars.yaml', 'utf8');\nconst data = parseYamlWithSidebarComments(yamlContent);\n\nconvertDataToMarkdown(data, { yamlFilePath: 'sidebars.yaml' }).then(markdown =\u003e {\n  fs.writeFileSync('sidebars.md', markdown);\n});\n```\n\n---\n\n### `markdownToYaml.js`\n\n**Description:**  \nConverts Markdown navigation lists (as generated by `yamlToMarkdown.js`) back into YAML, reconstructing the sidebar structure and restoring comments as YAML comments.\n\n**Features:**\n\n- Parses Markdown headings, paragraphs, and lists to reconstruct the sidebar data structure.\n- Converts Markdown paragraphs between headings and the first list item into YAML comments.\n- Scalar properties and tags are faithfully restored.\n- Prepends YAML comments for the Markdown filename and timestamp.\n\n**Usage Example:**\n\n```js\nconst fs = require('fs');\nconst { convertMarkdownToYaml } = require('./scripts/markdownToYaml');\n\nconst markdownContent = fs.readFileSync('sidebars.md', 'utf8');\nconst yaml = convertMarkdownToYaml(markdownContent, { markdownFilePath: 'sidebars.md' });\nfs.writeFileSync('sidebars.generated.yaml', yaml);\n```\n\n---\n\n### 🧩 Dependencies\n\nBoth scripts require the following libraries (see `package.json`):\n\n- [`js-yaml`](https://www.npmjs.com/package/js-yaml)\n- [`yaml`](https://www.npmjs.com/package/yaml)\n- [`prettier`](https://www.npmjs.com/package/prettier) (with plugins: `prettier/plugins/estree`, `prettier/plugins/yaml`, `prettier/plugins/markdown`)\n\nInstall all dependencies with:\n\n```bash\nnpm install\n```\n\n---\n\n## 🚀 Usage\n\nClone the repo:\n\n```bash\ngit clone https://github.com/your-username/sidebar-navigation-model.git\n```\n\n---\n\n## 📚 Documentation\n\nExplore:\n\n- [`overview.md`](./docs/overview.md): High-level schema purpose and structure\n- [`definitions.md`](./docs/definitions.md): Breakdown of reusable components\n- [`integrations-guide.md`](./docs/integrations-guide.md): How to integrate with static site generators or client apps\n\n---\n\n## 📌 Versioning\n\nWe follow [Semantic Versioning](https://semver.org/) for schema releases. Refer to the [CHANGELOG.md](CHANGELOG.md) for a history of changes.\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! See our [contributing guide](CONTRIBUTING.md) to get started.\n\n---\n\n## 📬 Questions or Feedback?\n\nHave a question or feedback? Please use one of the following channels:\n\n- **[GitHub Issues](https://github.com/ioncakephper/sidebar-navigation-model/issues):** For bug reports and feature requests.\n- **[GitHub Discussions](https://github.com/ioncakephper/sidebar-navigation-model/discussions):** For questions, ideas, and general feedback.\n\n---\n\n## 📄 License\n\nReleased under the [MIT License](LICENSE). Use it freely in commercial and open-source projects.\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioncakephper%2Fsidebar-navigation-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fioncakephper%2Fsidebar-navigation-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioncakephper%2Fsidebar-navigation-model/lists"}