chisel 1.3.7__tar.gz → 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {chisel-1.3.7/src/chisel.egg-info → chisel-1.4.0}/PKG-INFO +3 -2
- {chisel-1.3.7 → chisel-1.4.0}/setup.cfg +2 -1
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel/__init__.py +2 -1
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel/doc.py +44 -14
- chisel-1.4.0/src/chisel/static/index.html +54 -0
- chisel-1.4.0/src/chisel/static/markdown-up.tar.gz +0 -0
- {chisel-1.3.7 → chisel-1.4.0/src/chisel.egg-info}/PKG-INFO +3 -2
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel.egg-info/SOURCES.txt +2 -1
- chisel-1.3.7/src/chisel/static/index.html +0 -52
- {chisel-1.3.7 → chisel-1.4.0}/LICENSE +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/README.md +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/pyproject.toml +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel/action.py +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel/app.py +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel/request.py +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel/static/__init__.py +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel/static/chiselDoc.bare +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel.egg-info/dependency_links.txt +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel.egg-info/requires.txt +0 -0
- {chisel-1.3.7 → chisel-1.4.0}/src/chisel.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: chisel
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
|
|
5
5
|
Home-page: https://github.com/craigahobbs/chisel
|
|
6
6
|
Author: Craig A. Hobbs
|
|
@@ -22,6 +22,7 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
Requires-Dist: schema-markdown>=1.2.0
|
|
25
|
+
Dynamic: license-file
|
|
25
26
|
|
|
26
27
|
# chisel
|
|
27
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = chisel
|
|
3
|
-
version = 1.
|
|
3
|
+
version = 1.4.0
|
|
4
4
|
url = https://github.com/craigahobbs/chisel
|
|
5
5
|
author = Craig A. Hobbs
|
|
6
6
|
author_email = craigahobbs@gmail.com
|
|
@@ -34,6 +34,7 @@ install_requires =
|
|
|
34
34
|
chisel =
|
|
35
35
|
static/*.bare
|
|
36
36
|
static/*.html
|
|
37
|
+
static/*.tar.gz
|
|
37
38
|
|
|
38
39
|
[egg_info]
|
|
39
40
|
tag_build =
|
|
@@ -6,6 +6,9 @@ Chisel documentation application
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import importlib.resources
|
|
9
|
+
import os
|
|
10
|
+
from pathlib import PosixPath
|
|
11
|
+
import tarfile
|
|
9
12
|
|
|
10
13
|
from schema_markdown import get_referenced_types
|
|
11
14
|
from schema_markdown.type_model import TYPE_MODEL
|
|
@@ -14,7 +17,7 @@ from .action import Action, ActionError
|
|
|
14
17
|
from .request import RedirectRequest, StaticRequest
|
|
15
18
|
|
|
16
19
|
|
|
17
|
-
def create_doc_requests(requests=None, root_path='/doc', api=True, app=True
|
|
20
|
+
def create_doc_requests(requests=None, root_path='/doc', api=True, app=True):
|
|
18
21
|
"""
|
|
19
22
|
Yield a series of requests for use with :meth:`~chisel.Application.add_requests` comprising the Chisel
|
|
20
23
|
documentation application. By default, the documenation application is hosted at "/doc/".
|
|
@@ -25,27 +28,23 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True, mar
|
|
|
25
28
|
:param bool api: If True, include the documentation APIs. Two documentation APIs are added,
|
|
26
29
|
"/doc/doc_index" and "`/doc/doc_request <doc/#name=chisel_doc_request>`__".
|
|
27
30
|
:param bool app: If True, include the documentation client application.
|
|
28
|
-
:param str markdown_up: Optional, the relative path to the MarkdownUp application.
|
|
29
31
|
:returns: Generator of :class:`~chisel.Request`
|
|
30
32
|
"""
|
|
31
33
|
|
|
34
|
+
root_noslash = root_path.rstrip('/')
|
|
35
|
+
root_slash = root_noslash + '/'
|
|
32
36
|
if api:
|
|
33
|
-
yield DocIndex(requests=requests, urls=(('GET',
|
|
34
|
-
yield DocRequest(requests=requests, urls=(('GET',
|
|
37
|
+
yield DocIndex(requests=requests, urls=(('GET', root_slash + 'doc_index'),))
|
|
38
|
+
yield DocRequest(requests=requests, urls=(('GET', root_slash + 'doc_request'),))
|
|
35
39
|
if app:
|
|
36
|
-
|
|
40
|
+
if root_noslash:
|
|
41
|
+
yield RedirectRequest((('GET', root_noslash),), root_slash, name='chisel_doc_redirect', doc_group='Documentation')
|
|
37
42
|
with importlib.resources.files('chisel.static').joinpath('index.html').open('rb') as fh:
|
|
38
|
-
index_bytes = fh.read()
|
|
39
|
-
if markdown_up:
|
|
40
|
-
index_str = index_bytes.decode(encoding='utf-8')
|
|
41
|
-
index_str = index_str.replace('https://craigahobbs.github.io/markdown-up/', markdown_up)
|
|
42
|
-
index_str = index_str.replace("'markdownText':", f"'systemPrefix': '{markdown_up}include/', 'markdownText':")
|
|
43
|
-
index_bytes = index_str.encode(encoding='utf-8')
|
|
44
43
|
yield StaticRequest(
|
|
45
44
|
'chisel_doc',
|
|
46
|
-
|
|
45
|
+
fh.read(),
|
|
47
46
|
'text/html; charset=utf-8',
|
|
48
|
-
(('GET',
|
|
47
|
+
(('GET', root_slash), ('GET', root_slash + 'index.html')),
|
|
49
48
|
'The Chisel documentation HTML',
|
|
50
49
|
'Documentation'
|
|
51
50
|
)
|
|
@@ -54,10 +53,41 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True, mar
|
|
|
54
53
|
'chisel_doc_app',
|
|
55
54
|
fh.read(),
|
|
56
55
|
'text/plain; charset=utf-8',
|
|
57
|
-
(('GET',
|
|
56
|
+
(('GET', root_slash + 'chiselDoc.bare'),),
|
|
58
57
|
'The Chisel documentation application',
|
|
59
58
|
'Documentation'
|
|
60
59
|
)
|
|
60
|
+
yield from create_markdown_up_requests(str(PosixPath(root_path).parent))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def create_markdown_up_requests(parent_path='/'):
|
|
64
|
+
"""
|
|
65
|
+
Yield a series of requests for use with :meth:`~chisel.Application.add_requests` comprising the
|
|
66
|
+
MarkdownUp application. By default, the MarkdownUp application is hosted at "/markdown-up/".
|
|
67
|
+
|
|
68
|
+
:param str parent_path: The MarkdownUp application URL parent path. The default is "/".
|
|
69
|
+
:returns: Generator of :class:`~chisel.Request`
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
parent_posix = PosixPath(parent_path)
|
|
73
|
+
with importlib.resources.files('chisel.static').joinpath('markdown-up.tar.gz').open('rb') as tgz:
|
|
74
|
+
with tarfile.open(fileobj=tgz, mode='r:gz') as tar:
|
|
75
|
+
for member in tar.getmembers():
|
|
76
|
+
if member.isfile():
|
|
77
|
+
yield StaticRequest(
|
|
78
|
+
member.name,
|
|
79
|
+
tar.extractfile(member).read(),
|
|
80
|
+
content_type=_CONTENT_TYPES.get(os.path.splitext(member.name)[1], 'text/plain; charset=utf-8'),
|
|
81
|
+
urls=(('GET', str(parent_posix.joinpath(member.name))),),
|
|
82
|
+
doc_group='MarkdownUp Statics'
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
_CONTENT_TYPES = {
|
|
87
|
+
'.css': 'text/css; charset=utf-8',
|
|
88
|
+
'.js': 'text/javascript; charset=utf-8',
|
|
89
|
+
'.html': 'text/html; charset=utf-8'
|
|
90
|
+
}
|
|
61
91
|
|
|
62
92
|
|
|
63
93
|
class DocIndex(Action):
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Chisel Documentation Application</title>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="description" content="Chisel Documentation Application">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="stylesheet" href="../markdown-up/app.css">
|
|
9
|
+
|
|
10
|
+
<!-- Preloads -->
|
|
11
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/data.js" as="script">
|
|
12
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/library.js" as="script">
|
|
13
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/model.js" as="script">
|
|
14
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/options.js" as="script">
|
|
15
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/parser.js" as="script">
|
|
16
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/runtime.js" as="script">
|
|
17
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/runtimeAsync.js" as="script">
|
|
18
|
+
<link rel="modulepreload" href="../markdown-up/bare-script/lib/value.js" as="script">
|
|
19
|
+
<link rel="modulepreload" href="../markdown-up/element-model/lib/elementModel.js" as="script">
|
|
20
|
+
<link rel="modulepreload" href="../markdown-up/lib/app.js" as="script">
|
|
21
|
+
<link rel="modulepreload" href="../markdown-up/lib/dataTable.js" as="script">
|
|
22
|
+
<link rel="modulepreload" href="../markdown-up/lib/dataUtil.js" as="script">
|
|
23
|
+
<link rel="modulepreload" href="../markdown-up/lib/lineChart.js" as="script">
|
|
24
|
+
<link rel="modulepreload" href="../markdown-up/lib/script.js" as="script">
|
|
25
|
+
<link rel="modulepreload" href="../markdown-up/lib/scriptLibrary.js" as="script">
|
|
26
|
+
<link rel="modulepreload" href="../markdown-up/markdown-model/lib/elements.js" as="script">
|
|
27
|
+
<link rel="modulepreload" href="../markdown-up/markdown-model/lib/highlight.js" as="script">
|
|
28
|
+
<link rel="modulepreload" href="../markdown-up/markdown-model/lib/parser.js" as="script">
|
|
29
|
+
<link rel="modulepreload" href="../markdown-up/schema-markdown-doc/lib/schemaMarkdownDoc.js" as="script">
|
|
30
|
+
<link rel="modulepreload" href="../markdown-up/schema-markdown/lib/encode.js" as="script">
|
|
31
|
+
<link rel="modulepreload" href="../markdown-up/schema-markdown/lib/parser.js" as="script">
|
|
32
|
+
<link rel="modulepreload" href="../markdown-up/schema-markdown/lib/schema.js" as="script">
|
|
33
|
+
<link rel="modulepreload" href="../markdown-up/schema-markdown/lib/schemaUtil.js" as="script">
|
|
34
|
+
<link rel="modulepreload" href="../markdown-up/schema-markdown/lib/typeModel.js" as="script">
|
|
35
|
+
<link rel="preload" href="../markdown-up/app.css" as="style">
|
|
36
|
+
<link rel="preload" href="../markdown-up/markdown-model/static/markdown-model.css" as="style">
|
|
37
|
+
</head>
|
|
38
|
+
<body>
|
|
39
|
+
</body>
|
|
40
|
+
<script type="module">
|
|
41
|
+
import {MarkdownUp} from '../markdown-up/lib/app.js';
|
|
42
|
+
const app = new MarkdownUp(window, {
|
|
43
|
+
'systemPrefix': '../markdown-up/include/',
|
|
44
|
+
'markdownText': `\
|
|
45
|
+
~~~ markdown-script
|
|
46
|
+
include 'chiselDoc.bare'
|
|
47
|
+
|
|
48
|
+
chiselDoc()
|
|
49
|
+
~~~
|
|
50
|
+
`
|
|
51
|
+
});
|
|
52
|
+
app.run();
|
|
53
|
+
</script>
|
|
54
|
+
</html>
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: chisel
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
|
|
5
5
|
Home-page: https://github.com/craigahobbs/chisel
|
|
6
6
|
Author: Craig A. Hobbs
|
|
@@ -22,6 +22,7 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
Requires-Dist: schema-markdown>=1.2.0
|
|
25
|
+
Dynamic: license-file
|
|
25
26
|
|
|
26
27
|
# chisel
|
|
27
28
|
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>Chisel Documentation Application</title>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="description" content="Chisel Documentation Application">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
-
<link rel="stylesheet" href="https://craigahobbs.github.io/markdown-up/app.css">
|
|
9
|
-
|
|
10
|
-
<!-- Preloads -->
|
|
11
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/data.js" as="script">
|
|
12
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/library.js" as="script">
|
|
13
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/model.js" as="script">
|
|
14
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/options.js" as="script">
|
|
15
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/parser.js" as="script">
|
|
16
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/runtime.js" as="script">
|
|
17
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/runtimeAsync.js" as="script">
|
|
18
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/value.js" as="script">
|
|
19
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/element-model/lib/elementModel.js" as="script">
|
|
20
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/app.js" as="script">
|
|
21
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/dataTable.js" as="script">
|
|
22
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/dataUtil.js" as="script">
|
|
23
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/lineChart.js" as="script">
|
|
24
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/script.js" as="script">
|
|
25
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/scriptLibrary.js" as="script">
|
|
26
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/markdown-model/lib/elements.js" as="script">
|
|
27
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/markdown-model/lib/highlight.js" as="script">
|
|
28
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/markdown-model/lib/parser.js" as="script">
|
|
29
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/schema-markdown-doc/lib/schemaMarkdownDoc.js" as="script">
|
|
30
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/schema-markdown/lib/encode.js" as="script">
|
|
31
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/schema-markdown/lib/parser.js" as="script">
|
|
32
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/schema-markdown/lib/schema.js" as="script">
|
|
33
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/schema-markdown/lib/schemaUtil.js" as="script">
|
|
34
|
-
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/schema-markdown/lib/typeModel.js" as="script">
|
|
35
|
-
<link rel="preload" href="https://craigahobbs.github.io/markdown-up/app.css" as="style">
|
|
36
|
-
<link rel="preload" href="https://craigahobbs.github.io/markdown-up/markdown-model/static/markdown-model.css" as="style">
|
|
37
|
-
</head>
|
|
38
|
-
<body>
|
|
39
|
-
</body>
|
|
40
|
-
<script type="module">
|
|
41
|
-
import {MarkdownUp} from 'https://craigahobbs.github.io/markdown-up/lib/app.js';
|
|
42
|
-
const app = new MarkdownUp(window, {
|
|
43
|
-
'markdownText': `\
|
|
44
|
-
~~~ markdown-script
|
|
45
|
-
include 'chiselDoc.bare'
|
|
46
|
-
|
|
47
|
-
chiselDoc()
|
|
48
|
-
~~~
|
|
49
|
-
`});
|
|
50
|
-
app.run();
|
|
51
|
-
</script>
|
|
52
|
-
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|