forked from lucidsoftware/lucid-programming-competition-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert.html.erb
34 lines (34 loc) · 1.07 KB
/
convert.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdn.rawgit.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css">
<style>
@media print {
body {
zoom: 75%;
}
code, pre, tr {
background: none ! important;
}
table {
page-break-inside: avoid
}
td {
vertical-align: top;
}
.markdown-body pre {
margin: 0;
}
}
</style>
</head>
<body class="markdown-body">
<%
http = Net::HTTP.new 'api.github.com', 443
http.use_ssl = true
response = http.post 'https://api.github.com/markdown/raw', STDIN.read, {'Content-Type'=>'text/x-markdown'}
raise Exception.new "Unsuccessful response #{response.code}" unless response.code == '200'
%>
<%= response.body %>
</body>
</html>