Browse Source

Small updates: changing style, loading the pagedjs in the same iframe

pull/30/head
systers 3 years ago
parent
commit
5559f4614a
  1. 8
      start.py
  2. 2
      static/main.css
  3. 8
      templates/base.html
  4. 2
      templates/html.html
  5. 2
      templates/pad.html
  6. 5
      templates/pagedjs.html
  7. 2
      templates/pandoc-template-pagedjs.html
  8. 2
      templates/stylesheet.html

8
start.py

@ -11,8 +11,8 @@ APP = flask.Flask(__name__)
#The following three lines are the variables that need to be changed when making a new project.
PROJECTNAME = 'dsn'
DIR_PATH = '/home/systers/dsn-documentation' ··························
PORTNUMBER = 5599
DIR_PATH = '/home/systers/dsn-documentation'
PORTNUMBER = 5123
# ---
@ -38,7 +38,7 @@ def pagedjs():
# generate html page with the pandoc template (with paged.js inserted in the header)
os.system(f'pandoc -f markdown -t html -c { PROJECTNAME }.css --toc --toc-depth=1 --template { DIR_PATH }/templates/pandoc-template-pagedjs.html --standalone { DIR_PATH }/static/{ PROJECTNAME }.md -o { DIR_PATH }/static/{ PROJECTNAME }.pagedjs.html')
return open('static/{ PROJECTNAME }.pagedjs.html', 'r').read()
return flask.render_template('pagedjs.html')
@APP.route('/html/', methods=['GET', 'POST'])
def html():
@ -55,4 +55,4 @@ def stylesheet():
if __name__ == '__main__':
APP.debug=True
APP.run(port={ PORTNUMBER })
APP.run(port=f'{ PORTNUMBER }')

2
static/main.css

@ -1,5 +1,5 @@
body{
background-color: lightgreen;
background-color: #eaa0f9;
margin: 1vh 5vw 2vh 5vw;
}
div#nav{

8
templates/base.html

@ -2,16 +2,16 @@
<html lang='en'>
<head>
<meta charset="utf-8" />
<title>RDI</title>
<title>DSN documentation</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css')}}">
</head>
<body>
<h1>RDI documentation</h1>
<h1>DSN documentation</h1>
<div id="nav">
<a href="/">pad</a>: <input type="text" name="pad" value="https://pad.vvvvvvaria.org/RDI.md">,
<a href="/">pad</a>: <input type="text" name="pad" value="https://pad.vvvvvvaria.org/DSN.md">,
<a href="/html/">html</a>,
<a href="/pagedjs/">pagedjs</a>,
<a href="/stylesheet/">stylesheet</a>: <input type="text" name="pad" value="https://pad.vvvvvvaria.org/RDI.css">,
<a href="/stylesheet/">stylesheet</a>: <input type="text" name="pad" value="https://pad.vvvvvvaria.org/DSN.css">,
</div>
<div id="wrapper">
{% block content %}

2
templates/html.html

@ -1,5 +1,5 @@
{% extends "base.html" %}
{% block content %}
<iframe src="{{ url_for('static', filename='RDI.html')}}"></iframe>
<iframe src="{{ url_for('static', filename='dsn.html')}}"></iframe>
{% endblock %}

2
templates/pad.html

@ -1,5 +1,5 @@
{% extends "base.html" %}
{% block content %}
<iframe src="https://pad.vvvvvvaria.org/RDI.md"></iframe>
<iframe src="https://pad.vvvvvvaria.org/dsn.md"></iframe>
{% endblock %}

5
templates/pagedjs.html

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block content %}
<iframe src="{{ url_for('static', filename='dsn.pagedjs.html')}}"></iframe>
{% endblock %}

2
templates/pandoc-template-pagedjs.html

@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/static/RDI.css" rel="stylesheet" type="text/css">
<link href="/static/dsn.css" rel="stylesheet" type="text/css">
<script src="/static/paged.js" type="text/javascript"></script>
<script src="/static/paged.polyfill.js" type="text/javascript"></script>
<link href="/static/interface.css" rel="stylesheet" type="text/css">

2
templates/stylesheet.html

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block content %}
<iframe src="https://pad.vvvvvvaria.org/RDI.css"></iframe>
<iframe src="https://pad.vvvvvvaria.org/dsn.css"></iframe>
{% endblock %}

Loading…
Cancel
Save