Skip to content
Permalink
Browse files
[sipify] support unparsed/raw code
  • Loading branch information
3nids committed May 26, 2021
1 parent bd88d6a commit 2e81f3b172186f8aa7e423aaf2e1f58ecad09887
Showing with 3 additions and 1 deletion.
  1. +3 −1 scripts/sipify.pl
@@ -184,12 +184,14 @@ sub processDoxygenLine {
my $line = $_[0];

# detect code snippet
if ( $line =~ m/\\code(\{\.(\w+)\})?/ ) {
if ( $line =~ m/\\code(\{\.?(\w+)\})?/ ) {
my $codelang = "";
$codelang = " $2" if (defined $2);
$codelang =~ m/(cpp|py|unparsed)/ or exit_with_error("invalid code snippet format: $codelang");
$COMMENT_CODE_SNIPPET = CODE_SNIPPET;
$COMMENT_CODE_SNIPPET = CODE_SNIPPET_CPP if ($codelang =~ m/cpp/ );
$codelang =~ s/py/python/;
$codelang =~ s/unparsed/raw/;
return "\n" if ( $COMMENT_CODE_SNIPPET == CODE_SNIPPET_CPP );
return "\n.. code-block::$codelang\n\n";
}

0 comments on commit 2e81f3b

Please sign in to comment.