Skip to content

Commit

Permalink
[sipify] creates links in seealso
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Dec 6, 2017
1 parent 7064704 commit 53a8693
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/sipify.pl
Expand Up @@ -133,8 +133,20 @@ sub processDoxygenLine {
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
return ".. versionadded:: $1\n";
}
if ( $line =~ m/\\see (.*)/ ) {
return ".. seealso:: $1\n";
if ( $line =~ m/\\see +(\w+(\.\w+)*(\(\))?)/ ) {
my $seealso = $1;
if ( $seealso =~ m/^Qgs[A-Z]\w+$/ ) {
return ".. seealso:: :py:class:`$seealso`\n";
}
elsif ( $seealso =~ m/^(Qgs[A-Z]\w+)\.(\w+(\(\))?)$/ ) {
return ".. seealso:: :py:func:`$1.$2`\n";
}
elsif ( $seealso =~ m/^[a-z]\w+(\(\))?$/ ) {
return ".. seealso:: :py:func:`$seealso`\n";
}
else {
return ".. seealso:: $seealso\n";
}
}
if ( $line =~ m/[\\@]note (.*)/ ) {
return ".. note::\n\n $1\n";
Expand Down

0 comments on commit 53a8693

Please sign in to comment.