{"action":"created","issue":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4872","repository_url":"https://api.github.com/repos/sphinx-doc/sphinx","labels_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4872/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4872/comments","events_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4872/events","html_url":"https://github.com/sphinx-doc/sphinx/issues/4872","id":316369740,"number":4872,"title":"Documentation of inheritance_diagram extension does not reflect actual behavior","user":{"login":"goerz","id":112306,"avatar_url":"https://avatars2.githubusercontent.com/u/112306?v=4","gravatar_id":"","url":"https://api.github.com/users/goerz","html_url":"https://github.com/goerz","followers_url":"https://api.github.com/users/goerz/followers","following_url":"https://api.github.com/users/goerz/following{/other_user}","gists_url":"https://api.github.com/users/goerz/gists{/gist_id}","starred_url":"https://api.github.com/users/goerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goerz/subscriptions","organizations_url":"https://api.github.com/users/goerz/orgs","repos_url":"https://api.github.com/users/goerz/repos","events_url":"https://api.github.com/users/goerz/events{/privacy}","received_events_url":"https://api.github.com/users/goerz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-20T18:35:09Z","updated_at":"2018-04-22T11:44:48Z","closed_at":null,"author_association":"NONE","body":"The [documentation of `sphinx.ext.inheritance_diagram`](http://www.sphinx-doc.org/en/master/ext/inheritance.html#directive-inheritance-diagram) states\r\n\r\n    This directive supports an option called ``parts`` that, if given, must be an\r\n    integer, advising the directive to remove that many parts of module names\r\n    from the displayed names.  (For example, if all your class names start with\r\n    ``lib.``, you can give ``:parts: 1`` to remove that prefix from the displayed\r\n    node names.)\r\n\r\nHowever, this is not the actual behavior of the code! Due to https://github.com/sphinx-doc/sphinx/blob/96c5605374135652cf7ec0ad517b532b9261ef19/sphinx/ext/inheritance_diagram.py#L234\r\n`parts` specifies the number of parts that are kept (right-to-left), not the number of parts that are dropped (left-to-right). In principle, the documented behavior would be achieved with negative values for `parts`, except that this is prevented by\r\nhttps://github.com/sphinx-doc/sphinx/blob/96c5605374135652cf7ec0ad517b532b9261ef19/sphinx/ext/inheritance_diagram.py#L333-L338\r\n\r\nOne would have to change line 334 to `'parts': int,`.\r\n\r\nSo, I could imagine four possible solutions, which I'll outline below (in order of least to most effort), so people can vote on them:"},"comment":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/comments/383375562","html_url":"https://github.com/sphinx-doc/sphinx/issues/4872#issuecomment-383375562","issue_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4872","id":383375562,"user":{"login":"tk0miya","id":748828,"avatar_url":"https://avatars2.githubusercontent.com/u/748828?v=4","gravatar_id":"","url":"https://api.github.com/users/tk0miya","html_url":"https://github.com/tk0miya","followers_url":"https://api.github.com/users/tk0miya/followers","following_url":"https://api.github.com/users/tk0miya/following{/other_user}","gists_url":"https://api.github.com/users/tk0miya/gists{/gist_id}","starred_url":"https://api.github.com/users/tk0miya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tk0miya/subscriptions","organizations_url":"https://api.github.com/users/tk0miya/orgs","repos_url":"https://api.github.com/users/tk0miya/repos","events_url":"https://api.github.com/users/tk0miya/events{/privacy}","received_events_url":"https://api.github.com/users/tk0miya/received_events","type":"User","site_admin":false},"created_at":"2018-04-22T11:44:48Z","updated_at":"2018-04-22T11:44:48Z","author_association":"OWNER","body":"Good point!\r\n\r\nThe behavior of `parts` which you reported was started since beginning of the extension (c5d0ba9913).\r\nTherefore, there might be many documents using this feature.\r\n\r\nPersonally, I prefer \"Solution 4\". But we can't choose it because of backward compatibility.\r\nSo I think \"Solution 3\" is better.\r\n"}}
{"actor":{"display_login":"tk0miya"}}