py2docfx 0.1.11.dev1971898__py3-none-any.whl → 0.1.11.dev1980911__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-translator-contents/code_with_docstring.py +0 -7
 - py2docfx/docfx_yaml/tests/roots/test-writer-uri/code_with_uri.py +7 -0
 - py2docfx/docfx_yaml/tests/test_translator_contents.py +0 -20
 - py2docfx/docfx_yaml/tests/test_writer_uri.py +4 -0
 - py2docfx/docfx_yaml/writer.py +13 -1
 - {py2docfx-0.1.11.dev1971898.dist-info → py2docfx-0.1.11.dev1980911.dist-info}/METADATA +1 -1
 - {py2docfx-0.1.11.dev1971898.dist-info → py2docfx-0.1.11.dev1980911.dist-info}/RECORD +9 -9
 - {py2docfx-0.1.11.dev1971898.dist-info → py2docfx-0.1.11.dev1980911.dist-info}/WHEEL +0 -0
 - {py2docfx-0.1.11.dev1971898.dist-info → py2docfx-0.1.11.dev1980911.dist-info}/top_level.txt +0 -0
 
| 
         @@ -42,23 +42,3 @@ def test_classWithCodeSummary_checkLastLineBracket(app): 
     | 
|
| 
       42 
42 
     | 
    
         
             
                summary = app.env.docfx_info_field_data[objectToGenXml]['summary']
         
     | 
| 
       43 
43 
     | 
    
         
             
                summaryList = [line for line in summary.splitlines() if line]
         
     | 
| 
       44 
44 
     | 
    
         
             
                assert (summaryList[-1] == '}') # Translator shouldn't skip last line of bracket (even there's no alphabet =or digit in this line)
         
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
            @pytest.mark.sphinx('dummy', testroot='translator-contents')
         
     | 
| 
       47 
     | 
    
         
            -
            def test_classWithCodeSummary_checkLastLineBracket(app):
         
     | 
| 
       48 
     | 
    
         
            -
                # Test data definition
         
     | 
| 
       49 
     | 
    
         
            -
                objectToGenXml = 'code_with_docstring.ClassWithMailLinkSummary'
         
     | 
| 
       50 
     | 
    
         
            -
                objectToGenXmlType = 'class'        
         
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
                # Arrange
         
     | 
| 
       53 
     | 
    
         
            -
                prepare_app_envs(app, objectToGenXml)
         
     | 
| 
       54 
     | 
    
         
            -
                doctree = load_rst_transform_to_doctree(app, objectToGenXmlType, objectToGenXml)
         
     | 
| 
       55 
     | 
    
         
            -
                
         
     | 
| 
       56 
     | 
    
         
            -
                # Act
         
     | 
| 
       57 
     | 
    
         
            -
                translator(app, '', doctree)
         
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
                # Assert
         
     | 
| 
       60 
     | 
    
         
            -
                summary = app.env.docfx_info_field_data[objectToGenXml]['summary']
         
     | 
| 
       61 
     | 
    
         
            -
                summaryList = [line for line in summary.splitlines() if line]
         
     | 
| 
       62 
     | 
    
         
            -
                assert summaryList[0] == 'A mail link: <xref:mailto:foo@boo.com>'
         
     | 
| 
       63 
     | 
    
         
            -
                assert summaryList[1] == "A string mistaken as mail link: <xref:mailto:'@search.score>'"
         
     | 
| 
       64 
     | 
    
         
            -
                assert summaryList[2] == "An escaped string: '@search.score'"
         
     | 
| 
         @@ -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 
     | 
    
         | 
    
        py2docfx/docfx_yaml/writer.py
    CHANGED
    
    | 
         @@ -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 
     | 
    
         
            -
                                 
     | 
| 
      
 937 
     | 
    
         
            +
                                if inner_text == node.attributes['refuri'] and inner_text in cls.urls_that_shouldnt_be_rendered_as_links:
         
     | 
| 
      
 938 
     | 
    
         
            +
                                    ref_string = f'`{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. 
     | 
| 
      
 3 
     | 
    
         
            +
            Version: 0.1.11.dev1980911
         
     | 
| 
       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= 
     | 
| 
      
 73 
     | 
    
         
            +
            py2docfx/docfx_yaml/writer.py,sha256=Df7dRv9EMArqTBzoDHIDj8pqCeBH8X0fzYm9P2x0v9o,35696
         
     | 
| 
       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
         
     | 
| 
         @@ -78,7 +78,7 @@ py2docfx/docfx_yaml/tests/test_build_finished.py,sha256=PSyWuY_XWmNeSjQl4kBwHUWp 
     | 
|
| 
       78 
78 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/test_method_arguments.py,sha256=Cvj9aoADtacKciVN8nempXW-KQL8nujSa9GNVuk6l_8,1578
         
     | 
| 
       79 
79 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/test_numpy_syntax.py,sha256=ssb3J_-Jzjybhh4eycCA_LkXbGflyZyIUAiTjlEYLiw,863
         
     | 
| 
       80 
80 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/test_translator_attributes.py,sha256=qZCsQGffq31k3UzpXkJpycplOXIq9gi2SxY6vu0DTfw,5224
         
     | 
| 
       81 
     | 
    
         
            -
            py2docfx/docfx_yaml/tests/test_translator_contents.py,sha256= 
     | 
| 
      
 81 
     | 
    
         
            +
            py2docfx/docfx_yaml/tests/test_translator_contents.py,sha256=lVCWbBIQk2oPFqsKK9gIb-b5DixutMabWjP7x03oj4s,1746
         
     | 
| 
       82 
82 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/test_translator_data.py,sha256=zSVs3AT_TeAx1mrEYNTpy3Xy-FPrwwi93ly2EFclw5U,984
         
     | 
| 
       83 
83 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/test_translator_exceptions.py,sha256=A2zAcJOBGchDBNIDr15uD3lzLfVldJKYSAl0e1CD5Ds,10481
         
     | 
| 
       84 
84 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/test_translator_fieldlists.py,sha256=tDJ1l0c16oYfAlEIcidqEMwaXcX83Fg-rajpLtb2Wnk,1198
         
     | 
| 
         @@ -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= 
     | 
| 
      
 89 
     | 
    
         
            +
            py2docfx/docfx_yaml/tests/test_writer_uri.py,sha256=wwdxraB5wP88OIJzuLGviit44Kesb8dvU9ajb5Ra0qA,2093
         
     | 
| 
       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
         
     | 
| 
         @@ -100,7 +100,7 @@ py2docfx/docfx_yaml/tests/roots/test-translator-attributes/code_with_docstring3. 
     | 
|
| 
       100 
100 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/roots/test-translator-attributes/code_with_import.py,sha256=VySauK2eitQYigPZUsrlK8l4ab2SJPOYPQnBoKHgLTo,297
         
     | 
| 
       101 
101 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/roots/test-translator-attributes/conf.py,sha256=rFV8j1gOtlc2ubfcNf-qi6F1904_G4jMd_5e2fLzip0,358
         
     | 
| 
       102 
102 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/roots/test-translator-attributes/refered_objects.py,sha256=DJaX52mnHw9W3GSqKh75CYK87g4CczXNNjFO496Ai2U,79
         
     | 
| 
       103 
     | 
    
         
            -
            py2docfx/docfx_yaml/tests/roots/test-translator-contents/code_with_docstring.py,sha256= 
     | 
| 
      
 103 
     | 
    
         
            +
            py2docfx/docfx_yaml/tests/roots/test-translator-contents/code_with_docstring.py,sha256=yPH0kaYzmroxuCO3ZRq5KLb10IqxqROY4io0B58Welc,712
         
     | 
| 
       104 
104 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/roots/test-translator-contents/conf.py,sha256=avcbnIOV2mlGQwhMQJZC4W6UGRBRhnq1QBxjPWlySxQ,260
         
     | 
| 
       105 
105 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/roots/test-translator-data/code_with_data.py,sha256=F5-o_cBTjLGzUmk2PEEY60zQz7B0YLe4-yDbEZrvwac,372
         
     | 
| 
       106 
106 
     | 
    
         
             
            py2docfx/docfx_yaml/tests/roots/test-translator-data/conf.py,sha256=avcbnIOV2mlGQwhMQJZC4W6UGRBRhnq1QBxjPWlySxQ,260
         
     | 
| 
         @@ -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= 
     | 
| 
      
 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. 
     | 
| 
       127 
     | 
    
         
            -
            py2docfx-0.1.11. 
     | 
| 
       128 
     | 
    
         
            -
            py2docfx-0.1.11. 
     | 
| 
       129 
     | 
    
         
            -
            py2docfx-0.1.11. 
     | 
| 
      
 126 
     | 
    
         
            +
            py2docfx-0.1.11.dev1980911.dist-info/METADATA,sha256=KLL-Nv-GWn6m82Eg1kzBNbIgt6ECrYHj0sLL9VZLk7k,601
         
     | 
| 
      
 127 
     | 
    
         
            +
            py2docfx-0.1.11.dev1980911.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
         
     | 
| 
      
 128 
     | 
    
         
            +
            py2docfx-0.1.11.dev1980911.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
         
     | 
| 
      
 129 
     | 
    
         
            +
            py2docfx-0.1.11.dev1980911.dist-info/RECORD,,
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |