Gathering detailed insights and metrics for spectacle-material-cn
Gathering detailed insights and metrics for spectacle-material-cn
npm install spectacle-material-cn
Typescript
Module System
Min. Node Version
Node Version
NPM Version
HTML (37.09%)
JavaScript (21.09%)
CSS (20.99%)
SCSS (11.15%)
Handlebars (9.57%)
Makefile (0.06%)
Dockerfile (0.05%)
Total Downloads
328
Last Day
1
Last Week
3
Last Month
7
Last Year
49
1,276 Stars
298 Commits
334 Forks
18 Watching
10 Branches
28 Contributors
Latest Version
1.1.0
Package Id
spectacle-material-cn@1.1.0
Unpacked Size
7.66 MB
Size
586.91 kB
File Count
316
NPM Version
6.9.2
Node Version
12.16.2
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
200%
3
Compared to previous week
Last month
40%
7
Compared to previous month
Last year
-5.8%
49
Compared to previous year
30
The gentleman at REST
Spectacle generates beautiful static HTML5 documentation from OpenAPI/Swagger 2.0 API specifications.
The 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 employed by Stripe and Intercom.
See a demo of Spectacle in action here: http://cheesestore.github.io
<body>
for convenient integration into your existing website.Simply install Spectacle from npm
like so:
1npm install -g spectacle-docs
Next pass your swagger.json
document use the CLI to generate your documentation.
1spectacle -d your_swagger_api.json 2 3# Or use the cheese.json example to test it out 4# spectacle -d -l test/fixtures/cheese.png test/fixtures/cheese.yml
Your 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/.
Docker images are included that allow Spectacle to be run from the inside. It's useful, for instance, in a Gitlab CI pipeline. Thanks @alexeiaguiar.
How to use it: docker run -it sourcey/spectacle /bin/sh
The basic CLI options are detailed below:
1$ spectacle -h 2 3 Usage: spectacle [options] <specfile> 4 5 Options: 6 7 -h, --help output usage information 8 -V, --version output the version number 9 -C, --disable-css omit CSS generation (default: false) 10 -J, --disable-js omit JavaScript generation (default: false) 11 -e, --embeddable omit the HTML <body/> and generate the documentation content only (default: false) 12 -d, --development-mode start HTTP server with the file watcher (default: false) 13 -D, --development-mode-live start HTTP server with the file watcher and live reload (default: false) 14 -s, --start-server start the HTTP server without any development features 15 -p, --port <port> the port number for the HTTP server to listen on (default: 4400) 16 -P, --port-live <port> the port number for the live reload to listen on (default: 4401) 17 -t, --target-dir <dir> the target build directory (default: public) 18 -f, --target-file <file> the target build HTML file (default: index.html) 19 -a, --app-dir <dir> the application source directory (default: app) 20 -l, --logo-file <file> specify a custom logo file (default: null) 21 -c, --config-file <file> specify a custom configuration file (default: app/lib/config.js)
Most options are self explanatory, but the following options warrant some further explanation:
--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.
--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.
--start-server -s
: This option starts a production server without any development options enabled that serves the contents of your --target-dir
.
--embeddable -e
: This option lets you build a minimal version of the documentation without the HTML <body>
tags, so you can embed Spectacle into your own website template. More info on custom builds here.
--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.
--target-dir -t
: This option specifies where the generated documentation HTML files will be output.
The best option for building your own custom functionality into Spectacle is to fork Spectacle on GitHub, 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 if you think they improve Spectacle somehow.
To fork Spectacle go to https://github.com/sourcey/spectacle
, and press the 'Fork' button. Now you can git clone git@github.com:<yourname>/spectacle.git
to make your own changes.
Alternatively, 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
Using an API spec to generate your docs has a number of great advantages, such as:
As 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:
For a list of open source Swagger based libraries in many languages check here: http://swagger.io/open-source-integrations/
Testing is powered by Mocha/Chai, and automated testing is run via CircleCI.
At 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.
Run npm test
on the repository to start the automated tests.
Some parts of testing can be configured using environment variables.
OFFLINE=true
Some tests use HTTP connections to test giving Spectacle remote API specifications.
Use OFFLINE=true
to skip tests that require an internet connection.Include environment variables before calling npm test
. For example, OFFLINE
mode can be enabled via OFFLINE=true npm test
.
More info is available on the Spectacle homepage.
Please use the GitHub issue tracker if you have any ideas or bugs to report.
All contributions are welcome.
Good luck and enjoy Spectacle!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/8 approved changesets -- score normalized to 7
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
46 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More