sc-oa 0.7.0.15__py3-none-any.whl → 0.7.0.16__py3-none-any.whl

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.

Potentially problematic release.


This version of sc-oa might be problematic. Click here for more details.

@@ -1,37 +1,36 @@
1
- Metadata-Version: 2.4
2
- Name: sc-oa
3
- Version: 0.7.0.15
4
- Summary: Fork of the OpenAPI (fka Swagger) spec renderer for Sphinx
5
- Home-page: https://github.com/olivier-heurtier/sphinxcontrib-openapi/tree/mymaster
6
- Author: Ihor Kalnytskyi
7
- Olivier Heurtier
8
- Author-email: ihor@kalnytskyi.com
9
- License: BSD
10
- Classifier: Topic :: Documentation
11
- Classifier: Topic :: Documentation :: Sphinx
12
- Classifier: License :: OSI Approved :: BSD License
13
- Classifier: Environment :: Console
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3 :: Only
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.9
21
- Classifier: Programming Language :: Python :: 3.10
22
- Classifier: Programming Language :: Python :: 3.11
23
- Classifier: Programming Language :: Python :: 3.12
24
- Classifier: Programming Language :: Python :: Implementation :: CPython
25
- Classifier: Framework :: Sphinx
26
- Classifier: Framework :: Sphinx :: Extension
27
- Requires-Python: >=3.8
28
- License-File: LICENSE
29
- Requires-Dist: sphinx
30
- Requires-Dist: sphinxcontrib-httpdomain
31
- Requires-Dist: PyYAML
32
- Requires-Dist: jsonschema
33
- Requires-Dist: m2r2
34
- Requires-Dist: picobox
35
- Requires-Dist: deepmerge
36
- Requires-Dist: setuptools
37
- Dynamic: license-file
1
+ Metadata-Version: 2.4
2
+ Name: sc-oa
3
+ Version: 0.7.0.16
4
+ Summary: Fork of the OpenAPI (fka Swagger) spec renderer for Sphinx
5
+ Home-page: https://github.com/olivier-heurtier/sphinxcontrib-openapi/tree/mymaster
6
+ Author: Olivier Heurtier
7
+ Author-email: olivier.heurtier@github.com
8
+ License: BSD
9
+ Classifier: Topic :: Documentation
10
+ Classifier: Topic :: Documentation :: Sphinx
11
+ Classifier: License :: OSI Approved :: BSD License
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: Implementation :: CPython
24
+ Classifier: Framework :: Sphinx
25
+ Classifier: Framework :: Sphinx :: Extension
26
+ Requires-Python: >=3.8
27
+ License-File: LICENSE
28
+ Requires-Dist: sphinx
29
+ Requires-Dist: sphinxcontrib-httpdomain
30
+ Requires-Dist: PyYAML
31
+ Requires-Dist: jsonschema
32
+ Requires-Dist: m2r2
33
+ Requires-Dist: picobox
34
+ Requires-Dist: deepmerge
35
+ Requires-Dist: setuptools
36
+ Dynamic: license-file
@@ -0,0 +1,26 @@
1
+ sc_oa-0.7.0.16.dist-info/licenses/LICENSE,sha256=Fe9eBZy-tUN-UOMSVfcr4c-MWpuWa4gTKTqH-kSeck4,1319
2
+ sphinxcontrib/__init__.py,sha256=Es10gRADmbGSJZnYYmhfgA_2QzHQDmhj0IAft3kS1Og,259
3
+ sphinxcontrib/openapi/__init__.py,sha256=x8cvrnXGqjZSc62nkeZC0KdCcCSXQY8uxv1kFhrPM18,3088
4
+ sphinxcontrib/openapi/__main__.py,sha256=cp8p7qGn8nH2W_aeD9sMTuqPwLV3ys8DtLYZnyF29pY,2436
5
+ sphinxcontrib/openapi/_lib2to3.py,sha256=mU2Dx78xEyiz0cfcj3R9eqiwHbCfspK5cDJ5ZwwQdA4,13624
6
+ sphinxcontrib/openapi/directive.py,sha256=J4T0n_KkM6SB1Mr9GeYCVqWZNp3BMSjEnVvLvwj8CoM,2059
7
+ sphinxcontrib/openapi/openapi20.py,sha256=FDdlcRIYKCynOZUjxQNoE8lCFRrZinmYu1khz8D18ZU,8984
8
+ sphinxcontrib/openapi/openapi30.py,sha256=tW5pZoP-lR8ZUrwCsKDB_DXdOzoMdyYL1Irjd6mwdBM,29132
9
+ sphinxcontrib/openapi/schema_utils.py,sha256=pxdB5qSTAtiCFmmF04R0zlOOG-Dxi98qwrA2uLZcNXA,4446
10
+ sphinxcontrib/openapi/utils.py,sha256=oRWNDb_5KWTXOVblFgvrLvmGATae8C7PYvk1xc464vY,4343
11
+ sphinxcontrib/openapi/locale/openapi.pot,sha256=sGo7dIRUUS6Ne4MRIU7PCphOoQG1AORgZhwwpD0nRfo,3831
12
+ sphinxcontrib/openapi/locale/es_ES/LC_MESSAGES/openapi.mo,sha256=qdW6yFaSVB_BsexvwM33U8X12yoHikgaI8N7a4U_gI4,1919
13
+ sphinxcontrib/openapi/locale/es_ES/LC_MESSAGES/openapi.po,sha256=dB6_HK0ubCauj1LZbs-zz0NNcPkm4eqKIuxZtqD71WU,4357
14
+ sphinxcontrib/openapi/locale/fr_FR/LC_MESSAGES/openapi.mo,sha256=YS2uZZZ4bHpDXJmShv33NZhtIWcir9-qERusNDR-vqY,1956
15
+ sphinxcontrib/openapi/locale/fr_FR/LC_MESSAGES/openapi.po,sha256=_rpbU9BhwTI2vXFcgj-BdiC-5LhUphYvHtoU1jPHT4Y,4400
16
+ sphinxcontrib/openapi/renderers/__init__.py,sha256=8hdY-sLK5kDbOL8Tqe55xEBphPFXVCNj6eUA3lTvD8s,408
17
+ sphinxcontrib/openapi/renderers/_description.py,sha256=FAklhEaMksCYU5bno3SO0RuQCcwVTXbqPmPN3PrRlTM,702
18
+ sphinxcontrib/openapi/renderers/_httpdomain.py,sha256=qx6pIVQF2BKWjrL1YOap1_2odtLAqk5SeuktofdOMRQ,24546
19
+ sphinxcontrib/openapi/renderers/_httpdomain_old.py,sha256=aiWafD8LdRmCtG6ewkU3xF-P1oWxxYxUNzdcUFW4hB4,2632
20
+ sphinxcontrib/openapi/renderers/_model.py,sha256=yoU265jAgkiW_Ew4EFiWuzA8Q56AsmYa4HBODJDA2bw,15441
21
+ sphinxcontrib/openapi/renderers/_toc.py,sha256=0cVLyKJBcu4ULkiBdlQ-oMBWV4DVCVM5-BgT07xG0Fc,1478
22
+ sphinxcontrib/openapi/renderers/abc.py,sha256=-irO9yVoHeygaMieq4DZMmWD0B5DkDu2mKuenGYopTI,1485
23
+ sc_oa-0.7.0.16.dist-info/METADATA,sha256=-slypLDLtwQjPS6hf10JVBTE1Fwic_tZUAmPrlV-ORM,1360
24
+ sc_oa-0.7.0.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ sc_oa-0.7.0.16.dist-info/top_level.txt,sha256=VJrV3_vaiKQVgVpR0I1iecxoO0drzGu-M0j40PVP2QQ,14
26
+ sc_oa-0.7.0.16.dist-info/RECORD,,
@@ -1,23 +1,23 @@
1
- Copyright (c) 2016, Igor Kalnitsky <igor@kalnitsky.org>.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
-
14
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ Copyright (c) 2016, Igor Kalnitsky <igor@kalnitsky.org>.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sphinxcontrib/__init__.py CHANGED
@@ -1,10 +1,10 @@
1
- """
2
- sphinxcontrib
3
- ~~~~~~~~~~~~~
4
-
5
- This package is a namespace package that contains all extensions
6
- distributed in the ``sphinx-contrib`` distribution.
7
-
8
- :copyright: (c) 2016 by Igor Kalnitsky.
9
- :license: BSD, see LICENSE for details.
10
- """
1
+ """
2
+ sphinxcontrib
3
+ ~~~~~~~~~~~~~
4
+
5
+ This package is a namespace package that contains all extensions
6
+ distributed in the ``sphinx-contrib`` distribution.
7
+
8
+ :copyright: (c) 2016 by Igor Kalnitsky.
9
+ :license: BSD, see LICENSE for details.
10
+ """
@@ -1,93 +1,93 @@
1
- """get_distribution
2
- sphinxcontrib.openapi
3
- ---------------------
4
-
5
- The OpenAPI spec renderer for Sphinx. It's a new way to document your
6
- RESTful API. Based on ``sphinxcontrib-httpdomain``.
7
-
8
- :copyright: (c) 2016, Ihor Kalnytskyi.
9
- :license: BSD, see LICENSE for details.
10
- """
11
-
12
- import os
13
- from importlib.metadata import distribution, PackageNotFoundError
14
- from sphinxcontrib.openapi import renderers, directive
15
- from sphinx.domains import Domain
16
- import yaml
17
- from docutils import nodes
18
-
19
- try:
20
- __version__ = distribution(__name__).version
21
- except PackageNotFoundError:
22
- # package is not installed
23
- __version__ = None
24
-
25
-
26
- _DEFAULT_RENDERER_NAME = "httpdomain:old"
27
-
28
-
29
- def oasversion_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
30
- fn = text
31
- env = inliner.document.settings.env
32
- rel_fn, fn = env.relfn2path(fn)
33
- y = yaml.load(open(fn, 'r').read(), Loader=yaml.FullLoader)
34
- s = y['info']['version']
35
- retnode = nodes.inline(text=s, role=typ.lower(), classes=[typ])
36
- return [retnode], []
37
-
38
-
39
- class OpenAPIDomain(Domain):
40
- name = 'openapi'
41
- label = 'OpenAPI Documentation'
42
-
43
- directives = {
44
- 'httpdomain:old': directive.create_directive_from_renderer(
45
- renderers.HttpdomainOldRenderer),
46
- 'httpdomain': directive.create_directive_from_renderer(renderers.HttpdomainRenderer),
47
- 'model': directive.create_directive_from_renderer(renderers.ModelRenderer),
48
- 'toc': directive.create_directive_from_renderer(renderers.TocRenderer),
49
- 'description': directive.create_directive_from_renderer(renderers.DescriptionRenderer),
50
- }
51
-
52
- roles = {
53
- 'version': oasversion_role
54
- }
55
-
56
-
57
- def setup(app):
58
- app.add_config_value("openapi_default_renderer", _DEFAULT_RENDERER_NAME, "html")
59
- app.add_config_value("openapi_renderers", {}, "html")
60
-
61
- package_dir = os.path.abspath(os.path.dirname(__file__))
62
- locale_dir = os.path.join(package_dir, 'locale')
63
- app.add_message_catalog('openapi', locale_dir)
64
-
65
- from sphinxcontrib import httpdomain
66
-
67
- for idx, fieldtype in enumerate(httpdomain.HTTPResource.doc_field_types):
68
- if fieldtype.name == 'requestheader':
69
- httpdomain.HTTPResource.doc_field_types[idx] = httpdomain.TypedField(
70
- fieldtype.name,
71
- label=fieldtype.label,
72
- names=fieldtype.names,
73
- typerolename='header',
74
- typenames=('reqheadertype', ),
75
- )
76
-
77
- if fieldtype.name == 'responseheader':
78
- httpdomain.HTTPResource.doc_field_types[idx] = httpdomain.TypedField(
79
- fieldtype.name,
80
- label=fieldtype.label,
81
- names=fieldtype.names,
82
- typerolename='header',
83
- typenames=('resheadertype', ),
84
- )
85
-
86
- app.setup_extension("sphinxcontrib.httpdomain")
87
- app.add_domain(OpenAPIDomain)
88
- app.add_directive(
89
- "openapi",
90
- directive.create_directive_from_renderer(renderers.HttpdomainOldRenderer)
91
- )
92
-
93
- return {"version": __version__, "parallel_read_safe": True}
1
+ """get_distribution
2
+ sphinxcontrib.openapi
3
+ ---------------------
4
+
5
+ The OpenAPI spec renderer for Sphinx. It's a new way to document your
6
+ RESTful API. Based on ``sphinxcontrib-httpdomain``.
7
+
8
+ :copyright: (c) 2016, Ihor Kalnytskyi.
9
+ :license: BSD, see LICENSE for details.
10
+ """
11
+
12
+ import os
13
+ from importlib.metadata import distribution, PackageNotFoundError
14
+ from sphinxcontrib.openapi import renderers, directive
15
+ from sphinx.domains import Domain
16
+ import yaml
17
+ from docutils import nodes
18
+
19
+ try:
20
+ __version__ = distribution(__name__).version
21
+ except PackageNotFoundError:
22
+ # package is not installed
23
+ __version__ = None
24
+
25
+
26
+ _DEFAULT_RENDERER_NAME = "httpdomain:old"
27
+
28
+
29
+ def oasversion_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
30
+ fn = text
31
+ env = inliner.document.settings.env
32
+ rel_fn, fn = env.relfn2path(fn)
33
+ y = yaml.load(open(fn, 'r').read(), Loader=yaml.FullLoader)
34
+ s = y['info']['version']
35
+ retnode = nodes.inline(text=s, role=typ.lower(), classes=[typ])
36
+ return [retnode], []
37
+
38
+
39
+ class OpenAPIDomain(Domain):
40
+ name = 'openapi'
41
+ label = 'OpenAPI Documentation'
42
+
43
+ directives = {
44
+ 'httpdomain:old': directive.create_directive_from_renderer(
45
+ renderers.HttpdomainOldRenderer),
46
+ 'httpdomain': directive.create_directive_from_renderer(renderers.HttpdomainRenderer),
47
+ 'model': directive.create_directive_from_renderer(renderers.ModelRenderer),
48
+ 'toc': directive.create_directive_from_renderer(renderers.TocRenderer),
49
+ 'description': directive.create_directive_from_renderer(renderers.DescriptionRenderer),
50
+ }
51
+
52
+ roles = {
53
+ 'version': oasversion_role
54
+ }
55
+
56
+
57
+ def setup(app):
58
+ app.add_config_value("openapi_default_renderer", _DEFAULT_RENDERER_NAME, "html")
59
+ app.add_config_value("openapi_renderers", {}, "html")
60
+
61
+ package_dir = os.path.abspath(os.path.dirname(__file__))
62
+ locale_dir = os.path.join(package_dir, 'locale')
63
+ app.add_message_catalog('openapi', locale_dir)
64
+
65
+ from sphinxcontrib import httpdomain
66
+
67
+ for idx, fieldtype in enumerate(httpdomain.HTTPResource.doc_field_types):
68
+ if fieldtype.name == 'requestheader':
69
+ httpdomain.HTTPResource.doc_field_types[idx] = httpdomain.TypedField(
70
+ fieldtype.name,
71
+ label=fieldtype.label,
72
+ names=fieldtype.names,
73
+ typerolename='header',
74
+ typenames=('reqheadertype', ),
75
+ )
76
+
77
+ if fieldtype.name == 'responseheader':
78
+ httpdomain.HTTPResource.doc_field_types[idx] = httpdomain.TypedField(
79
+ fieldtype.name,
80
+ label=fieldtype.label,
81
+ names=fieldtype.names,
82
+ typerolename='header',
83
+ typenames=('resheadertype', ),
84
+ )
85
+
86
+ app.setup_extension("sphinxcontrib.httpdomain")
87
+ app.add_domain(OpenAPIDomain)
88
+ app.add_directive(
89
+ "openapi",
90
+ directive.create_directive_from_renderer(renderers.HttpdomainOldRenderer)
91
+ )
92
+
93
+ return {"version": __version__, "parallel_read_safe": True}
@@ -1,86 +1,86 @@
1
- import argparse
2
- import logging
3
-
4
- from sphinxcontrib.openapi import directive, renderers
5
-
6
-
7
- def main():
8
- parser = argparse.ArgumentParser(
9
- prog='oas2rst',
10
- description='Export OpenAPI Specification files to reStructuredText \
11
- files')
12
- parser.add_argument(
13
- "-l", "--level",
14
- action='store',
15
- default=logging.INFO,
16
- dest='level',
17
- help="Logging level")
18
- parser.add_argument(
19
- "-e", "--encoding",
20
- action='store',
21
- default="UTF-8",
22
- dest='encoding',
23
- help="Source file encoding")
24
- parser.add_argument(
25
- "-p", "--paths",
26
- action='append',
27
- dest='paths',
28
- help="Endpoints to be rendered")
29
- parser.add_argument(
30
- "-x", "--examples",
31
- action='store_true',
32
- dest='examples',
33
- help="Include examples")
34
- parser.add_argument(
35
- "--group-examples",
36
- action='store_true',
37
- dest='group_examples',
38
- help="Group examples after the operation description")
39
- parser.add_argument(
40
- "-E", "--entities",
41
- action='store_true',
42
- dest='entities',
43
- help="Include links to entities")
44
- parser.add_argument(
45
- "-g", "--group",
46
- action='store_true',
47
- dest='group',
48
- help="Group paths by tag")
49
- parser.add_argument(
50
- "-i", "--input",
51
- dest='input',
52
- required=True,
53
- help="Input file")
54
- parser.add_argument(
55
- "-o", "--output",
56
- type=argparse.FileType('w'),
57
- required=True,
58
- dest='output',
59
- help="Output file")
60
-
61
- options = parser.parse_args()
62
- logging.getLogger().setLevel(options.level)
63
-
64
- openapi_options = {}
65
- if options.paths:
66
- openapi_options['paths'] = options.paths
67
- if options.examples:
68
- openapi_options['examples'] = True
69
- if options.group_examples:
70
- openapi_options['group_examples'] = True
71
- if options.entities:
72
- openapi_options['entities'] = True
73
- if options.group:
74
- openapi_options['group'] = True
75
-
76
- openapi_options.setdefault('uri', 'file://%s' % options.input)
77
- spec = directive._get_spec(options.input, options.encoding)
78
- renderer = renderers.HttpdomainOldRenderer(None, openapi_options)
79
-
80
- for line in renderer.render_restructuredtext_markup(spec):
81
- options.output.write(line+'\n')
82
- logging.debug(line)
83
-
84
-
85
- if __name__ == '__main__':
86
- main()
1
+ import argparse
2
+ import logging
3
+
4
+ from sphinxcontrib.openapi import directive, renderers
5
+
6
+
7
+ def main():
8
+ parser = argparse.ArgumentParser(
9
+ prog='oas2rst',
10
+ description='Export OpenAPI Specification files to reStructuredText \
11
+ files')
12
+ parser.add_argument(
13
+ "-l", "--level",
14
+ action='store',
15
+ default=logging.INFO,
16
+ dest='level',
17
+ help="Logging level")
18
+ parser.add_argument(
19
+ "-e", "--encoding",
20
+ action='store',
21
+ default="UTF-8",
22
+ dest='encoding',
23
+ help="Source file encoding")
24
+ parser.add_argument(
25
+ "-p", "--paths",
26
+ action='append',
27
+ dest='paths',
28
+ help="Endpoints to be rendered")
29
+ parser.add_argument(
30
+ "-x", "--examples",
31
+ action='store_true',
32
+ dest='examples',
33
+ help="Include examples")
34
+ parser.add_argument(
35
+ "--group-examples",
36
+ action='store_true',
37
+ dest='group_examples',
38
+ help="Group examples after the operation description")
39
+ parser.add_argument(
40
+ "-E", "--entities",
41
+ action='store_true',
42
+ dest='entities',
43
+ help="Include links to entities")
44
+ parser.add_argument(
45
+ "-g", "--group",
46
+ action='store_true',
47
+ dest='group',
48
+ help="Group paths by tag")
49
+ parser.add_argument(
50
+ "-i", "--input",
51
+ dest='input',
52
+ required=True,
53
+ help="Input file")
54
+ parser.add_argument(
55
+ "-o", "--output",
56
+ type=argparse.FileType('w'),
57
+ required=True,
58
+ dest='output',
59
+ help="Output file")
60
+
61
+ options = parser.parse_args()
62
+ logging.getLogger().setLevel(options.level)
63
+
64
+ openapi_options = {}
65
+ if options.paths:
66
+ openapi_options['paths'] = options.paths
67
+ if options.examples:
68
+ openapi_options['examples'] = True
69
+ if options.group_examples:
70
+ openapi_options['group_examples'] = True
71
+ if options.entities:
72
+ openapi_options['entities'] = True
73
+ if options.group:
74
+ openapi_options['group'] = True
75
+
76
+ openapi_options.setdefault('uri', 'file://%s' % options.input)
77
+ spec = directive._get_spec(options.input, options.encoding)
78
+ renderer = renderers.HttpdomainOldRenderer(None, openapi_options)
79
+
80
+ for line in renderer.render_restructuredtext_markup(spec):
81
+ options.output.write(line+'\n')
82
+ logging.debug(line)
83
+
84
+
85
+ if __name__ == '__main__':
86
+ main()