Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created December 6, 2016 11:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/93f338e576cbf5ba1a19364e4125bbc9 to your computer and use it in GitHub Desktop.
Save zoffixznet/93f338e576cbf5ba1a19364e4125bbc9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use LWP::Simple;
sub MAIN ($gist-url) {
put LWP::Simple.get($gist-url)
.comb(/'<article' <-[>]>+ '>' <(.+?)> '</article>'/)
.subst(:g, 'class="pl-c"', 'style="color: #999;"')
.subst(:g, 'class="pl-c1"', 'style="color: #449;"')
.subst(:g, 'class="pl-k"', 'style="color: blue;"')
.subst(:g, 'class="pl-pds"', 'style="font-weight: bold;"')
.subst(:g, 'class="pl-s"', 'style="color: #994;"')
.subst(:g, 'class="pl-smi"', 'style="color: #440; font-weight: bold"')
.subst(:g,
'<pre>',
'<pre style="font-size: 14px; font-family: monospace">'
);
}
@jonathanstowe
Copy link

Awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment