Your Name 5 years ago
commit c423548258

@ -1,6 +1,7 @@
import os, json, sys
from mwclient import Site
from jinja2 import Template
from shutil import copy
import html5lib
from functions import Colors
import argparse
@ -29,6 +30,16 @@ print(args)
site = Site(host=args.host, path=args.path)
wd = os.path.dirname(os.path.abspath(__file__)) # working directory
wd_name = os.path.split(wd)[-1] # name of dir running script
# copy static/ to ../archive/static
repo_static_path = './static'
archive_static_path = os.path.join(args.output, repo_static_path)
os.makedirs(archive_static_path, exist_ok=True) # create static/ dir in archive
for static_file in os.listdir(path='./static'):
copy(src=os.path.join(repo_static_path, static_file),
dst=os.path.join(archive_static_path, static_file))
with open('login.txt', 'r') as login: # read login user & pwd
loginlines = login.read()
user, pwd = loginlines.split('\n')
@ -116,8 +127,7 @@ def dumppage(p, template, rewrite_images=True):
htmlsrc = rewritelinks(htmlsrc)
if rewrite_images:
htmlsrc = rewriteimgs(htmlsrc)
# TODO: ANdre structure of archive: from ./archive/0 to: ./archive ./0
html = template.render(page=p, body=htmlsrc, staticpath=f'../{wd_name}')
html = template.render(page=p, body=htmlsrc, staticpath='.')
with open(os.path.join(args.output, filenameforpage(p)), 'w') as f:
f.write(html)
# print(html, file=f)

@ -1,4 +1,11 @@
body{ width: max-content;}
body{
width: max-content;
background-color: #F4EBE8;
}
h1 {
font-family: Roboto Mono;
}
div#body{ width: max-content;}
@ -13,16 +20,21 @@ div#body{ width: max-content;}
display: inline-block;
}
.content {
border-style: solid 1px black;
background-color: red;
color: #444;
cursor: pointer;
padding: 5px;
.indexlink {
position: fixed;
font-size: 15px;
z-index: +1;
font-family: Times New Roman;
font-size: 20px;
bottom: 0%;
right: 3%;
background-color: transparent;
border: none;
border-right-color: transparent;
z-index: 10;
padding: 0px 30px 20px 10px
border: none;
}
.indexlink a {
text-decoration: none;
}
.horizontal-scroll-wrapper {
@ -36,58 +48,35 @@ display: inline-block;
.event {
text-align-last: auto;
font-family: Arial;
font-family: Roboto Mono;
font-size: 10px;
/* padding-top: 5vw; */
padding-left: 5vw;
display: inline-block;
width:400px;
width:200px;
vertical-align: top;
}
.pubpageinfo {
padding-top: 10px;
font-size: 10px;
}
.pubpageinfo:hover {
background-color: #0BEFEB;
padding: 10px;
font-size: 15px;
}
.thumbborder {
/* display: none;*/
box-shadow: 8px 8px 8px #C4BCB9;
width: 30%;
height: auto;
}
.thumbborder:hover {
box-shadow: 8px 8px 8px #0BEFEB;
width:100%;
transition:0.5s;
height: auto;
}
.bar-chart {
display: table;
margin-top: 20px;
}
.row {
display: table-row;
}
.row div {
display: table-cell;
width: 60px;
height: 44px;
border-right: 2px solid rgb(255, 255, 255);
}
.row .axis-y {
width: 96px;
border-right: 1px solid #000;
vertical-align: top;
}
.axis-x div {
border-top: 1px solid #000;
}
.axis-x .axis-y {
border: none;
}
.axis-x div, .axis-y {
text-align: center;
font-weight: bold;
}
Loading…
Cancel
Save