{"id":1300,"date":"2019-12-13T20:05:23","date_gmt":"2019-12-13T12:05:23","guid":{"rendered":"http:\/\/vip.fxxkpython.com\/?p=1300"},"modified":"2019-12-13T20:05:23","modified_gmt":"2019-12-13T12:05:23","slug":"python-%e7%88%ac%e9%98%b6%e6%a2%af-%e5%b0%86%e4%bd%a0%e7%9a%84-docstring-%e7%94%9f%e6%88%90%e5%9c%a8%e7%ba%bf-html-%e6%96%87%e6%a1%a3","status":"publish","type":"post","link":"https:\/\/vip.fxxkpython.com\/?p=1300","title":{"rendered":"Python \u722c\u9636\u68af | \u5c06\u4f60\u7684 Docstring \u751f\u6210\u5728\u7ebf HTML \u6587\u6863"},"content":{"rendered":"\n<p>\u5f53\u4f60\u5199\u5b8c\u4e86\u7a0b\u5e8f\uff0c\u52a0\u4e0a\u4e86 Docstring \uff0c\u51c6\u5907\u7ed9\u522b\u4eba\u53c2\u8003\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u628a Docstring \u751f\u6210\u5728\u7ebf\u7684\u6587\u6863\uff0c\u8fd9\u6837\u522b\u4eba\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u7f51\u9875\u6765\u4e86\u89e3\u7684\u9879\u76ee\u529f\u80fd\u4ee5\u53ca\u4f7f\u7528\uff0c\u5728\u8fd9\u91cc\u5c31\u4e0d\u5f97\u4e0d\u63d0\u7684\u4e00\u4e2a\u795e\u5668\u53eb\u505a <a href=\"https:\/\/www.sphinx-doc.org\/en\/1.8\/index.html\">sphinx<\/a> \uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9b\u547d\u4ee4\u5de5\u5177\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u5c06\u4f60\u4ee3\u7801\u4e2d\u7684\u89e3\u91ca\u76f4\u63a5\u751f\u6210\u7f51\u9875\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u53ea\u8981\u5728\u4f60\u7684\u9879\u76ee\u91cc\u9762\u4f7f\u7528 <a href=\"https:\/\/www.sphinx-doc.org\/en\/1.8\/index.html\">sphinx<\/a> \u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u5c06\u4f60\u7684\u9879\u76ee\u6587\u6863\u751f\u6210 HTML\u3002<\/p>\n\n\n\n<p>\u4eca\u5929\uff0c\u5c31\u6765\u544a\u8bc9\u4f60\u5982\u4f55\u5c06 Docstring \u751f\u6210\u5728\u7ebf\u6587\u6863\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u4f60\u9700\u8981\u5b89\u88c5\u4e00\u4e0b sphinx\uff1a<\/p>\n\n\n\n<p>pip install -U sphinx<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"828\" height=\"402\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-17-10-01.png\" alt=\"\" class=\"wp-image-1301\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-17-10-01.png 828w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-17-10-01-300x146.png 300w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-17-10-01-768x373.png 768w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-17-10-01-769x373.png 769w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/figure><\/div>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u4e4b\u540e\u5c31\u53ef\u4ee5\u5728\u4f60\u7684\u5f53\u524d\u9879\u76ee\u4e2d\u4f7f\u7528 sphinx \u4e86\uff0c\u8fd9\u91cc\u6211\u521b\u5efa\u4e00\u4e2a doc_test \u9879\u76ee\u4e3a\u4f8b\u7ed9\u4f60\u6f14\u793a\u4e00\u4e0b\uff1a<div style=\"text-align:center;border:1px dashed #FF9A9A;padding:8px;margin:10px auto;color:#FF6666;\">\u672c\u6587\u9690\u85cf\u5185\u5bb9 <a href=\"https:\/\/vip.fxxkpython.com\/wp-login.php?redirect_to=https%3A%2F%2Fvip.fxxkpython.com%2F%3Fp%3D1300\">\u767b\u9646<\/a> \u540e\u624d\u53ef\u4ee5\u6d4f\u89c8<\/div>\u5b8c\u4e8b\u4e4b\u540e\u4f60\u7684 docs \u76ee\u5f55\u4f1a\u591a\u4e86\u4e2a build \u6587\u4ef6\uff0c\u91cc\u9762\u5b58\u653e\u4e86\u6240\u6709\u751f\u6210\u597d\u4e86\u7684 HTML \u6587\u4ef6\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"342\" height=\"638\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-56-44.png\" alt=\"\" class=\"wp-image-1313\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-56-44.png 342w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-56-44-161x300.png 161w\" sizes=\"(max-width: 342px) 100vw, 342px\" \/><\/figure><\/div>\n\n\n\n<p>\u901a\u8fc7\u6d4f\u89c8\u5668\u6253\u5f00 index.html \u4f60\u5c31\u53ef\u4ee5\u770b\u5230\u4f60\u7684 Docstring \u76f4\u63a5\u751f\u6210\u7f51\u9875\u7684\u5f62\u5f0f\uff0c\u53ef\u4ee5\u88ab\u8f7b\u677e\u7684\u8bbf\u95ee\u4e86\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"938\" height=\"1024\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-58-44-938x1024.png\" alt=\"\" class=\"wp-image-1314\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-58-44-938x1024.png 938w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-58-44-275x300.png 275w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-58-44-768x839.png 768w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-58-44-769x840.png 769w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-58-44.png 1220w\" sizes=\"(max-width: 938px) 100vw, 938px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"510\" height=\"1024\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-59-26-510x1024.png\" alt=\"\" class=\"wp-image-1315\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-59-26-510x1024.png 510w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-59-26-149x300.png 149w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-13-19-59-26.png 644w\" sizes=\"(max-width: 510px) 100vw, 510px\" \/><\/figure><\/div>\n\n\n\n<p>\u8fd9\u5c31\u53ef\u4ee5\u5f88\u8f7b\u677e\u7684\u8ba9\u522b\u4eba\u4e86\u89e3\u4f60\u5199\u7684\u9879\u76ee\u6216\u8005\u6a21\u5757\u7684\u5177\u4f53\u4f7f\u7528\uff0c\u7279\u522b\u662f\u4f60\u63d0\u4f9b\u4e00\u4e9b <br>API \u7684\u65f6\u5019\uff0csphinx \u662f\u4e00\u4e2a\u503c\u5f97\u4f7f\u7528\u7684\u5de5\u5177\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u4f60\u5199\u5b8c\u4e86\u7a0b\u5e8f\uff0c\u52a0\u4e0a\u4e86 Docstring \uff0c\u51c6\u5907\u7ed9\u522b\u4eba\u53c2\u8003\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u628a Docstring \u751f\u6210\u5728\u7ebf\u7684\u6587\u6863\uff0c\u8fd9\u6837\u522b\u4eba\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u7f51\u9875\u6765\u4e86\u89e3\u7684\u9879\u76ee\u529f\u80fd\u4ee5\u53ca\u4f7f\u7528\uff0c\u5728\u8fd9\u91cc\u5c31\u4e0d\u5f97\u4e0d\u63d0\u7684\u4e00\u4e2a\u795e\u5668\u53eb\u505a sphinx \uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9b\u547d\u4ee4\u5de5\u5177\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u5c06\u4f60&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[140],"tags":[218,227,225,226],"_links":{"self":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/1300"}],"collection":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1300"}],"version-history":[{"count":1,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/1300\/revisions"}],"predecessor-version":[{"id":1316,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/1300\/revisions\/1316"}],"wp:attachment":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}