Merge branch 'configuration'
This commit is contained in:
commit
4efd1a11c8
10
mdlive.py
10
mdlive.py
|
@ -5,7 +5,6 @@ import subprocess
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
app = Flask(__name__, static_url_path='')
|
app = Flask(__name__, static_url_path='')
|
||||||
command = shlex.split('/usr/bin/pandoc -f markdown+footnotes+inline_notes+auto_identifiers -t html5 --smart --email-obfuscation=references')
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
|
@ -16,9 +15,12 @@ def parse():
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
data = request.form['markdown']
|
data = request.form['markdown']
|
||||||
proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
|
proc = subprocess.Popen(app.config['COMMAND'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
|
||||||
return proc.communicate(input=data)
|
return proc.communicate(input=data)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.debug = False
|
app.config['HOST'] = 'localhost'
|
||||||
app.run()
|
app.config['PORT'] = 5000
|
||||||
|
app.config.from_object('mdlive.default_configuration')
|
||||||
|
app.config['COMMAND'] = shlex.split(app.config['PARSER'])
|
||||||
|
app.run(host=app.config['HOST'], port=app.config['PORT'])
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
PARSER = '/usr/bin/pandoc -f markdown+footnotes+inline_notes+auto_identifiers -t html5 --smart --email-obfuscation=references'
|
||||||
|
HOST = '127.0.0.1'
|
||||||
|
PORT = 5000
|
||||||
|
DEBUG = True
|
||||||
|
CSS = 'blog.css'
|
|
@ -0,0 +1,28 @@
|
||||||
|
@import url('https://ludikovsky.name/fonts/fonts.css');
|
||||||
|
|
||||||
|
article > footer {
|
||||||
|
text-align: right;
|
||||||
|
color: #777;
|
||||||
|
font-variant: small-caps;
|
||||||
|
font-size: 11pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
article > div {
|
||||||
|
font-size: 14pt;
|
||||||
|
font-family: 'DejaVu Serif', sans-serif
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
border-left-color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-family: 'Hack', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
font-variant-ligatures: common-ligatures;
|
||||||
|
font-kerning: normal;
|
||||||
|
font-family: 'DejaVu Sans', sans-serif;
|
||||||
|
}
|
|
@ -6,18 +6,8 @@
|
||||||
<script src="https://cdn.jsdelivr.net/jquery/2.2.3/jquery.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/jquery/2.2.3/jquery.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/font-hack/2.018/css/hack.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/font-hack/2.018/css/hack.min.css">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" media="screen">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" media="screen">
|
||||||
<link rel="stylesheet" href="https://ludikovsky.name/blog/blog.css" type="text/css" media="screen">
|
<link rel="stylesheet" href="mdlive.css" type="text/css">
|
||||||
<style>
|
<link rel="stylesheet" href="blog.css" type="text/css" media="screen">
|
||||||
textarea {
|
|
||||||
width: 100%;
|
|
||||||
height: 800px;
|
|
||||||
font-family: Hack, monospace;
|
|
||||||
}
|
|
||||||
div.container {
|
|
||||||
height: 800px;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="col-md-2"></div>
|
<div class="col-md-2"></div>
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
textarea#markdown {
|
||||||
|
width: 100%;
|
||||||
|
height: 800px;
|
||||||
|
font-family: Hack, monospace;
|
||||||
|
}
|
||||||
|
div.container > #output {
|
||||||
|
height: 800px;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue