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

This commit is contained in:
systers 2021-06-28 14:53:23 +02:00
parent bc67c1819c
commit 5559f4614a
8 changed files with 18 additions and 13 deletions

View File

@ -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. #The following three lines are the variables that need to be changed when making a new project.
PROJECTNAME = 'dsn' PROJECTNAME = 'dsn'
DIR_PATH = '/home/systers/dsn-documentation' ·························· DIR_PATH = '/home/systers/dsn-documentation'
PORTNUMBER = 5599 PORTNUMBER = 5123
# --- # ---
@ -38,7 +38,7 @@ def pagedjs():
# generate html page with the pandoc template (with paged.js inserted in the header) # 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') 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']) @APP.route('/html/', methods=['GET', 'POST'])
def html(): def html():
@ -55,4 +55,4 @@ def stylesheet():
if __name__ == '__main__': if __name__ == '__main__':
APP.debug=True APP.debug=True
APP.run(port={ PORTNUMBER }) APP.run(port=f'{ PORTNUMBER }')

View File

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

View File

@ -2,16 +2,16 @@
<html lang='en'> <html lang='en'>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>RDI</title> <title>DSN documentation</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css')}}"> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css')}}">
</head> </head>
<body> <body>
<h1>RDI documentation</h1> <h1>DSN documentation</h1>
<div id="nav"> <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="/html/">html</a>,
<a href="/pagedjs/">pagedjs</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>
<div id="wrapper"> <div id="wrapper">
{% block content %} {% block content %}

View File

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

View File

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

5
templates/pagedjs.html Normal file
View File

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

View File

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

View File

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