Skip to content
Permalink
Browse files

[sipify] also create links in docstrings

  • Loading branch information
3nids committed Dec 16, 2017
1 parent 336995d commit db8a7c613be99319fbf184736784f120c8e43824
Showing with 4 additions and 0 deletions.
  1. +4 −0 scripts/sipify.pl
@@ -146,6 +146,7 @@ sub processDoxygenLine {
if ( $line =~ m/\\since .*?([\d\.]+)/i ) {
return "\n.. versionadded:: $1\n";
}
# create links in see also
if ( $line =~ m/\\see +(\w+(\.\w+)*(\(\))?)/ ) {
my $seealso = $1;
if ( $seealso =~ m/^Qgs[A-Z]\w+$/ ) {
@@ -161,6 +162,9 @@ sub processDoxygenLine {
return "\n.. seealso:: $seealso\n";
}
}
# create links in plain text too (less performant)
$line =~ s/\b(Qgs[A-Z]\w+)\b(\.?$|[^\w]{2})/:py:class:`$1`$2/g;
$line =~ s/\b(Qgs[A-Z]\w+\.[a-z]\w+\(\))(\.|\b|$)/:py:func:`$1`/g;
if ( $line =~ m/[\\@]note (.*)/ ) {
return "\n.. note::\n\n $1\n";
}

0 comments on commit db8a7c6

Please sign in to comment.
You can’t perform that action at this time.