py2docfx 0.1.11.dev1912073__py3-none-any.whl → 0.1.11.dev1917708__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.
@@ -17,5 +17,12 @@ class SampleClass():
17
17
  """
18
18
  pass
19
19
 
20
+ def dummy_summary3(self):
21
+ """
22
+ This is a bare URL that shouldn't be transformed into a link
23
+ because it's in the exclusion list: https://management.azure.com
24
+ """
25
+ pass
26
+
20
27
  pass
21
28
 
@@ -20,6 +20,7 @@ def test_http_link_in_summary_should_not_nest_parenthesis(app):
20
20
  class_summary_result = transform_node(app, doctree[1][1][0])
21
21
  method1_summary_result = transform_node(app, doctree[1][1][2][1])
22
22
  method2_summary_result = transform_node(app, doctree[1][1][4][1])
23
+ method3_summary_result = transform_node(app, doctree[1][1][6][1])
23
24
 
24
25
  # Assert
25
26
  # Shouldn't see something like [title]((link))
@@ -28,7 +29,10 @@ def test_http_link_in_summary_should_not_nest_parenthesis(app):
28
29
  "We should not generate nested parenthesis causing docs validation warnings\n")
29
30
  method2_summary_expected = ("\n\n This isn't a content issue link ([https://www.microsoft.com](https://www.microsoft.com))\n "
30
31
  "Should expect a transformed Markdown link.\n")
32
+ method3_summary_expected = ("\n\n This is a bare URL that shouldn't be transformed into a link\n "
33
+ "because it's in the exclusion list: https://management.azure.com\n")
31
34
  assert(class_summary_expected == class_summary_result)
32
35
  assert(method1_summary_expected == method1_summary_result)
33
36
  assert(method2_summary_expected == method2_summary_result)
37
+ assert(method3_summary_expected == method3_summary_result)
34
38
 
@@ -183,6 +183,15 @@ class MarkdownTranslator(nodes.NodeVisitor):
183
183
  sectionchars = '*=-~"+`'
184
184
  xref_template = "<xref:{0}>"
185
185
 
186
+ # URLs that shouldn't be automatically rendered as hyperlinks if found bare. Included because they appear
187
+ # frequently, get flagged by the broken link validator and/or there's no value to the user in
188
+ # making them clickable links.
189
+ urls_that_shouldnt_be_rendered_as_links = {
190
+ "https://management.azure.com",
191
+ "https://management.chinacloudapi.cn",
192
+ "https://management.usgovcloudapi.net"
193
+ }
194
+
186
195
  def __init__(self, document, builder):
187
196
  self.invdata = []
188
197
  nodes.NodeVisitor.__init__(self, document)
@@ -925,7 +934,10 @@ class MarkdownTranslator(nodes.NodeVisitor):
925
934
  match_content_issue_pattern = True
926
935
  ref_string = node.attributes["refuri"]
927
936
  if not match_content_issue_pattern:
928
- ref_string = '[{}]({})'.format(node.astext(), node.attributes['refuri'])
937
+ if inner_text == node.attributes['refuri'] and inner_text in cls.urls_that_shouldnt_be_rendered_as_links:
938
+ ref_string = inner_text
939
+ else:
940
+ ref_string = '[{}]({})'.format(node.astext(), node.attributes['refuri'])
929
941
  else:
930
942
  # only use id in class and func refuri if its id exists
931
943
  # otherwise, remove '.html#' in refuri
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2docfx
3
- Version: 0.1.11.dev1912073
3
+ Version: 0.1.11.dev1917708
4
4
  Summary: A package built based on Sphinx which download source code package and generate yaml files supported by docfx.
5
5
  Author: Microsoft Corporation
6
6
  License: MIT License
@@ -70,7 +70,7 @@ py2docfx/docfx_yaml/settings.py,sha256=JQZNwFebczl-zn8Yk2taAGANRi-Hw8hywtDWxqXXF
70
70
  py2docfx/docfx_yaml/translator.py,sha256=IXxrOEF2L1gZjGciimyrNHRHQUf1Xy3vr2UUR5i2vyM,25961
71
71
  py2docfx/docfx_yaml/utils.py,sha256=m5jC_qP2NKqzUx_z0zgZ-HAmxQdNTpJYKkL_F9vGeII,1555
72
72
  py2docfx/docfx_yaml/write_utils.py,sha256=q5qoYWw6GVDV8a3E8IxcSLWnN9sAer42VFRgadHBkgk,305
73
- py2docfx/docfx_yaml/writer.py,sha256=BQ02TshJM7O53_n07i_DJ-WtI7PYNyBJ2OLzivq4iiA,35037
73
+ py2docfx/docfx_yaml/writer.py,sha256=UMdqVym5WJVLuNOfB1o9Xh7jgwVTtpKutjly4Ts6OAo,35689
74
74
  py2docfx/docfx_yaml/yaml_builder.py,sha256=qSxXVS4iFCc1ZdL5QzLrv8hy3LHIQCrhO4WcTp01vag,2575
75
75
  py2docfx/docfx_yaml/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  py2docfx/docfx_yaml/tests/conftest.py,sha256=CykkZxaDZ-3a1EIQdGBieSmHL9FdyTE2xTJZe9QgKcg,1214
@@ -86,7 +86,7 @@ py2docfx/docfx_yaml/tests/test_translator_numpy_returns.py,sha256=nmC70WUqCRcB1t
86
86
  py2docfx/docfx_yaml/tests/test_translator_rst_returns.py,sha256=BL3nOMMTPzNPJk-P9oMANiXnJ7ocuiecbFHH4DU1n40,2942
87
87
  py2docfx/docfx_yaml/tests/test_translator_signatures.py,sha256=DM51EOb4UXLkrO1-4cQQQvvX210goAsnxKJH-4A2U2Q,1537
88
88
  py2docfx/docfx_yaml/tests/test_writer_table.py,sha256=UnGYXQ-QVxin_e-HGZAHdg1LSFV0qc480ZNsqPN9OYc,1444
89
- py2docfx/docfx_yaml/tests/test_writer_uri.py,sha256=L9eFHZndD6H7nkznJ9Bw0v8xh9IegDlhhGFHBz9EHmM,1745
89
+ py2docfx/docfx_yaml/tests/test_writer_uri.py,sha256=-TsN_eWEWzWpFy8xGnxPWP2Oqb8ikvI_Y4Syl4PVhMI,2091
90
90
  py2docfx/docfx_yaml/tests/test_writer_versions.py,sha256=0-0VTMhbZ4ml9ryu1gYnu0mM2yIEKsBuFYb2F6grzTE,2995
91
91
  py2docfx/docfx_yaml/tests/roots/test-build-finished/code_with_signature_and_docstring.py,sha256=qvcKWL68C2aDTP8JT022nMV4EdZ50vhxVshMrHVO2sY,449
92
92
  py2docfx/docfx_yaml/tests/roots/test-build-finished/conf.py,sha256=L8vIFmO546PCQks50Gif_uTBwC3cppohXrQaogfyRF8,410
@@ -118,12 +118,12 @@ py2docfx/docfx_yaml/tests/roots/test-translator-signatures/conf.py,sha256=avcbnI
118
118
  py2docfx/docfx_yaml/tests/roots/test-translator-signatures/refered_objects.py,sha256=DJaX52mnHw9W3GSqKh75CYK87g4CczXNNjFO496Ai2U,79
119
119
  py2docfx/docfx_yaml/tests/roots/test-writer-table/code_with_table_desc.py,sha256=J4eFvXsymgFvjnwVUY0APtUGwuxvt-AFJjTaEaQ7zMQ,574
120
120
  py2docfx/docfx_yaml/tests/roots/test-writer-table/conf.py,sha256=avcbnIOV2mlGQwhMQJZC4W6UGRBRhnq1QBxjPWlySxQ,260
121
- py2docfx/docfx_yaml/tests/roots/test-writer-uri/code_with_uri.py,sha256=bzWTZpY2yf_By2bOSl1GFaY3BsZpkAvwQuGztlcHKkQ,537
121
+ py2docfx/docfx_yaml/tests/roots/test-writer-uri/code_with_uri.py,sha256=GSz1B0xiXSaddkrniVBXzW7R4jDuPq1sWU7ByBH6MxA,754
122
122
  py2docfx/docfx_yaml/tests/roots/test-writer-uri/conf.py,sha256=avcbnIOV2mlGQwhMQJZC4W6UGRBRhnq1QBxjPWlySxQ,260
123
123
  py2docfx/docfx_yaml/tests/roots/test-writer-versions/code_with_version_directives.py,sha256=UuizbrJPaG_PcaH18BvbI9KQevOaLd4SslpnzMSqcrE,1030
124
124
  py2docfx/docfx_yaml/tests/roots/test-writer-versions/conf.py,sha256=SCEKrm9VigArfdgf-GAieJD-40d0ctT6urmGIjFOZLM,404
125
125
  py2docfx/docfx_yaml/tests/utils/test_utils.py,sha256=d0OYSUQ6NyoZx5mlLdNGGNhiNmmQhjVT4hQ6jY3VE_M,3383
126
- py2docfx-0.1.11.dev1912073.dist-info/METADATA,sha256=dp7RFy__EgLP0u45Jf6WovUwnvMf8tHoedy4AAd_J4Q,601
127
- py2docfx-0.1.11.dev1912073.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
128
- py2docfx-0.1.11.dev1912073.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
129
- py2docfx-0.1.11.dev1912073.dist-info/RECORD,,
126
+ py2docfx-0.1.11.dev1917708.dist-info/METADATA,sha256=YkTpFHkpn8q7txyG9hsXwk0xPsIV_zljimJhBOlYYD0,601
127
+ py2docfx-0.1.11.dev1917708.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
128
+ py2docfx-0.1.11.dev1917708.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
129
+ py2docfx-0.1.11.dev1917708.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: bdist_wheel (0.45.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5