{"id":26710706,"url":"https://github.com/metadoc/metadoc.js-api","last_synced_at":"2025-04-13T18:52:39.072Z","repository":{"id":48030361,"uuid":"146539857","full_name":"metadoc/metadoc.js-api","owner":"metadoc","description":"Generate a static (read-only) JSON API for browsing metadoc.","archived":false,"fork":false,"pushed_at":"2022-12-08T00:54:10.000Z","size":312,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T09:42:02.055Z","etag":null,"topics":["api","documentation","metadata","metadoc"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/metadoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["coreybutler"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-08-29T03:27:21.000Z","updated_at":"2023-03-13T06:39:49.000Z","dependencies_parsed_at":"2023-01-24T01:35:15.456Z","dependency_job_id":null,"html_url":"https://github.com/metadoc/metadoc.js-api","commit_stats":null,"previous_names":["author/metadoc-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc.js-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc.js-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc.js-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metadoc%2Fmetadoc.js-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metadoc","download_url":"https://codeload.github.com/metadoc/metadoc.js-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248765999,"owners_count":21158296,"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","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":["api","documentation","metadata","metadoc"],"created_at":"2025-03-27T09:34:18.660Z","updated_at":"2025-04-13T18:52:39.039Z","avatar_url":"https://github.com/metadoc.png","language":"JavaScript","funding_links":["https://github.com/sponsors/coreybutler"],"categories":[],"sub_categories":[],"readme":"# metadoc-api\n\nThis [metadoc](https://github.com/author/metadoc) post-processor will generate a static (read-only) JSON \"API\" for browsing metadoc data.\n\nThe output is structured in a simple folder that can be uploaded to a static web host. However; since there is **no** `index.html` file, it's important to configure your server to use `index.json` as the default file.\n\nThe file structure will always contain:\n\n```\n/path/to/your/output\n├─┬ global\n│ ├── MyClassA.json\n│ ├── MyClassB.json\n│ └── …\n├─┬ mynamespace\n│ ├── MyClassC.json\n│ ├── MyClassD.json\n│ └── …\n├── api.bus.json\n├── api.classes.json\n├── api.json\n├── api.bus.json\n├── api.namespaces.json\n└── index.json\n```\n\nAn example of the `index.json` (last file) may be:\n\n```js\n{\n  \"full_spec_href\": \"https://domain.com/4.0.0/api.json\",\n  \"bus_href\": \"https://domain.com/4.0.0/api.bus.json\",\n  \"exceptions_href\": \"https://domain.com/4.0.0/api.exceptions.json\",\n  \"class_href\": \"https://domain.com/4.0.0/api.classes.json\",\n  \"namespace_href\": \"https://domain.com/4.0.0/api.namespaces.json\"\n}\n```\n\n## Usage\n\nSimply run `metadoc-api` as a command in the metadoc chain. For example:\n\n```sh\nmetadoc --source ./src --output ./docs | metadoc-api\n```\n\nThere are two optional flags: `--root` (web root) and `--version` (API version/subfolder).\n\n```sh\nmetadoc --source ./src --output ./docs | metadoc-api --root https://domain.com/ --version 2.0.0\n```\n\nThe example above will produce links prefixed with `https://domain.com/2.0.0/`.\n\n**--version auto** can be used to automatically identify the version from a local `package.json` file. The source directory will be searched for a `package.json` file first, then the current working directory.\n\n## Testing Locally\n\nTesting your API locally can be done with any static web host. We recommend using [Fenix Web Server](https://fenixwebserver.com).\n\n![Fenix Web Server](https://github.com/author/metadoc-api/blob/master/fenix.png)\n\nFenix will support static hosting and default file modification. Oh, and it's free.\n\n## Guiding Principles\n\nThis is a read-only/static API, but it attempts to follow reasonable API guidelines. For example, subresources are all identified with a `href` or `_href` attribute, allowing API clients to traverse the entire API programmatically.\n\nThe API aims to be as simple as possible, but documentation websites are often more complex than they appear. To facilitate the simplest development flow possible, a few helper files are generated and put in the API root:\n\n### index.json\n\nThis file acts like `index.html` would in a web server, i.e. the default page served when no other is specified. It contains links to the primary resources documented in the API.\n\n### api.json\n\nThis is a failsafe file. It contains all of the output from metadoc, in case you can't get the detail you need from anywhere else. _WARNING:_ This file can be really, really big (10K+ lines). Use alternatives whenever possible.\n\n### api.bus.json\n\nRemember, metadoc was designed for [NGN](https://github.com/ngnjs/ngn), which is an object oriented programming library focused around a core event emitter. The bus is an event bus. This file contains all of the events triggered by an event bus. If you're not using NGN, this file may or may not be of use to you.\n\n### api.classes.json\n\nThis file contains a list of all available classes in the code being documented.\n\n### api.exceptions.json\n\nThis file contains all of the global/customer exceptions triggered by the code being documented.\n\n### api.namespaces.com\n\nThis file contains all of the namespaces recognized within the code being documented.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetadoc%2Fmetadoc.js-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetadoc%2Fmetadoc.js-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetadoc%2Fmetadoc.js-api/lists"}