Browse Source

initial commit with rendering apparatus

(silly, but somewhat useful)
Brennen Bearnes 3 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 @@
1
+all: index.html
2
+
3
+index.html: README.md render.pl footer.html header.html
4
+	./render.pl README.md | cat header.html - footer.html > $@

+ 129
- 0
fake-it.css View File

@@ -0,0 +1,129 @@
1
+body {
2
+  line-height: 1.4;
3
+  background: white;
4
+  color: #000000;
5
+  font-family: sans-serif;
6
+  margin-left: auto;
7
+  margin-right: auto;
8
+  margin-top: 0em;
9
+  max-width: 48em;
10
+  padding-left: 1em;
11
+  padding-right: 1em;
12
+}
13
+
14
+.contents ul li {
15
+  list-style: none;
16
+}
17
+
18
+.contents ul li li {
19
+}
20
+
21
+ul li {
22
+  list-style: square;
23
+}
24
+
25
+.details .clicker-button {
26
+  margin-left: 15px;
27
+  vertical-align: middle;
28
+}
29
+
30
+button.clicker-button {
31
+  background-color: white;
32
+  border: 1.5px solid #ddc;
33
+  border-radius: 3px;
34
+}
35
+
36
+button.clicker-button:active {
37
+  background-color: #ddc;
38
+  border-left: 1px solid black;
39
+  border-top: 1px solid black;
40
+}
41
+
42
+.details .full {
43
+  background-color: white;
44
+  border-bottom: 2px solid #ddc;
45
+  border-left: 2px solid #ddc;
46
+  border-radius: 3px;
47
+  border-right: 2px solid #ddc;
48
+  border-top: 2px solid #ddc;
49
+  padding: 1.5em;
50
+}
51
+
52
+hr {
53
+  margin-bottom: 2em;
54
+  margin-top: 2em;
55
+}
56
+
57
+p, ul li, ol li, ul {
58
+}
59
+
60
+td {
61
+  vertical-align: top;
62
+}
63
+
64
+h1, h2, h3, h4, h5, h6 {
65
+  font-family: "Georgia", "DejaVu Serif", "Bitstream Vera Serif", "Lucida Bright", serif;
66
+  font-weight: normal;
67
+}
68
+
69
+h2, h3, h4, h5, h6 {
70
+  text-indent: .25em;
71
+}
72
+
73
+h1.bigtitle {
74
+  font-size: 3em;
75
+  margin-left: auto;
76
+  margin-right: auto;
77
+}
78
+
79
+a {
80
+  font-style: none;
81
+  text-decoration: none;
82
+}
83
+
84
+pre {
85
+  background-color: white;
86
+  border: 1px solid #ddc;
87
+  border-radius: 3px;
88
+  color: black;
89
+  margin-bottom: 2em;
90
+  margin-left: 2em;
91
+  margin-top: 2em;
92
+  max-width: 56em;
93
+  padding: 1em;
94
+  white-space: pre-wrap;
95
+}
96
+
97
+p code {
98
+  border: 1px solid #ddc;
99
+  border-radius: 3px;
100
+  font-size: normal;
101
+  padding: 2px;
102
+}
103
+
104
+img {
105
+  margin-top: 2em;
106
+  margin-bottom: 2em;
107
+}
108
+
109
+.sidenote {
110
+  font-size: small;
111
+  /* margin-right: -170px; */
112
+  max-width: 200px;
113
+  position: absolute;
114
+  right: 20px;
115
+  top: auto; /* default */
116
+}
117
+
118
+blockquote.callout {
119
+  float: right;
120
+  font-size: 1.1em;
121
+  margin-left: 2em;
122
+  margin-right: 0;
123
+  margin-top: 0;
124
+  width: 30%;
125
+}
126
+
127
+blockquote.callout p {
128
+  margin-top: 0;
129
+}

+ 2
- 0
footer.html View File

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

+ 9
- 0
header.html View File

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

+ 34
- 0
render.pl View File

@@ -0,0 +1,34 @@
1
+#!/usr/bin/env perl
2
+
3
+use strict;
4
+use warnings;
5
+use 5.10.0;
6
+
7
+use Text::Markdown::Discount;
8
+
9
+# Enable html5 block-level tags:
10
+Text::Markdown::Discount::with_html5_tags();
11
+my $flags = Text::Markdown::Discount::MKD_EXTRA_FOOTNOTE();
12
+my $markdown = Text::Markdown::Discount->new;
13
+
14
+my $full_source = '';
15
+while (my $source = get_input()) {
16
+  $full_source .= $source;
17
+}
18
+
19
+print replace_some_stuff($markdown->markdown($full_source, $flags));
20
+
21
+sub get_input {
22
+  local $/ = undef;
23
+  my $source = <>;
24
+  return $source;
25
+}
26
+
27
+# Super cheeseball, man.
28
+sub replace_some_stuff {
29
+  my ($markup) = @_;
30
+  $markup =~ s{&lt;\^&gt;(.*?)&lt;\^&gt;}{<span style="color: red;">$1</span>}g;
31
+  $markup =~ s{\[label (.*?)\]}{<strong>$1</strong><br>}g;
32
+  $markup =~ s{\[secondary_label (.*?)\]}{<span style="color: gray;">$1</span><br>}g;
33
+  return $markup;
34
+}

Loading…
Cancel
Save