py2docfx 0.1.3rc1683981__py3-none-any.whl → 0.1.4__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.
- py2docfx/docfx_yaml/tests/roots/test-writer-versions/code_with_version_directives.py +43 -0
- py2docfx/docfx_yaml/tests/roots/test-writer-versions/conf.py +24 -0
- py2docfx/docfx_yaml/tests/test_writer_versions.py +57 -0
- py2docfx/docfx_yaml/write_utils.py +6 -0
- py2docfx/docfx_yaml/writer.py +7 -0
- {py2docfx-0.1.3rc1683981.dist-info → py2docfx-0.1.4.dist-info}/METADATA +1 -1
- {py2docfx-0.1.3rc1683981.dist-info → py2docfx-0.1.4.dist-info}/RECORD +9 -5
- {py2docfx-0.1.3rc1683981.dist-info → py2docfx-0.1.4.dist-info}/WHEEL +0 -0
- {py2docfx-0.1.3rc1683981.dist-info → py2docfx-0.1.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
class testClassA():
|
2
|
+
"""Test Class A
|
3
|
+
|
4
|
+
some summary to ensure class parameters and constructor parametes are put in two field lists
|
5
|
+
|
6
|
+
:ivar bool var1:
|
7
|
+
description 1
|
8
|
+
|
9
|
+
.. versionadded:: 0.0.2
|
10
|
+
|
11
|
+
.. versionadded:: 0.0.1
|
12
|
+
Description versionadd
|
13
|
+
|
14
|
+
"""
|
15
|
+
def method(self) -> None:
|
16
|
+
|
17
|
+
"""
|
18
|
+
Summary
|
19
|
+
|
20
|
+
.. versionchanged:: 0.0.1
|
21
|
+
|
22
|
+
:param str param1:
|
23
|
+
Description
|
24
|
+
|
25
|
+
.. versionadded:: 1.0.0
|
26
|
+
.. versionchanged:: 0.0.3
|
27
|
+
:param param2:
|
28
|
+
description
|
29
|
+
|
30
|
+
.. versionadded:: 0.0.2
|
31
|
+
:type param2: int
|
32
|
+
:keyword bool kw1:
|
33
|
+
Description of kw1
|
34
|
+
|
35
|
+
.. versionadded:: 0.0.2
|
36
|
+
.. versionchanged:: 0.0.3
|
37
|
+
.. versionadded:: 0.1.0
|
38
|
+
description 1
|
39
|
+
.. versionadded:: 0.2.0
|
40
|
+
description 2
|
41
|
+
.. deprecated:: 1.1.0
|
42
|
+
"""
|
43
|
+
pass
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
|
4
|
+
sys.path.insert(0, os.path.abspath('.'))
|
5
|
+
|
6
|
+
extensions = ["sphinx.ext.autodoc","sphinx.ext.napoleon", 'yaml_builder']
|
7
|
+
|
8
|
+
class includeTest:
|
9
|
+
pass
|
10
|
+
|
11
|
+
# The suffix of source filenames.
|
12
|
+
source_suffix = '.rst'
|
13
|
+
|
14
|
+
autodoc_mock_imports = [
|
15
|
+
'dummy'
|
16
|
+
]
|
17
|
+
|
18
|
+
pygments_style = 'sphinx'
|
19
|
+
|
20
|
+
napoleon_use_admonition_for_examples = True
|
21
|
+
|
22
|
+
nitpicky = True
|
23
|
+
|
24
|
+
autoclass_content = 'both'
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import pytest
|
2
|
+
from sphinx.testing import restructuredtext
|
3
|
+
from sphinx.io import SphinxStandaloneReader
|
4
|
+
from sphinx import addnodes
|
5
|
+
|
6
|
+
from translator import translator
|
7
|
+
from py2docfx.docfx_yaml.tests.utils.test_utils import prepare_app_envs,prepare_refered_objects,load_rst_transform_to_doctree
|
8
|
+
|
9
|
+
def helper_assert_summary_contains_italic(summary, enclosed):
|
10
|
+
assert '*' + enclosed + '*' in summary.replace('\n','')
|
11
|
+
|
12
|
+
@pytest.mark.sphinx('yaml', testroot='writer-versions')
|
13
|
+
def test_version_directives_should_be_italic(app):
|
14
|
+
# Test data definition
|
15
|
+
objectToGenXml = 'code_with_version_directives.testClassA'
|
16
|
+
objectToGenXmlType = 'class'
|
17
|
+
|
18
|
+
# Arrange
|
19
|
+
prepare_app_envs(app, objectToGenXml)
|
20
|
+
doctree = load_rst_transform_to_doctree(app, objectToGenXmlType, objectToGenXml)
|
21
|
+
|
22
|
+
# Act
|
23
|
+
translator(app, '', doctree)
|
24
|
+
|
25
|
+
helper_assert_summary_contains_italic(
|
26
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA']['summary'],
|
27
|
+
'New in version 0.0.1:')
|
28
|
+
helper_assert_summary_contains_italic(
|
29
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA']['variables'][0]['description'],
|
30
|
+
'New in version 0.0.2.')
|
31
|
+
helper_assert_summary_contains_italic(
|
32
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['summary'],
|
33
|
+
'Changed in version 0.0.1.')
|
34
|
+
helper_assert_summary_contains_italic(
|
35
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['summary'],
|
36
|
+
'New in version 0.1.0:')
|
37
|
+
helper_assert_summary_contains_italic(
|
38
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['summary'],
|
39
|
+
'New in version 0.2.0:')
|
40
|
+
helper_assert_summary_contains_italic(
|
41
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['summary'],
|
42
|
+
'Deprecated since version 1.1.0.')
|
43
|
+
helper_assert_summary_contains_italic(
|
44
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['parameters'][0]['description'],
|
45
|
+
'New in version 1.0.0.')
|
46
|
+
helper_assert_summary_contains_italic(
|
47
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['parameters'][0]['description'],
|
48
|
+
'Changed in version 0.0.3.')
|
49
|
+
helper_assert_summary_contains_italic(
|
50
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['parameters'][1]['description'],
|
51
|
+
'New in version 0.0.2.')
|
52
|
+
helper_assert_summary_contains_italic(
|
53
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['keywordOnlyParameters'][0]['description'],
|
54
|
+
'New in version 0.0.2.')
|
55
|
+
helper_assert_summary_contains_italic(
|
56
|
+
app.env.docfx_info_field_data['code_with_version_directives.testClassA.method']['keywordOnlyParameters'][0]['description'],
|
57
|
+
'Changed in version 0.0.3.')
|
py2docfx/docfx_yaml/writer.py
CHANGED
@@ -31,6 +31,7 @@ from sphinx import addnodes
|
|
31
31
|
from sphinx.locale import admonitionlabels
|
32
32
|
|
33
33
|
from nodes import remarks
|
34
|
+
import write_utils
|
34
35
|
|
35
36
|
class bcolors:
|
36
37
|
HEADER = '\033[95m'
|
@@ -1044,6 +1045,8 @@ class MarkdownTranslator(nodes.NodeVisitor):
|
|
1044
1045
|
|
1045
1046
|
def visit_Text(self, node):
|
1046
1047
|
text = self.replace_special_unicode(node.astext())
|
1048
|
+
if write_utils.is_inline_text_children_of_versionmodified(node.parent):
|
1049
|
+
text = text.strip(' ')
|
1047
1050
|
self.add_text(text)
|
1048
1051
|
|
1049
1052
|
def depart_Text(self, node):
|
@@ -1058,10 +1061,14 @@ class MarkdownTranslator(nodes.NodeVisitor):
|
|
1058
1061
|
def visit_inline(self, node):
|
1059
1062
|
if 'xref' in node['classes'] or 'term' in node['classes']:
|
1060
1063
|
self.add_text('*')
|
1064
|
+
elif write_utils.is_inline_text_children_of_versionmodified(node):
|
1065
|
+
self.add_text('*')
|
1061
1066
|
|
1062
1067
|
def depart_inline(self, node):
|
1063
1068
|
if 'xref' in node['classes'] or 'term' in node['classes']:
|
1064
1069
|
self.add_text('*')
|
1070
|
+
elif write_utils.is_inline_text_children_of_versionmodified(node):
|
1071
|
+
self.add_text('* ')
|
1065
1072
|
|
1066
1073
|
def visit_container(self, node):
|
1067
1074
|
pass
|
@@ -69,7 +69,8 @@ py2docfx/docfx_yaml/return_type_utils.py,sha256=nmdCUOvwdYk2jF6RqmOvU6gjXmXUTPUe
|
|
69
69
|
py2docfx/docfx_yaml/settings.py,sha256=JQZNwFebczl-zn8Yk2taAGANRi-Hw8hywtDWxqXXFyQ,373
|
70
70
|
py2docfx/docfx_yaml/translator.py,sha256=li20Sdu-j1V7oK1iaxWw9mo0KSJOlh4FLSnwmu6UxBQ,25912
|
71
71
|
py2docfx/docfx_yaml/utils.py,sha256=m5jC_qP2NKqzUx_z0zgZ-HAmxQdNTpJYKkL_F9vGeII,1555
|
72
|
-
py2docfx/docfx_yaml/
|
72
|
+
py2docfx/docfx_yaml/write_utils.py,sha256=q5qoYWw6GVDV8a3E8IxcSLWnN9sAer42VFRgadHBkgk,305
|
73
|
+
py2docfx/docfx_yaml/writer.py,sha256=BQ02TshJM7O53_n07i_DJ-WtI7PYNyBJ2OLzivq4iiA,35037
|
73
74
|
py2docfx/docfx_yaml/yaml_builder.py,sha256=qSxXVS4iFCc1ZdL5QzLrv8hy3LHIQCrhO4WcTp01vag,2575
|
74
75
|
py2docfx/docfx_yaml/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
76
|
py2docfx/docfx_yaml/tests/conftest.py,sha256=CykkZxaDZ-3a1EIQdGBieSmHL9FdyTE2xTJZe9QgKcg,1214
|
@@ -86,6 +87,7 @@ py2docfx/docfx_yaml/tests/test_translator_rst_returns.py,sha256=BL3nOMMTPzNPJk-P
|
|
86
87
|
py2docfx/docfx_yaml/tests/test_translator_signatures.py,sha256=DM51EOb4UXLkrO1-4cQQQvvX210goAsnxKJH-4A2U2Q,1537
|
87
88
|
py2docfx/docfx_yaml/tests/test_writer_table.py,sha256=UnGYXQ-QVxin_e-HGZAHdg1LSFV0qc480ZNsqPN9OYc,1444
|
88
89
|
py2docfx/docfx_yaml/tests/test_writer_uri.py,sha256=L9eFHZndD6H7nkznJ9Bw0v8xh9IegDlhhGFHBz9EHmM,1745
|
90
|
+
py2docfx/docfx_yaml/tests/test_writer_versions.py,sha256=0-0VTMhbZ4ml9ryu1gYnu0mM2yIEKsBuFYb2F6grzTE,2995
|
89
91
|
py2docfx/docfx_yaml/tests/roots/test-build-finished/code_with_signature_and_docstring.py,sha256=qvcKWL68C2aDTP8JT022nMV4EdZ50vhxVshMrHVO2sY,449
|
90
92
|
py2docfx/docfx_yaml/tests/roots/test-build-finished/conf.py,sha256=L8vIFmO546PCQks50Gif_uTBwC3cppohXrQaogfyRF8,410
|
91
93
|
py2docfx/docfx_yaml/tests/roots/test-method-arguments/code_with_all_arg_types.py,sha256=jK4M4ejeVWedhHJ_s9L9wEEqJmk0wOF8-yuoIaA6fZU,322
|
@@ -118,8 +120,10 @@ py2docfx/docfx_yaml/tests/roots/test-writer-table/code_with_table_desc.py,sha256
|
|
118
120
|
py2docfx/docfx_yaml/tests/roots/test-writer-table/conf.py,sha256=avcbnIOV2mlGQwhMQJZC4W6UGRBRhnq1QBxjPWlySxQ,260
|
119
121
|
py2docfx/docfx_yaml/tests/roots/test-writer-uri/code_with_uri.py,sha256=bzWTZpY2yf_By2bOSl1GFaY3BsZpkAvwQuGztlcHKkQ,537
|
120
122
|
py2docfx/docfx_yaml/tests/roots/test-writer-uri/conf.py,sha256=avcbnIOV2mlGQwhMQJZC4W6UGRBRhnq1QBxjPWlySxQ,260
|
123
|
+
py2docfx/docfx_yaml/tests/roots/test-writer-versions/code_with_version_directives.py,sha256=UuizbrJPaG_PcaH18BvbI9KQevOaLd4SslpnzMSqcrE,1030
|
124
|
+
py2docfx/docfx_yaml/tests/roots/test-writer-versions/conf.py,sha256=SCEKrm9VigArfdgf-GAieJD-40d0ctT6urmGIjFOZLM,404
|
121
125
|
py2docfx/docfx_yaml/tests/utils/test_utils.py,sha256=d0OYSUQ6NyoZx5mlLdNGGNhiNmmQhjVT4hQ6jY3VE_M,3383
|
122
|
-
py2docfx-0.1.
|
123
|
-
py2docfx-0.1.
|
124
|
-
py2docfx-0.1.
|
125
|
-
py2docfx-0.1.
|
126
|
+
py2docfx-0.1.4.dist-info/METADATA,sha256=zAcVIHMUEILG27sqpj5-Ger1BeKR2gFzTGnu8IxMp9E,590
|
127
|
+
py2docfx-0.1.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
128
|
+
py2docfx-0.1.4.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
|
129
|
+
py2docfx-0.1.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|