chisel 2.4.15__tar.gz → 2.5.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chisel
3
- Version: 2.4.15
3
+ Version: 2.5.1
4
4
  Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
5
5
  Author-email: "Craig A. Hobbs" <craigahobbs@gmail.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "chisel"
7
- version = "2.4.15"
7
+ version = "2.5.1"
8
8
  description = "Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -39,7 +39,6 @@ packages = ["chisel", "chisel.static"]
39
39
 
40
40
  [tool.setuptools.package-data]
41
41
  chisel = [
42
- "static/*.bare",
43
42
  "static/*.html",
44
43
  "static/*.tar.gz"
45
44
  ]
@@ -25,7 +25,7 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True, mar
25
25
  :type requests: list(~chisel.Request)
26
26
  :param str root_path: The documentation application URL root path. The default is "/doc".
27
27
  :param bool api: If True, include the documentation APIs. Two documentation APIs are added,
28
- "/doc/doc_index" and "`/doc/doc_request <doc/#name=chisel_doc_request>`__".
28
+ "/doc/docIndex" and "`/doc/docRequest <doc/#name=chisel_doc_request>`__".
29
29
  :param bool app: If True, include the documentation application.
30
30
  :param bool markdown_up: If True, include the MarkdownUp application.
31
31
  :returns: Generator of :class:`~chisel.Request`
@@ -34,8 +34,8 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True, mar
34
34
  root_noslash = root_path.rstrip('/')
35
35
  root_slash = root_noslash + '/'
36
36
  if api:
37
- yield DocIndex(requests=requests, urls=(('GET', root_slash + 'doc_index'),))
38
- yield DocRequest(requests=requests, urls=(('GET', root_slash + 'doc_request'),))
37
+ yield DocIndex(requests=requests, urls=(('GET', root_slash + 'docIndex'),))
38
+ yield DocRequest(requests=requests, urls=(('GET', root_slash + 'docRequest'),))
39
39
  if app:
40
40
  if root_noslash:
41
41
  yield RedirectRequest((('GET', root_noslash),), root_slash, name='chisel_doc_redirect', doc_group='Documentation')
@@ -48,15 +48,6 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True, mar
48
48
  'The Chisel documentation HTML',
49
49
  'Documentation'
50
50
  )
51
- with importlib.resources.files('chisel.static').joinpath('chiselDoc.bare').open('rb') as fh:
52
- yield StaticRequest(
53
- 'chisel_doc_app',
54
- fh.read(),
55
- 'text/plain; charset=utf-8',
56
- (('GET', root_slash + 'chiselDoc.bare'),),
57
- 'The Chisel documentation application',
58
- 'Documentation'
59
- )
60
51
  if markdown_up or app:
61
52
  parent_posix = PurePosixPath(root_path).parent
62
53
  with importlib.resources.files('chisel.static').joinpath('markdown-up.tar.gz').open('rb') as tgz:
@@ -100,7 +91,7 @@ action chisel_doc_index
100
91
  StringArray{} groups
101
92
  '''
102
93
 
103
- def __init__(self, requests=None, urls=(('GET', '/doc_index'),)):
94
+ def __init__(self, requests=None, urls=(('GET', '/docIndex'),)):
104
95
  super().__init__(self._doc_index, name='chisel_doc_index', urls=urls, spec=self.SPEC)
105
96
  if requests is not None:
106
97
  self.requests = {request.name: request for request in requests}
@@ -172,7 +163,7 @@ action chisel_doc_request
172
163
  UnknownName
173
164
  '''
174
165
 
175
- def __init__(self, requests=None, urls=(('GET', '/doc_request'),)):
166
+ def __init__(self, requests=None, urls=(('GET', '/docRequest'),)):
176
167
  super().__init__(self._doc_request, name='chisel_doc_request', urls=urls, types=dict(TYPE_MODEL), spec=self.SPEC)
177
168
  if requests is not None:
178
169
  #: Optional list of requests to document or None. If None, the applications request collection is used.
@@ -12,12 +12,11 @@
12
12
  <script type="module">
13
13
  import {MarkdownUp} from '../markdown-up/lib/appImports.js';
14
14
  const app = new MarkdownUp(window, {
15
- 'systemPrefix': '../markdown-up/include/',
16
15
  'markdownText': `\
17
16
  ~~~ markdown-script
18
- include 'chiselDoc.bare'
17
+ include <wsgiAPIDoc.bare>
19
18
 
20
- chiselDoc()
19
+ wsgiAPIDocMain()
21
20
  ~~~
22
21
  `
23
22
  });
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chisel
3
- Version: 2.4.15
3
+ Version: 2.5.1
4
4
  Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
5
5
  Author-email: "Craig A. Hobbs" <craigahobbs@gmail.com>
6
6
  License-Expression: MIT
@@ -12,6 +12,5 @@ src/chisel.egg-info/dependency_links.txt
12
12
  src/chisel.egg-info/requires.txt
13
13
  src/chisel.egg-info/top_level.txt
14
14
  src/chisel/static/__init__.py
15
- src/chisel/static/chiselDoc.bare
16
15
  src/chisel/static/index.html
17
16
  src/chisel/static/markdown-up.tar.gz
@@ -1,90 +0,0 @@
1
- # Licensed under the MIT License
2
- # https://github.com/craigahobbs/chisel/blob/main/LICENSE
3
-
4
- include <args.bare>
5
- include <schemaDoc.bare>
6
- include <url.bare>
7
-
8
-
9
- # The Chisel documentation application main entry point
10
- async function chiselDoc():
11
- args = argsParse(chiselDocArguments)
12
- name = objectGet(args, 'name')
13
- if name != null:
14
- chiselDocRequestPage(name)
15
- else:
16
- chiselDocIndexPage()
17
- endif
18
- endfunction
19
-
20
-
21
- # The Chisel documentation application arguments
22
- chiselDocArguments = argsValidate([ \
23
- {'name': 'name'} \
24
- ])
25
-
26
-
27
- # Render the Chisel documentation application index page
28
- async function chiselDocIndexPage():
29
- # Fetch the documentation index API
30
- indexURL = 'doc_index'
31
- docIndexJSON = systemFetch(indexURL)
32
- docIndex = if(docIndexJSON != null, jsonParse(docIndexJSON))
33
- if docIndex == null:
34
- markdownPrint('**Error:** Failed to fetch chisel index API "' + indexURL + '"')
35
- return
36
- endif
37
- title = objectGet(docIndex, 'title')
38
- groups = objectGet(docIndex, 'groups')
39
-
40
- # Render the index page
41
- documentSetTitle(title)
42
- markdownPrint('# ' + markdownEscape(title))
43
- for groupName in arraySort(objectKeys(groups)):
44
- markdownPrint('', '## ' + markdownEscape(groupName))
45
- for requestName in arraySort(objectGet(groups, groupName)):
46
- markdownPrint('', argsLink(chiselDocArguments, requestName, {'name': requestName}, false, '_top'))
47
- endfor
48
- endfor
49
- endfunction
50
-
51
-
52
- # Render the Chisel documentation application request page
53
- async function chiselDocRequestPage(typeName):
54
- # Fetch the request API
55
- requestURL = 'doc_request?name=' + urlEncodeComponent(typeName)
56
- docRequestJSON = systemFetch(requestURL)
57
- docRequest = if(docRequestJSON != null, jsonParse(docRequestJSON))
58
- if docRequest == null:
59
- markdownPrint('**Error:** Failed to fetch chisel request API "' + requestURL + '"')
60
- return
61
- endif
62
- doc = objectGet(docRequest, 'doc')
63
- urls = objectGet(docRequest, 'urls')
64
- types = objectGet(docRequest, 'types')
65
- custom = objectGet(docRequest, 'custom', false)
66
-
67
- # Render the request page
68
- documentSetTitle(typeName)
69
- markdownPrint(argsLink(chiselDocArguments, 'Index', {'name': null}))
70
-
71
- # Action request?
72
- if types != null:
73
- markdownPrint(schemaDocMarkdown(types, typeName, {'actionURLs': urls, 'actionCustom': custom}))
74
- return
75
- endif
76
-
77
- # Non-action request
78
- markdownPrint('', '# ' + markdownEscape(typeName))
79
- if doc != null:
80
- markdownPrint('', doc)
81
- endif
82
- if urls != null && arrayLength(urls) > 0:
83
- markdownPrint('', '**Note:** The request is exposed at the following ' + if(arrayLength(urls) == 1, 'URL:', 'URLs:'))
84
- for requestURL in urls:
85
- method = objectGet(requestURL, 'method', '')
86
- path = objectGet(requestURL, 'path')
87
- markdownPrint('', '&nbsp;&nbsp;[' + markdownEscape(method) + ' ' + markdownEscape(path) + '](' + path + ')')
88
- endfor
89
- endif
90
- endfunction
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes