Skip to content

Commit 528cc56

Browse files
committed
Add docs directory
1 parent a8981e1 commit 528cc56

File tree

17 files changed

+13818
-0
lines changed

17 files changed

+13818
-0
lines changed

docs/.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
["@babel/preset-react", {"absoluteRuntime": false}]
5+
]
6+
}

docs/.eslintrc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:react/recommended"
9+
],
10+
"parser": "@babel/eslint-parser",
11+
"parserOptions": {
12+
"ecmaFeatures": {
13+
"jsx": true
14+
},
15+
"ecmaVersion": 12,
16+
"sourceType": "module"
17+
},
18+
"plugins": [
19+
"react"
20+
],
21+
"rules": {
22+
"react/prop-types": "off",
23+
"no-prototype-builtins": "off",
24+
"no-unused-vars": "warn",
25+
"no-unreachable": "warn"
26+
},
27+
"globals": {
28+
"React": "readonly",
29+
"ReactDOM": "readonly"
30+
}
31+
}

docs/.nojekyll

Whitespace-only changes.

docs/apple-touch-icon.png

2.31 KB
Loading

docs/devserver.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/usr/bin/env python3
2+
3+
"""Development server.
4+
5+
Features:
6+
- Disables caching for static files
7+
- Link substitution
8+
9+
Usage:
10+
$ ./devserver.py
11+
12+
Gotchas:
13+
- Currently only works with index.html page
14+
"""
15+
import os
16+
import time
17+
import http.server
18+
from http import HTTPStatus
19+
20+
21+
PORT = 8000
22+
23+
24+
# Substitutions
25+
SUB = [
26+
(
27+
'/react-json-form/',
28+
'/'
29+
),
30+
(
31+
'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css',
32+
'/local/bootstrap.min.css',
33+
),
34+
(
35+
'https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.production.min.js',
36+
'/node_modules/react/umd/react.development.js',
37+
),
38+
(
39+
'https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js',
40+
'/node_modules/react-dom/umd/react-dom.development.js',
41+
),
42+
(
43+
'https://cdnjs.cloudflare.com/ajax/libs/react-modal/3.15.1/react-modal.min.js',
44+
'/node_modules/react-modal/dist/react-modal.min.js'
45+
),
46+
]
47+
48+
49+
CACHE_TIME = None
50+
CACHE_DATA = None
51+
52+
53+
class DevHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
54+
def send_response_only(self, code, message=None):
55+
super().send_response_only(code, message)
56+
self.send_header('Cache-Control', 'no-store, must-revalidate')
57+
self.send_header('Expires', '0')
58+
59+
def is_index(self):
60+
return self.path == '/' or self.path == '/index.html'
61+
62+
def do_GET(self):
63+
if self.is_index():
64+
try:
65+
f = open('index.html', 'rb')
66+
except OSError:
67+
self.send_error(HTTPStatus.NOT_FOUND, "File not found")
68+
return None
69+
70+
try:
71+
fs = os.fstat(f.fileno())
72+
global CACHE_TIME
73+
global CACHE_DATA
74+
if not CACHE_TIME or CACHE_TIME <= fs.st_mtime:
75+
CACHE_TIME = time.time()
76+
CACHE_DATA = f.read().decode()
77+
78+
for sub in SUB:
79+
CACHE_DATA = CACHE_DATA.replace(sub[0], sub[1])
80+
81+
CACHE_DATA = CACHE_DATA.encode('utf-8')
82+
83+
self.send_response(HTTPStatus.OK)
84+
self.send_header("Content-type", "text/html")
85+
self.send_header("Content-Length", str(len(CACHE_DATA)))
86+
self.send_header("Last-Modified", self.date_time_string(fs.st_mtime))
87+
self.end_headers()
88+
89+
f.close()
90+
91+
self.wfile.write(CACHE_DATA)
92+
except:
93+
f.close()
94+
raise
95+
else:
96+
super().do_GET()
97+
98+
99+
if __name__ == '__main__':
100+
http.server.test(
101+
HandlerClass=DevHTTPRequestHandler,
102+
port=PORT
103+
)

docs/favicon.ico

15 KB
Binary file not shown.

docs/index.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!DOCTYPE html>
2+
<html lang="en" class="h-100">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>React JSON Form Playground</title>
7+
<meta name="description" content="react-json-form docs, live demos and playground">
8+
<link rel="icon" type="image/x-icon" href="/react-json-form/favicon.ico">
9+
<link rel="apple-touch-icon" href="/react-json-form/apple-touch-icon.png" sizes="180x180">
10+
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css">
11+
<link rel="stylesheet" type="text/css" href="/react-json-form/static/css/docs.css">
12+
<link rel="preconnect" href="https://fonts.googleapis.com">
13+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
14+
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap" rel="stylesheet">
15+
</head>
16+
17+
<body class="d-flex flex-column h-100">
18+
19+
<div class="flex-grow-1 flex-shrink-0">
20+
<div class="top-nav">
21+
<div class="container-xl">
22+
<div class="row">
23+
<div class="col-6">
24+
<img src="static/img/logo.svg" alt="React Json Form" class="logo">
25+
</div>
26+
<div class="col-6 top-nav-menu">
27+
<a href="https://github.com/bhch/react-json-form">
28+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16">
29+
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
30+
</svg>
31+
<strong>Github</strong>
32+
</a>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
38+
<div class="page-heading text-center">
39+
<h1>PLAYGROUND</h1>
40+
</div>
41+
42+
<div class="container-xl">
43+
<div id="playgroundRoot">
44+
<div class="my-5 py-5">
45+
<pre class="d-table mx-auto" style="line-height: 1.1;">
46+
_
47+
.__(.)&lt; (LOADING)
48+
\___)
49+
</pre>
50+
<div class="progress mx-auto mt-3 w-25" style="min-width: 100px;">
51+
<div class="progress-bar progress-bar-striped progress-bar-animated w-100"></div>
52+
</div>
53+
54+
</div>
55+
</div>
56+
</div>
57+
</div>
58+
59+
<div class="flex-grow-0 flex-shrink-1" style="margin-top: 200px;">
60+
<div class="footer">
61+
<div class="container-xl">
62+
<div class="row">
63+
<div class="col-4">
64+
<img src="static/img/logo.svg" alt="React Json Form" class="logo">
65+
</div>
66+
<div class="col-8 text-right pt-3">
67+
<a href="https://github.com/bhch/react-json-form">
68+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16">
69+
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
70+
</svg>
71+
<strong>View on Github</strong>
72+
</a>
73+
</div>
74+
</div>
75+
</div>
76+
</div>
77+
</div>
78+
79+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.production.min.js"></script>
80+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js"></script>
81+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react-modal/3.15.1/react-modal.min.js"></script>
82+
83+
<script type="text/javascript" src="/react-json-form/static/js/docs.js"></script>
84+
</body>
85+
</html>

docs/local/bootstrap.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)