Skip to content

Commit b00d626

Browse files
committed
major refactoring of code - with 2 pass conversion into pdf
1 parent 5d7a721 commit b00d626

File tree

10 files changed

+1026
-389
lines changed

10 files changed

+1026
-389
lines changed

.eslintrc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@
1313
},
1414
"rules": {
1515
"max-len": [1, 300, 2, {"ignoreComments": true}],
16-
"no-plusplus" : 0,
16+
"no-debugger": 0,
17+
"no-plusplus": 0,
1718
"no-param-reassign": 0,
1819
"no-nested-ternary": 0,
19-
"no-continue":0,
20+
"no-continue": 0,
2021
"no-restricted-syntax" :0,
21-
"guard-for-in" :0,
22-
"no-loop-func" :0,
23-
"consistent-return":0,
24-
"array-callback-return":0,
25-
"prefer-destructuring":0
22+
"guard-for-in": 0,
23+
"no-loop-func": 0,
24+
"consistent-return": 0,
25+
"array-callback-return": 0,
26+
"prefer-destructuring": 0
2627
}
2728
}

dist/eslint_report.html

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>ESLint Report</title>
6+
<style>
7+
body {
8+
font-family:Arial, "Helvetica Neue", Helvetica, sans-serif;
9+
font-size:16px;
10+
font-weight:normal;
11+
margin:0;
12+
padding:0;
13+
color:#333
14+
}
15+
#overview {
16+
padding:20px 30px
17+
}
18+
td, th {
19+
padding:5px 10px
20+
}
21+
h1 {
22+
margin:0
23+
}
24+
table {
25+
margin:30px;
26+
width:calc(100% - 60px);
27+
max-width:1000px;
28+
border-radius:5px;
29+
border:1px solid #ddd;
30+
border-spacing:0px;
31+
}
32+
th {
33+
font-weight:400;
34+
font-size:medium;
35+
text-align:left;
36+
cursor:pointer
37+
}
38+
td.clr-1, td.clr-2, th span {
39+
font-weight:700
40+
}
41+
th span {
42+
float:right;
43+
margin-left:20px
44+
}
45+
th span:after {
46+
content:"";
47+
clear:both;
48+
display:block
49+
}
50+
tr:last-child td {
51+
border-bottom:none
52+
}
53+
tr td:first-child, tr td:last-child {
54+
color:#9da0a4
55+
}
56+
#overview.bg-0, tr.bg-0 th {
57+
color:#468847;
58+
background:#dff0d8;
59+
border-bottom:1px solid #d6e9c6
60+
}
61+
#overview.bg-1, tr.bg-1 th {
62+
color:#f0ad4e;
63+
background:#fcf8e3;
64+
border-bottom:1px solid #fbeed5
65+
}
66+
#overview.bg-2, tr.bg-2 th {
67+
color:#b94a48;
68+
background:#f2dede;
69+
border-bottom:1px solid #eed3d7
70+
}
71+
td {
72+
border-bottom:1px solid #ddd
73+
}
74+
td.clr-1 {
75+
color:#f0ad4e
76+
}
77+
td.clr-2 {
78+
color:#b94a48
79+
}
80+
td a {
81+
color:#3a33d1;
82+
text-decoration:none
83+
}
84+
td a:hover {
85+
color:#272296;
86+
text-decoration:underline
87+
}
88+
</style>
89+
</head>
90+
<body>
91+
<div id="overview" class="bg-1">
92+
<h1>ESLint Report</h1>
93+
<div>
94+
<span>1 problem (0 errors, 1 warning)</span> - Generated on Sun Sep 22 2019 01:18:53 GMT-0700 (Pacific Daylight Time)
95+
</div>
96+
</div>
97+
<table>
98+
<tbody>
99+
<tr class="bg-1" data-group="f-0">
100+
<th colspan="4">
101+
[+] /Users/mrin/work/rapi-pdf/src/utils/parse-utils.js
102+
<span>1 problem (0 errors, 1 warning)</span>
103+
</th>
104+
</tr>
105+
<tr style="display:none" class="f-0">
106+
<td>18:5</td>
107+
<td class="clr-1">Warning</td>
108+
<td>Unexpected console statement.</td>
109+
<td>
110+
<a href="" target="_blank" rel="noopener noreferrer">no-console</a>
111+
</td>
112+
</tr>
113+
114+
</tbody>
115+
</table>
116+
<script type="text/javascript">
117+
var groups = document.querySelectorAll("tr[data-group]");
118+
for (i = 0; i < groups.length; i++) {
119+
groups[i].addEventListener("click", function() {
120+
var inGroup = document.getElementsByClassName(this.getAttribute("data-group"));
121+
this.innerHTML = (this.innerHTML.indexOf("+") > -1) ? this.innerHTML.replace("+", "-") : this.innerHTML.replace("-", "+");
122+
for (var j = 0; j < inGroup.length; j++) {
123+
inGroup[j].style.display = (inGroup[j].style.display !== "none") ? "none" : "table-row";
124+
}
125+
});
126+
}
127+
</script>
128+
</body>
129+
</html>

docs/examples/list.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
66
<script type="text/javascript" src="../rapipdf-min.js"></script>
77
<style>
8+
rapi-pdf {
9+
margin:2px;
10+
width:600px;
11+
}
812
</style>
913
</head>
1014
<body>
11-
<rapi-pdf id='thedoc' spec-url="../specs/allof.json" button-label="all-of"></rapi-pdf>
12-
<rapi-pdf id='thedoc' spec-url="../specs/oneof.json" button-label="one-of"></rapi-pdf>
13-
<rapi-pdf id='thedoc' spec-url="../specs/basic.json" button-label="Basic"></rapi-pdf>
14-
<rapi-pdf id='thedoc' spec-url="../specs/petstore_extended.yaml" button-label="All Cases"></rapi-pdf>
15+
<rapi-pdf spec-url="../specs/basic.json" button-label="Basic"></rapi-pdf>
16+
<rapi-pdf spec-url="../specs/allof.json" button-label="all-of"></rapi-pdf>
17+
<rapi-pdf spec-url="../specs/oneof.json" button-label="one-of"></rapi-pdf>
18+
<rapi-pdf spec-url="../specs/petstore_extended.yaml" button-label="Extended"></rapi-pdf>
19+
<rapi-pdf spec-url="../specs/test-specs/petstore_experimental.yaml" button-label="Experimental"></rapi-pdf>
20+
<rapi-pdf spec-url="../specs/test-specs/petstore_complex_request.yaml" button-label="Complex"></rapi-pdf>
21+
<rapi-pdf spec-url="../specs/bitbucket.json" button-label="BitBucket"></rapi-pdf>
22+
<rapi-pdf spec-url="https://api.apis.guru/v2/specs/github.com/v3/swagger.json" button-label="GitHub"></rapi-pdf>
23+
1524
</body>
1625

1726

docs/specs/petstore_extended.yaml

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,8 @@
11
openapi: 3.0.0
2-
servers:
3-
- url: //petstore.swagger.io/v2
4-
description: Default server
5-
- url: //petstore.swagger.io/sandbox
6-
description: Sandbox server
72
info:
8-
description: |
9-
This is a sample server Petstore server.
10-
You can find out more about Swagger at
11-
[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).
12-
For this sample, you can use the api key `special-key` to test the authorization filters.
13-
14-
# Introduction
15-
This API is documented in **OpenAPI format** and is based on
16-
[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
17-
It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
18-
tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
19-
OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
20-
21-
# OpenAPI Specification
22-
This API is documented in **OpenAPI format** and is based on
23-
[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
24-
It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
25-
tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
26-
OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
27-
28-
# Cross-Origin Resource Sharing
29-
This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).
30-
And that allows cross-domain communication from the browser.
31-
All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
32-
33-
# Authentication
34-
35-
Petstore offers two forms of authentication:
36-
- API Key
37-
- OAuth2
38-
OAuth2 - an open protocol to allow secure authorization in a simple
39-
and standard method from web, mobile and desktop applications.
40-
41-
<SecurityDefinitions />
42-
3+
description: This is a sample server Petstore server.
434
version: 1.0.0
445
title: Swagger Petstore
45-
termsOfService: 'http://swagger.io/terms/'
46-
contact:
47-
name: API Support
48-
email: apiteam@swagger.io
49-
url: https://github.com/Redocly/redoc
50-
x-logo:
51-
url: 'https://redocly.github.io/redoc/petstore-logo.png'
52-
altText: Petstore logo
53-
license:
54-
name: Apache 2.0
55-
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
56-
externalDocs:
57-
description: Find out how to create Github repo for your OpenAPI spec.
58-
url: 'https://github.com/Rebilly/generator-openapi-repo'
596
tags:
607
- name: pet
618
description: Everything about your Pets
@@ -71,18 +18,6 @@ tags:
7118
x-displayName: The Order Model
7219
description: |
7320
<SchemaDefinition schemaRef="#/components/schemas/Order" exampleRef="#/components/examples/Order" showReadOnly={true} showWriteOnly={true} />
74-
x-tagGroups:
75-
- name: General
76-
tags:
77-
- pet
78-
- store
79-
- name: User Management
80-
tags:
81-
- user
82-
- name: Models
83-
tags:
84-
- pet_model
85-
- store_model
8621
paths:
8722
/pet:
8823
parameters:

0 commit comments

Comments
 (0)