File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 55from docutils import nodes
66from docutils .nodes import Node
77from docutils .statemachine import StringList
8- from sphinx .util import logging , nested_parse_with_titles
8+ from sphinx .util import logging
99from sphinx .util .docutils import SphinxDirective
10+ from sphinx .util .nodes import nested_parse_with_titles
1011
1112from .util import Helper
1213
1314logger = logging .getLogger (f"sphinxcontrib-scm.{ __name__ } " )
1415
1516
16- class ContribsDirective (SphinxDirective , Helper ):
17+ class ContribsDirective (Helper , SphinxDirective ):
1718 has_content = False
1819 optional_arguments = 0
1920 option_spec = {
@@ -24,7 +25,7 @@ class ContribsDirective(SphinxDirective, Helper):
2425 "type" : str ,
2526 }
2627
27- def run (self ) -> Node :
28+ def run (self ) -> list [ Node ] :
2829 """Directive to list all SCM contributors"""
2930 contributors = self .get_contibutors ()
3031 contributors_str = (
Original file line number Diff line number Diff line change 1212logger = logging .getLogger (f"sphinxcontrib-scm.{ __name__ } " )
1313
1414
15- class ContribsRole (SphinxRole , Helper ):
15+ class ContribsRole (Helper , SphinxRole ):
1616 def run (self ) -> tuple [list [Node ], list [system_message ]]:
1717 """Role to list all SCM contributors"""
1818 contributors = self .get_contibutors ()
Original file line number Diff line number Diff line change 55
66from docutils .parsers .rst import directives
77from git .cmd import Git
8+ from sphinx .config import Config
89from sphinx .util import logging
910
1011logger = logging .getLogger (f"sphinxcontrib-scm.{ __name__ } " )
1112
1213
1314class Helper :
15+ options : dict
16+
17+ def get_source_info (self , lineno : int | None = None ) -> tuple [str , int ]:
18+ raise NotImplementedError
19+
20+ @property
21+ def config (self ) -> Config :
22+ raise NotImplementedError
23+
1424 def get_contibutors (self ) -> list [str ]:
1525 """Return list of Git contributors for given path using `git shortlog`
1626
You can’t perform that action at this time.
0 commit comments