Created
December 22, 2016 22:54
-
-
Save zoffixznet/e8d7d24f5579f42cafedc6b954f72a87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
# | |
# Usage: save your markdown in a GitHub Gist. Give the URL to that gist to that script. | |
# Copy generated markup to wordpress HTML tab. | |
# | |
# See also: Pastebin::Gist that can simplify step 1 (and send me the copy of the script if you do improve it) | |
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;"') | |
.subst(:g, | |
'<pre>', | |
'<pre style="font-size: 14px; font-family: monospace">' | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment