Browse Source

initial commit with rendering apparatus

(silly, but somewhat useful)
master
Brennen Bearnes 5 years ago
commit
bc195847ef
5 changed files with 178 additions and 0 deletions
  1. +4
    -0
      Makefile
  2. +129
    -0
      fake-it.css
  3. +2
    -0
      footer.html
  4. +9
    -0
      header.html
  5. +34
    -0
      render.pl

+ 4
- 0
Makefile View File

@ -0,0 +1,4 @@
all: index.html
index.html: README.md render.pl footer.html header.html
./render.pl README.md | cat header.html - footer.html > $@

+ 129
- 0
fake-it.css View File

@ -0,0 +1,129 @@
body {
line-height: 1.4;
background: white;
color: #000000;
font-family: sans-serif;
margin-left: auto;
margin-right: auto;
margin-top: 0em;
max-width: 48em;
padding-left: 1em;
padding-right: 1em;
}
.contents ul li {
list-style: none;
}
.contents ul li li {
}
ul li {
list-style: square;
}
.details .clicker-button {
margin-left: 15px;
vertical-align: middle;
}
button.clicker-button {
background-color: white;
border: 1.5px solid #ddc;
border-radius: 3px;
}
button.clicker-button:active {
background-color: #ddc;
border-left: 1px solid black;
border-top: 1px solid black;
}
.details .full {
background-color: white;
border-bottom: 2px solid #ddc;
border-left: 2px solid #ddc;
border-radius: 3px;
border-right: 2px solid #ddc;
border-top: 2px solid #ddc;
padding: 1.5em;
}
hr {
margin-bottom: 2em;
margin-top: 2em;
}
p, ul li, ol li, ul {
}
td {
vertical-align: top;
}
h1, h2, h3, h4, h5, h6 {
font-family: "Georgia", "DejaVu Serif", "Bitstream Vera Serif", "Lucida Bright", serif;
font-weight: normal;
}
h2, h3, h4, h5, h6 {
text-indent: .25em;
}
h1.bigtitle {
font-size: 3em;
margin-left: auto;
margin-right: auto;
}
a {
font-style: none;
text-decoration: none;
}
pre {
background-color: white;
border: 1px solid #ddc;
border-radius: 3px;
color: black;
margin-bottom: 2em;
margin-left: 2em;
margin-top: 2em;
max-width: 56em;
padding: 1em;
white-space: pre-wrap;
}
p code {
border: 1px solid #ddc;
border-radius: 3px;
font-size: normal;
padding: 2px;
}
img {
margin-top: 2em;
margin-bottom: 2em;
}
.sidenote {
font-size: small;
/* margin-right: -170px; */
max-width: 200px;
position: absolute;
right: 20px;
top: auto; /* default */
}
blockquote.callout {
float: right;
font-size: 1.1em;
margin-left: 2em;
margin-right: 0;
margin-top: 0;
width: 30%;
}
blockquote.callout p {
margin-top: 0;
}

+ 2
- 0
footer.html View File

@ -0,0 +1,2 @@
</body>
</html>

+ 9
- 0
header.html View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset="utf-8">
<title>How To Migrate a Parse App to Parse Server on Ubuntu 14.04</title>
<link rel=stylesheet href="fake-it.css" />
</head>
<body>

+ 34
- 0
render.pl View File

@ -0,0 +1,34 @@
#!/usr/bin/env perl
use strict;
use warnings;
use 5.10.0;
use Text::Markdown::Discount;
# Enable html5 block-level tags:
Text::Markdown::Discount::with_html5_tags();
my $flags = Text::Markdown::Discount::MKD_EXTRA_FOOTNOTE();
my $markdown = Text::Markdown::Discount->new;
my $full_source = '';
while (my $source = get_input()) {
$full_source .= $source;
}
print replace_some_stuff($markdown->markdown($full_source, $flags));
sub get_input {
local $/ = undef;
my $source = <>;
return $source;
}
# Super cheeseball, man.
sub replace_some_stuff {
my ($markup) = @_;
$markup =~ s{&lt;\^&gt;(.*?)&lt;\^&gt;}{<span style="color: red;">$1</span>}g;
$markup =~ s{\[label (.*?)\]}{<strong>$1</strong><br>}g;
$markup =~ s{\[secondary_label (.*?)\]}{<span style="color: gray;">$1</span><br>}g;
return $markup;
}

Loading…
Cancel
Save