{"id":935,"date":"2017-04-19T00:22:28","date_gmt":"2017-04-18T15:22:28","guid":{"rendered":"http:\/\/www.python.ambitious-engineer.com\/?p=935"},"modified":"2019-05-06T19:14:51","modified_gmt":"2019-05-06T10:14:51","slug":"sphinx%e5%85%a5%e9%96%80-%e3%81%9d%e3%81%ae2-%e3%82%b3%e3%83%bc%e3%83%89%e5%86%85%e3%81%aedocstring%e3%81%ae%e8%a8%98%e8%bf%b0","status":"publish","type":"post","link":"https:\/\/www.python.ambitious-engineer.com\/archives\/935","title":{"rendered":"sphinx\u5165\u9580 \u305d\u306e2 \u30b3\u30fc\u30c9\u5185\u306edocstring\u306e\u8a18\u8ff0"},"content":{"rendered":"<p><a href=\"http:\/\/www.python.ambitious-engineer.com\/archives\/925\">\u524d\u56de<\/a>\u306fsphinx\u306b\u3088\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u81ea\u52d5\u751f\u6210\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3057\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u30b3\u30fc\u30c9\u5185\u306edocstring\u306e\u8a18\u8ff0\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002python\u306edocstring\u306e\u8a18\u6cd5\u306f<a href=\"http:\/\/epydoc.sourceforge.net\/\">Epytext<\/a>\u3001<a href=\"https:\/\/google.github.io\/styleguide\/pyguide.html?showone=Comments#Comments\">google<\/a>\u3001<a href=\"https:\/\/github.com\/numpy\/numpy\/blob\/master\/doc\/HOWTO_DOCUMENT.rst.txt\">Numpydoc<\/a>\u306a\u3069\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u306fPEP287\u3067\u63a8\u5968\u3055\u308c\u3066\u3044\u308breST\u3067\u306edocstring\u306e\u66f8\u304d\u65b9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>docstring\u306e\u66f8\u304d\u65b9<\/h2>\n<h3>\u30af\u30e9\u30b9\u6982\u8981<\/h3>\n<p>\u30af\u30e9\u30b9\u5b9a\u7fa9\u306e\u76f4\u4e0b\u306b\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c83\u3064\u3067\u56f2\u3063\u305f\u90e8\u5206\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30af\u30e9\u30b9\u5c5e\u6027<\/h3>\n<p>\u30af\u30e9\u30b9\u5c5e\u6027\u306b\u306f\u5c5e\u6027\u306e\u5ba3\u8a00\u76f4\u4e0b\u306bdocstring\u3092\u8a18\u8ff0\u3059\u308b\u304b\u3001\u76f4\u524d\u306b\u300c#: \u30b3\u30e1\u30f3\u30c8\u300d\u3068\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<h3>\u95a2\u6570\u30fb\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>\u6982\u8981\u306f\u30af\u30e9\u30b9\u3068\u540c\u69d8\u3001\u5b9a\u7fa9\u306e\u76f4\u4e0b\u306b\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c83\u3064\u3067\u56f2\u3063\u305f\u90e8\u5206\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002\u30d1\u30e9\u30e1\u30fc\u30bf\u3001\u623b\u308a\u5024\u3001\u578b\u60c5\u5831\u306b\u3064\u3044\u3066:field:\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4f7f\u3063\u3066\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&quot;&quot;&quot;\r\n:param int arg1: \u5f15\u6570\u306e\u8aac\u660e\r\n&quot;&quot;&quot;\r\n<\/pre>\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u578b\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306b:param\u306e\u5f8c\u306b\u7d9a\u3051\u3066\u66f8\u3044\u3066\u3082\u826f\u3044\u3067\u3059\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b:param\u3068:type\u3092\u5206\u3051\u3066\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&quot;&quot;&quot;\r\n:param arg2: \u5f15\u6570\r\n:type arg2: int\r\n&quot;&quot;&quot;\r\n<\/pre>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p>\u305d\u308c\u3067\u306f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&quot;&quot;&quot;\r\nSample\u6a5f\u80fd\u63d0\u4f9b\u30e2\u30b8\u30e5\u30fc\u30eb\r\n\r\n&quot;&quot;&quot;\r\n\r\nclass Sample:\r\n    &quot;&quot;&quot; \r\n    sample\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u3067\u3059\u3002\r\n    &quot;&quot;&quot;\r\n\r\n    bar = 1 \r\n    &quot;&quot;&quot; xx\u3092\u4fdd\u6301\u3059\u308b\u30e1\u30f3\u30d0\u3067\u3059 &quot;&quot;&quot;\r\n\r\n    #: yy\u3092\u4fdd\u6301\u3059\u308b\u30e1\u30f3\u30d0\u3067\u3059\r\n    foo = 1 \r\n\r\n    def __init__(self):\r\n        &quot;&quot;&quot; \r\n        \u521d\u671f\u5316\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002\r\n        &quot;&quot;&quot;\r\n        self.x = 'hoge'\r\n\r\n\r\n\r\n    def add(self, arg1, arg2):\r\n        &quot;&quot;&quot; \r\n        \u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u5024\u3092\u8db3\u3057\u7b97\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002``arg1 + arg2`` \r\n        \r\n        :param int arg1: \u8db3\u3055\u308c\u308b\u5024\u3002\r\n        :param arg2: \u8db3\u3059\u5024\u3002\r\n        :type arg2: int \r\n        :rtype: int\r\n        :return: \u8db3\u3057\u7b97\u3057\u305f\u7d50\u679c\u3002\r\n        &quot;&quot;&quot;\r\n        return a + b \r\n<\/pre>\n<p>\u51fa\u529b\u7d50\u679chtml\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u6982\u8981\u3001\u30af\u30e9\u30b9\u5c5e\u6027\u3001\u95a2\u6570\u6982\u8981\u3001\u95a2\u6570\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u95a2\u3059\u308b\u8a18\u8ff0\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2017\/04\/sphinx_html_class.png\"><img loading=\"lazy\" src=\"http:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2017\/04\/sphinx_html_class.png\" alt=\"\" width=\"785\" height=\"581\" class=\"alignnone size-full wp-image-940\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306fsphinx\u306b\u3088\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u81ea\u52d5\u751f\u6210\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3057\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u30b3\u30fc\u30c9\u5185\u306edocstring\u306e\u8a18\u8ff0\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002python\u306edocstring\u306e\u8a18\u6cd5\u306fEpytext\u3001google\u3001N...<\/p>\n","protected":false},"author":1,"featured_media":934,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[156],"tags":[157],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/935"}],"collection":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/comments?post=935"}],"version-history":[{"count":11,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/935\/revisions"}],"predecessor-version":[{"id":2049,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/935\/revisions\/2049"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media\/934"}],"wp:attachment":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media?parent=935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/categories?post=935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/tags?post=935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}