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. #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 }')

2
static/main.css

@ -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{

8
templates/base.html

@ -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 %}

2
templates/html.html

@ -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 %}

2
templates/pad.html

@ -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

@ -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> <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">

2
templates/stylesheet.html

@ -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 %}

Loading…
Cancel
Save