{"id":1431,"date":"2022-12-13T14:03:55","date_gmt":"2022-12-13T06:03:55","guid":{"rendered":"http:\/\/zhang.mba\/?p=1431"},"modified":"2022-12-13T14:05:51","modified_gmt":"2022-12-13T06:05:51","slug":"rst-wen-jian-da-kai-fang-shi","status":"publish","type":"post","link":"https:\/\/zhang.mba\/index.php\/2022\/12\/13\/14\/03\/55\/1431\/rst-wen-jian-da-kai-fang-shi\/python\/zhangzhiqi\/","title":{"rendered":"rst \u6587\u4ef6\u6253\u5f00\u65b9\u5f0f"},"content":{"rendered":"<p>\u00a0\u00a0\u00a0\u00a0rst(<strong>ReStructuredText<\/strong>) \u662f\u4e00\u79cd\u7528\u4e8e\u6587\u672c\u6570\u636e\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u4e3b\u8981\u4f5c\u4e3a Python \u7f16\u7a0b\u8bed\u8a00\u6280\u672f\u6587\u6863\u7684\u63cf\u8ff0\u8bed\u8a00\uff0c\u5176\u65e8\u5728\u4e3a Python \u521b\u5efa\u4e00\u7ec4\u7c7b\u4f3c\u4e8e Java \u7684 Javadoc\u7684\u529f\u80fd\u8bf4\u660e\u6587\u6863\uff1bDocutils \u53ef\u4ee5\u4ece\u4ece Python \u7a0b\u5e8f\u4e2d\u63d0\u53d6\u6ce8\u91ca\u548c\u4fe1\u606f\uff0c\u5e76\u5c06\u5b83\u4eec\u683c\u5f0f\u5316\u4e3a\u5404\u79cd\u5f62\u5f0f\u7684\u7a0b\u5e8f\u6587\u6863\uff0crst\u5c31\u662f\u5176\u4e2d\u7684\u4e00\u79cd\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0rst\u4e00\u822c\u7ec4\u7ec7\u5728python\u6e90\u6587\u4ef6\u7684doc\/docs\u76ee\u5f55\u4e0b\uff0c\u53ef\u4ee5\u901a\u8fc7<a href=\"https:\/\/so.csdn.net\/so\/search?q=sphinx&amp;spm=1001.2101.3001.7020\">sphinx<\/a>\u5de5\u5177\u5c06rst\u6587\u4ef6\u8f6c\u5316\u4e3ahtml\u6587\u4ef6\u6613\u4e8e\u9605\u8bfb\u3002 sphinx\u53ef\u4ee5\u901a\u8fc7pip\u8fdb\u884c\u5b89\u88c5\uff0c\u4ed6\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5728python\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684Scripts\uff0c\u5b89\u88c5\u8fc7Anaconda\u7684sphinx\u5df2\u7ecf\u5b89\u88c5\uff0c\u53ef\u4ee5\u76f4\u63a5\u6253\u5f00Anaconda\u7684\u547d\u4ee4\u884c\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre class=\"line-numbers\"><code class=\"language-bash\"># pip install sphinx\nsphinx-build -b html docs build\n# \u8fdb\u5165\u6e90\u6587\u4ef6\u76ee\u5f55\uff08docs\u7684\u4e0a\u7ea7\u76ee\u5f55\uff09\uff0cdocs\u662frst\u6240\u5728\u7684\u6587\u4ef6\u5939\n# build\u662f\u8f93\u51fahtml\u7684\u76ee\u5f55\n<\/code><\/pre>\n<p>\u200b \u53ef\u80fd\u51fa\u73b0\u7684\u9519\u8bef <strong>Could not import extension sphinxcontrib.log_cabinet<\/strong>\uff0c \u5b89\u88c5\u6a21\u5757\u5373\u53ef\uff1a<\/p>\n<pre class=\"line-numbers\"><code class=\"language-bash\">pip install sphinxcontrib-log_cabinet\n# \u6307\u5b9a\u6e05\u534e\u955c\u50cf\u6e90\uff1a -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple\n<\/code><\/pre>\n<p>\u00a0\u00a0\u00a0\u00a0\u6267\u884c\u5b8c\u8f6c\u6362\u547d\u4ee4\u540e\uff0c\u4e00\u822c\u4ecebuild\/index.html\u8fdb\u5165\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u67e5\u770b\uff08\u8fd9\u4e2a\u5176\u5b9e\u5c31\u662f\u6e90\u7801\u5b98\u7f51\u7684\u6587\u6863\u8bf4\u660e\uff0c\u8f6c\u5316\u540e\u76f8\u5f53\u4e8e\u672c\u5730\u7f13\u5b58\uff09\u3002<\/p>\n<p>\u6765\u6e90\uff1a<\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/weixin_39517298\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/zhang.mba\/wp-content\/uploads\/2022\/12\/16709115323796.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"http:\/\/zhang.mba\/wp-content\/uploads\/2022\/12\/16709115323796.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div>\u6ca1\u6709\u68a6\u60f3\u7684\u54b8\u9c7c~<\/a><\/p>\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u00a0\u00a0\u00a0\u00a0rst(ReStructuredText) \u662f\u4e00\u79cd\u7528\u4e8e\u6587\u672c\u6570\u636e\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u4e3b\u8981\u4f5c\u4e3a Python \u7f16\u7a0b\u8bed\u8a00\u6280\u672f\u6587\u6863\u7684\u63cf\u8ff0\u8bed\u8a00\uff0c\u5176\u65e8\u5728\u4e3a Python \u521b\u5efa\u4e00\u7ec4\u7c7b\u4f3c\u4e8e Java \u7684 Javadoc\u7684\u529f\u80fd\u8bf4\u660e\u6587\u6863\uff1bDocutils \u53ef\u4ee5\u4ece\u4ece Python \u7a0b\u5e8f\u4e2d\u63d0\u53d6\u6ce8\u91ca\u548c\u4fe1\u606f\uff0c\u5e76\u5c06\u5b83\u4eec\u683c\u5f0f\u5316\u4e3a\u5404\u79cd\u5f62\u5f0f\u7684 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/posts\/1431"}],"collection":[{"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/comments?post=1431"}],"version-history":[{"count":0,"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/posts\/1431\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/media?parent=1431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/categories?post=1431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhang.mba\/index.php\/wp-json\/wp\/v2\/tags?post=1431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}