Created
December 6, 2018 12:58
-
-
Save emad-elsaid/b0046736d1f943ef784ea586d7c92332 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 erbview | |
<% | |
require 'redcarpet' | |
file = File.read(ARGV.shift) | |
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) | |
output = markdown.render(file) | |
%> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.css"> | |
<style> | |
.markdown-body { | |
box-sizing: border-box; | |
min-width: 200px; | |
max-width: 980px; | |
margin: 0 auto; | |
padding: 45px; | |
} | |
@media (max-width: 767px) { | |
.markdown-body { | |
padding: 15px; | |
} | |
} | |
</style> | |
</head> | |
<body class="markdown-body"> | |
<%= output %> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment