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 5
5
from docutils import nodes
6
6
from docutils .nodes import Node
7
7
from docutils .statemachine import StringList
8
- from sphinx .util import logging , nested_parse_with_titles
8
+ from sphinx .util import logging
9
9
from sphinx .util .docutils import SphinxDirective
10
+ from sphinx .util .nodes import nested_parse_with_titles
10
11
11
12
from .util import Helper
12
13
13
14
logger = logging .getLogger (f"sphinxcontrib-scm.{ __name__ } " )
14
15
15
16
16
- class ContribsDirective (SphinxDirective , Helper ):
17
+ class ContribsDirective (Helper , SphinxDirective ):
17
18
has_content = False
18
19
optional_arguments = 0
19
20
option_spec = {
@@ -24,7 +25,7 @@ class ContribsDirective(SphinxDirective, Helper):
24
25
"type" : str ,
25
26
}
26
27
27
- def run (self ) -> Node :
28
+ def run (self ) -> list [ Node ] :
28
29
"""Directive to list all SCM contributors"""
29
30
contributors = self .get_contibutors ()
30
31
contributors_str = (
Original file line number Diff line number Diff line change 12
12
logger = logging .getLogger (f"sphinxcontrib-scm.{ __name__ } " )
13
13
14
14
15
- class ContribsRole (SphinxRole , Helper ):
15
+ class ContribsRole (Helper , SphinxRole ):
16
16
def run (self ) -> tuple [list [Node ], list [system_message ]]:
17
17
"""Role to list all SCM contributors"""
18
18
contributors = self .get_contibutors ()
Original file line number Diff line number Diff line change 5
5
6
6
from docutils .parsers .rst import directives
7
7
from git .cmd import Git
8
+ from sphinx .config import Config
8
9
from sphinx .util import logging
9
10
10
11
logger = logging .getLogger (f"sphinxcontrib-scm.{ __name__ } " )
11
12
12
13
13
14
class 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
+
14
24
def get_contibutors (self ) -> list [str ]:
15
25
"""Return list of Git contributors for given path using `git shortlog`
16
26
You can’t perform that action at this time.
0 commit comments