Jump to content

Rosetta Code/Run examples: Difference between revisions

m
→‎{{header|Raku}}: minimal changes to allow it to work with relocated site and new markup
m (syntax highlighting fixup automation)
m (→‎{{header|Raku}}: minimal changes to allow it to work with relocated site and new markup)
Line 1,399:
 
my $client = HTTP::UserAgent.new;
my $url = 'httphttps://rosettacode.org/mww';
 
my %c = ( # text colors
Line 1,477:
uh-oh("Whoops, can't find page: $url/$title :check spelling.\n\n{fuzzy-search($title)}", 'warn')
and next if $page.elems == 0;
say "Getting code from: httphttps://rosettacode.org/wiki/{ $title.subst(' ', '_', :g) }#%l<language>";
 
$entry = $page.comb(rx:i/'=={{header|' $(%l<header>) '}}==' .+? [<?before \n'=='<-[={]>*'{{header'> || $] /).Str //
Line 1,669:
multi load-lang ('raku') { ( # Language specific variables. Adjust to suit.
language => 'Raku', # language category name
exe => 'raku', # executable name to run rakuperl6 in a shell
ext => '.raku', # file extension for rakuperl6 code (optional, but nice to have)
dir => 'raku', # directory to save tasks to
header => 'Raku', # header text (=={{header|Raku}}==)
Line 1,676:
# and to avoid getting tripped up when trying to run _this_ task.
# note that this tag only selects the syntax highlighting, continue to
# useleave 'perl6' untilas an option, 'raku' asis now addedlive on the site.
tag => rx/:i <?after '<syntaxhighlight lang="' ['perl6'|'raku'] '"' ' line'? '>' > .*? <?before '</' 'langsyntaxhighlight>'>/,
) }
 
Line 1,686:
dir => 'perl',
header => 'Perl',
tag => rx/:i <?after '<syntaxhighlight lang="' 'perl' '"' ' line'? '>' > .*? <?before '</' 'lang>'>/,
) }
 
Line 1,695:
dir => 'python',
header => 'Python',
tag => rx/:i <?after '<syntaxhighlight lang="' 'python' '"' ' line'? '>' > .*? <?before '</' 'lang>'>/,
) }
 
Line 1,704:
dir => 'go',
header => 'Go',
tag => rx/:i <?after '<syntaxhighlight lang="' 'go' '"' ' line'? '>' > .*? <?before '</' 'lang>'>/,
) }
 
Line 1,713:
dir => 'tcl',
header => 'Tcl',
tag => rx/:i <?after '<syntaxhighlight lang="' 'tcl' '"' ' line'? '>' > .*? <?before '</' 'lang>'>/,
) }
 
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.