Skip to content

Commit 53a8693

Browse files
committed
[sipify] creates links in seealso
1 parent 7064704 commit 53a8693

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/sipify.pl

+14-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,20 @@ sub processDoxygenLine {
133133
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
134134
return ".. versionadded:: $1\n";
135135
}
136-
if ( $line =~ m/\\see (.*)/ ) {
137-
return ".. seealso:: $1\n";
136+
if ( $line =~ m/\\see +(\w+(\.\w+)*(\(\))?)/ ) {
137+
my $seealso = $1;
138+
if ( $seealso =~ m/^Qgs[A-Z]\w+$/ ) {
139+
return ".. seealso:: :py:class:`$seealso`\n";
140+
}
141+
elsif ( $seealso =~ m/^(Qgs[A-Z]\w+)\.(\w+(\(\))?)$/ ) {
142+
return ".. seealso:: :py:func:`$1.$2`\n";
143+
}
144+
elsif ( $seealso =~ m/^[a-z]\w+(\(\))?$/ ) {
145+
return ".. seealso:: :py:func:`$seealso`\n";
146+
}
147+
else {
148+
return ".. seealso:: $seealso\n";
149+
}
138150
}
139151
if ( $line =~ m/[\\@]note (.*)/ ) {
140152
return ".. note::\n\n $1\n";

0 commit comments

Comments
 (0)