{"id":13510068,"url":"https://github.com/sourcey/spectacle","last_synced_at":"2025-05-14T18:06:30.378Z","repository":{"id":4916086,"uuid":"49493043","full_name":"sourcey/spectacle","owner":"sourcey","description":"Beautiful static documentation generator for OpenAPI/Swagger 2.0","archived":false,"fork":false,"pushed_at":"2024-04-30T08:21:11.000Z","size":2316,"stargazers_count":1276,"open_issues_count":41,"forks_count":336,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-13T22:35:40.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sourcey.com/spectacle","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcey.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2016-01-12T10:36:11.000Z","updated_at":"2025-01-23T23:56:56.000Z","dependencies_parsed_at":"2024-06-18T15:20:31.972Z","dependency_job_id":"884c288f-b9a9-4f42-a8f6-4c423ab5e65c","html_url":"https://github.com/sourcey/spectacle","commit_stats":{"total_commits":214,"total_committers":42,"mean_commits":5.095238095238095,"dds":0.6448598130841121,"last_synced_commit":"3257da500b8a2483b6ad3356e50fe00b65bb6a6f"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fspectacle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fspectacle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fspectacle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fspectacle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcey","download_url":"https://codeload.github.com/sourcey/spectacle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254162197,"owners_count":22024934,"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":[],"created_at":"2024-08-01T02:01:22.901Z","updated_at":"2025-05-14T18:06:25.371Z","avatar_url":"https://github.com/sourcey.png","language":"HTML","funding_links":[],"categories":["HTML","Docs generator","others"],"sub_categories":[],"readme":"# Spectacle\n\n\u003e The gentleman at REST\n\n[![CircleCI](https://circleci.com/gh/sourcey/spectacle.svg?style=svg)](https://circleci.com/gh/sourcey/spectacle)\n\nSpectacle generates beautiful static HTML5 documentation from [OpenAPI](https://openapis.org)/[Swagger](http://swagger.io) 2.0 API specifications.\n\nThe goal of Spectacle is help you \"save time and look good\" by providing an extensible platform for auto generating your REST API docs. The default layout is a three column single page, similar to those\nemployed by [Stripe](https://stripe.com/docs/api) and [Intercom](https://developers.intercom.com/reference).\n\nSee a demo of Spectacle in action here: [http://cheesestore.github.io](http://cheesestore.github.io)\n\n---\n\n![Demo Screenshot](screenshot.jpg)\n\n---\n\n## Features\n\n* **OpenAPI/Swagger 2.0 support**: Support for the latest OpenAPI/Swagger specification.\n* **Highly configurable**: Easily configurable Handlebars templates and SCSS styles so you can add your own design and flavour without going bald. See [Custom Builds](#custom-builds)\n* **Markdown support**: Render markdown written in any of your API descriptions.\n* **Remote file references**: Support for swagger specs split across multiple files.\n* **Clean responsive design**: Responsive HTML5 and CSS3 layout built with [Foundation 6](http://foundation.zurb.com/sites.html) that looks great on all devices and screen sizes.\n* **Embed into your existing website**: An embedded option so that generate partial docs without a HTML `\u003cbody\u003e` for convenient integration into your existing website.\n* **Live preview developer mode**: Development mode that starts a local HTTP server with a file watcher and live reload so you can preview live changes in your browser as you update your spec.\n\n## Usage\n\nSimply install Spectacle from `npm` like so:\n\n```bash\nnpm install -g spectacle-docs\n```\n\nNext pass your `swagger.json` document use the CLI to generate your documentation.\n\n```bash\nspectacle -d your_swagger_api.json\n\n# Or use the cheese.json example to test it out\n# spectacle -d -l test/fixtures/cheese.png test/fixtures/cheese.yml\n```\n\nYour generated documentation will be located in the `public` directory by default. You can either copy the generated HTML to your web server, or view your docs by pointing your browser to [http://localhost:4400/](http://localhost:4400/).\n\n### Docker\n\n[Docker](https://hub.docker.com/r/sourcey/spectacle/) images are included that allow Spectacle to be run from the inside. It's useful, for instance, in a Gitlab CI pipeline. Thanks @alexeiaguiar.\n\nHow to use it: `docker run -it sourcey/spectacle /bin/sh`\n\n## Configuration Options\n\nThe basic CLI options are detailed below:\n\n```bash\n$ spectacle -h\n\n  Usage: spectacle [options] \u003cspecfile\u003e\n\n  Options:\n\n    -h, --help                   output usage information\n    -V, --version                output the version number\n    -C, --disable-css            omit CSS generation (default: false)\n    -J, --disable-js             omit JavaScript generation (default: false)\n    -e, --embeddable             omit the HTML \u003cbody/\u003e and generate the documentation content only (default: false)\n    -d, --development-mode       start HTTP server with the file watcher (default: false)\n    -D, --development-mode-live  start HTTP server with the file watcher and live reload (default: false)\n    -s, --start-server           start the HTTP server without any development features\n    -p, --port \u003cport\u003e            the port number for the HTTP server to listen on (default: 4400)\n    -P, --port-live \u003cport\u003e       the port number for the live reload to listen on (default: 4401)\n    -t, --target-dir \u003cdir\u003e       the target build directory (default: public)\n    -f, --target-file \u003cfile\u003e     the target build HTML file (default: index.html)\n    -a, --app-dir \u003cdir\u003e          the application source directory (default: app)\n    -l, --logo-file \u003cfile\u003e       specify a custom logo file (default: null)\n    -c, --config-file \u003cfile\u003e     specify a custom configuration file (default: app/lib/config.js)\n```\n\nMost options are self explanatory, but the following options warrant some further explanation:\n\n* **--development-mode** `-d`: This option starts a development server with a file watcher, and will automatically regenerate your docs when any of your spec or app files change.\n\n* **--development-mode-live** `-D`: This option starts a development server with a file watcher and live reload, and will automatically regenerate your docs when any of your spec or app files change.\n\n* **--start-server** `-s`: This option starts a production server without any development options enabled that serves the contents of your `--target-dir`.\n\n* **--embeddable** `-e`: This option lets you build a minimal version of the documentation without the HTML `\u003cbody\u003e` tags, so you can embed Spectacle into your own website template. More info on [custom builds](#custom-builds) here.\n\n* **--app-dir** `-a`: This option overrides the default directory which contains all the Handlebars templates, SCSS, and JavaScript source files. This option is useful for development because you can copy the contents of `app` to a remote location or a separate repo for custom builds.\n\n* **--target-dir** `-t`: This option specifies where the generated documentation HTML files will be output.\n\n## Custom Builds\n\nThe best option for building your own custom functionality into Spectacle is to [fork Spectacle on GitHub](https://help.github.com/articles/fork-a-repo/), and make your own modifications in source. This way you can keep up to date by merging changes from the `master` branch, and your can also contribute your updates back to `master` by creating a [Pull Request](https://help.github.com/articles/creating-a-pull-request/) if you think they improve Spectacle somehow.\n\nTo fork Spectacle go to `https://github.com/sourcey/spectacle`, and press the 'Fork' button. Now you can `git clone git@github.com:\u003cyourname\u003e/spectacle.git` to make your own changes.\n\nAlternatively, you can just copy the contents of `app` from the main repo which contains all the source files such as templates, stylesheets and JavaScripts. Now just pass the path to your custom `app` path to the CLI like so: `spectacle -a /path/to/your/app your_swagger_api.json`\n\n## Optimizing Your Workflow\n\nUsing an API spec to generate your docs has a number of great advantages, such as:\n\n* **Maintain a single source**: Save time by removing the need to maintain a separate API spec and API documentation.\n* **No more out-of-date documentation**: Your documentation will always be up-to-date with your API spec.\n* **Be a better developer**: Your entire API system will be more stable and robust when built around your spec as a single source of truth.\n\nAs developer we're always looking for ways to improve and optimize our workflow, and documentation is just the beginning. With a well written Swagger you can automate and generate many parts of your API system, such as:\n\n* **Inline Code Generators**: Generate your Swagger JSON or YAML from your source code comments.\n* **Automate Testing**: Automate testing for all your API endpoints.\n* **Code Generation**: Automatically generate client and server code from your spec.\n* **Generate Documentation**: Really?\n\nFor a list of open source Swagger based libraries in many languages check here: http://swagger.io/open-source-integrations/\n\n## Development\n\n### Testing\n\nTesting is powered by [Mocha](https://mochajs.org/)/[Chai](http://chaijs.com/), and automated testing is run via [CircleCI](https://circleci.com/).\n\nAt this stage, unit tests have not been written for all parts of the codebase.  However, new code should be tested, and unit tests for the existing code will be added in the future.\n\nRun `npm test` on the repository to start the automated tests.\nSome parts of testing can be configured using environment variables.\n\n- `OFFLINE=true`\n  Some tests use HTTP connections to test giving Spectacle remote API specifications.\n  Use `OFFLINE=true` to skip tests that require an internet connection.\n\nInclude environment variables before calling `npm test`.  For example, `OFFLINE` mode can be enabled via `OFFLINE=true npm test`.\n\n\n\u003c!-- ## Contributors\n\nThanks to all the great developers who make Spectacle great!\n\nTODO\n--\u003e\n\n\n## More Information\n\nMore info is available on the [Spectacle homepage](http://sourcey.com/spectacle).\n\nPlease use the [GitHub issue tracker](https://github.com/sourcey/spectacle/issues) if you have any ideas or bugs to report.\n\nAll contributions are welcome.\n\nGood luck and enjoy Spectacle!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcey%2Fspectacle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcey%2Fspectacle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcey%2Fspectacle/lists"}