chisel 1.4.0__tar.gz → 1.4.2__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.4.0/src/chisel.egg-info → chisel-1.4.2}/PKG-INFO +1 -1
- {chisel-1.4.0 → chisel-1.4.2}/setup.cfg +1 -1
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/__init__.py +1 -2
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/doc.py +17 -27
- {chisel-1.4.0 → chisel-1.4.2/src/chisel.egg-info}/PKG-INFO +1 -1
- {chisel-1.4.0 → chisel-1.4.2}/LICENSE +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/README.md +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/pyproject.toml +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/action.py +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/app.py +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/request.py +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/static/__init__.py +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/static/chiselDoc.bare +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/static/index.html +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel/static/markdown-up.tar.gz +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel.egg-info/SOURCES.txt +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel.egg-info/dependency_links.txt +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel.egg-info/requires.txt +0 -0
- {chisel-1.4.0 → chisel-1.4.2}/src/chisel.egg-info/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ Chisel documentation application
|
|
|
7
7
|
|
|
8
8
|
import importlib.resources
|
|
9
9
|
import os
|
|
10
|
-
from pathlib import
|
|
10
|
+
from pathlib import PurePosixPath
|
|
11
11
|
import tarfile
|
|
12
12
|
|
|
13
13
|
from schema_markdown import get_referenced_types
|
|
@@ -17,7 +17,7 @@ from .action import Action, ActionError
|
|
|
17
17
|
from .request import RedirectRequest, StaticRequest
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
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, markdown_up=False):
|
|
21
21
|
"""
|
|
22
22
|
Yield a series of requests for use with :meth:`~chisel.Application.add_requests` comprising the Chisel
|
|
23
23
|
documentation application. By default, the documenation application is hosted at "/doc/".
|
|
@@ -27,7 +27,8 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True):
|
|
|
27
27
|
:param str root_path: The documentation application URL root path. The default is "/doc".
|
|
28
28
|
:param bool api: If True, include the documentation APIs. Two documentation APIs are added,
|
|
29
29
|
"/doc/doc_index" and "`/doc/doc_request <doc/#name=chisel_doc_request>`__".
|
|
30
|
-
:param bool app: If True, include the documentation
|
|
30
|
+
:param bool app: If True, include the documentation application.
|
|
31
|
+
:param bool markdown_up: If True, include the MarkdownUp application.
|
|
31
32
|
:returns: Generator of :class:`~chisel.Request`
|
|
32
33
|
"""
|
|
33
34
|
|
|
@@ -57,30 +58,19 @@ def create_doc_requests(requests=None, root_path='/doc', api=True, app=True):
|
|
|
57
58
|
'The Chisel documentation application',
|
|
58
59
|
'Documentation'
|
|
59
60
|
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
)
|
|
61
|
+
if markdown_up or app:
|
|
62
|
+
parent_posix = PurePosixPath(root_path).parent
|
|
63
|
+
with importlib.resources.files('chisel.static').joinpath('markdown-up.tar.gz').open('rb') as tgz:
|
|
64
|
+
with tarfile.open(fileobj=tgz, mode='r:gz') as tar:
|
|
65
|
+
for member in tar.getmembers():
|
|
66
|
+
if member.isfile():
|
|
67
|
+
yield StaticRequest(
|
|
68
|
+
member.name,
|
|
69
|
+
tar.extractfile(member).read(),
|
|
70
|
+
content_type=_CONTENT_TYPES.get(os.path.splitext(member.name)[1], 'text/plain; charset=utf-8'),
|
|
71
|
+
urls=(('GET', str(parent_posix.joinpath(member.name))),),
|
|
72
|
+
doc_group='MarkdownUp Statics'
|
|
73
|
+
)
|
|
84
74
|
|
|
85
75
|
|
|
86
76
|
_CONTENT_TYPES = {
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|