|
1 | | -swagger-markdown |
2 | | -================ |
| 1 | +# openapi-markdown |
3 | 2 |
|
4 | | -[![npm][npm-image]][npm-url] [![dependencies][david-image]][david-url] [![circle ci][circleci-image]][circleci-url] |
| 3 | +[![npm][npm-image]][npm-url] |
5 | 4 |
|
6 | | -CLI script to turn swagger yaml into markdown files. |
7 | | -Supports swagger 2.0 format only |
8 | | - |
9 | | -see [examples](https://github.com/syroegkin/swagger-markdown/tree/master/examples) folder |
| 5 | +CLI script to turn swagger/OpenAPI yaml into markdown files. |
| 6 | +Primarily supports swagger 2.0, with some OpenAPI 3.0 features. |
10 | 7 |
|
11 | 8 | ### Installation |
12 | 9 |
|
13 | | - npm install -g swagger-markdown |
| 10 | + npm install -g openapi-markdown |
14 | 11 |
|
15 | 12 | ### Usage |
16 | 13 |
|
17 | 14 | ``` |
18 | | -swagger-markdown [-h] [-v] -i [-o] [--skip-info] |
| 15 | +openapi-markdown [-h] [-v] -i [-o] [--skip-info] |
19 | 16 |
|
20 | 17 | Options: |
21 | 18 | -h, --help Show this help message and exit. |
22 | 19 | -v, --version Show program's version number and exit. |
23 | | - -i , --input Path to the swagger yaml file |
| 20 | + -i , --input Path to the openapi yaml file |
24 | 21 | -o , --output Path to the resulting md file |
25 | 22 | --skip-info Skip the title, description, version etc, whatever is in the info block. |
26 | 23 |
|
27 | 24 | ``` |
28 | 25 |
|
29 | 26 | ### Npx (requires no installation) |
| 27 | + |
30 | 28 | ``` |
31 | | -npx swagger-markdown -i ./basic-auth.yaml |
| 29 | +npx openapi-markdown -i ./basic-auth.yaml |
32 | 30 | ``` |
33 | 31 |
|
34 | 32 | #### Example: |
35 | 33 |
|
36 | 34 | ```javascript |
37 | | -swagger-markdown -i path/to/swagger/file.yaml |
| 35 | +openapi-markdown -i path/to/openapi/file.yaml |
38 | 36 | ``` |
39 | | -By default it will create the new file within the same directory with the same name as swagger file but with .md extension. |
40 | | -So, if swagger file is placed in `project/api-doc/swagger.yaml` the new file will be created as `project/api-doc/swagger.md` |
| 37 | + |
| 38 | +By default it will create the new file within the same directory with the same name as openapi file but with .md extension. |
| 39 | +So, if openapi file is placed in `project/api-doc/openapi.yaml` the new file will be created as `project/api-doc/openapi.md` |
41 | 40 |
|
42 | 41 | You can also use it as a npm script in your package.json: |
43 | 42 |
|
44 | | - npm i --save-dev swagger-markdown |
| 43 | + npm i --save-dev openapi-markdown |
45 | 44 |
|
46 | 45 | ```jsonc |
47 | 46 | { |
48 | | - "scripts": { |
49 | | - "md-docs": "swagger-markdown -i path/to/swagger.yaml", |
50 | | - //... |
51 | | - } |
| 47 | + "scripts": { |
| 48 | + "md-docs": "openapi-markdown -i path/to/openapi.yaml" |
| 49 | + //... |
| 50 | + } |
52 | 51 | } |
53 | 52 | ``` |
54 | 53 |
|
55 | 54 | npm run md-docs |
56 | 55 |
|
57 | | -[npm-url]: https://www.npmjs.com/package/swagger-markdown |
58 | | -[npm-image]: https://img.shields.io/npm/v/swagger-markdown.svg |
59 | | - |
60 | | -[david-url]: https://david-dm.org/syroegkin/swagger-markdown |
61 | | -[david-image]: https://img.shields.io/david/syroegkin/swagger-markdown.svg |
62 | | - |
63 | | -[circleci-url]: https://circleci.com/gh/syroegkin/swagger-markdown/tree/master |
64 | | -[circleci-image]: https://img.shields.io/circleci/project/syroegkin/swagger-markdown.svg |
65 | | - |
| 56 | +[npm-url]: https://www.npmjs.com/package/openapi-markdown |
| 57 | +[npm-image]: https://img.shields.io/npm/v/openapi-markdown.svg |
0 commit comments