Added page model, beautified code, created index page(finally)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
from flask import Flask, url_for, render_template, abort
|
||||
import os
|
||||
import json
|
||||
from app.config import PANDOC_LINK, PANDOC_PATH, WHITELIST_PATH
|
||||
from app.hash_manager import hash_file_sha512
|
||||
import subprocess
|
||||
from app.page_model import WikiPage
|
||||
from typing import List
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -13,7 +13,24 @@ def override_url_for():
|
||||
return dict(url_for=dated_url_for)
|
||||
|
||||
|
||||
#TODO: make instead of datetime hash of commit
|
||||
def get_all_names():
|
||||
whitelist = WHITELIST_PATH
|
||||
with open(whitelist, 'r') as f:
|
||||
lines = f.read().splitlines()
|
||||
return lines
|
||||
|
||||
|
||||
def get_page(name: str) -> WikiPage:
|
||||
if name not in get_all_names():
|
||||
raise Exception("Page doesn't exist!")
|
||||
path = f'{PANDOC_PATH}/{name}'
|
||||
with open(f'{path}/config.json', 'r') as f:
|
||||
page = WikiPage.parse_raw(f.read())
|
||||
return page
|
||||
|
||||
|
||||
def get_all_pages() -> List[WikiPage]:
|
||||
return [get_page(name) for name in get_all_names()]
|
||||
|
||||
|
||||
def dated_url_for(endpoint, **values):
|
||||
@@ -25,53 +42,36 @@ def dated_url_for(endpoint, **values):
|
||||
return url_for(endpoint, **values)
|
||||
|
||||
|
||||
def render_page(page):
|
||||
path = f'{PANDOC_PATH}/{page}'
|
||||
whitelist = WHITELIST_PATH
|
||||
with open(whitelist, 'r') as f:
|
||||
lines = f.read().splitlines()
|
||||
if page not in lines:
|
||||
raise Exception("Page doesn't exist!")
|
||||
if not os.path.exists(f'{path}'):
|
||||
def render_page(page: WikiPage):
|
||||
if page.name not in get_all_names():
|
||||
raise Exception("Page doesn't exist!")
|
||||
in_filename = f'{path}/main.md'
|
||||
out_filename = f'{path}/render.html'
|
||||
in_filename = page.get_file('main.md')
|
||||
out_filename = page.get_file('render.html')
|
||||
os.system(f'pandoc {in_filename} --to html --mathjax --output {out_filename}')
|
||||
print('Creating lock file')
|
||||
os.system(f'echo {hash_file_sha512(in_filename)} > {out_filename}.lock')
|
||||
|
||||
|
||||
@app.route(f'/{PANDOC_LINK}/<page>')
|
||||
def get_pandoc_page(page):
|
||||
path = f'{PANDOC_PATH}/{page}'
|
||||
whitelist = WHITELIST_PATH
|
||||
with open(whitelist, 'r') as f:
|
||||
lines = f.read().splitlines()
|
||||
if page not in lines:
|
||||
print(f'Access to page not in list {page}')
|
||||
return 'This page does not exist'
|
||||
if not os.path.exists(f'{path}'):
|
||||
# TODO: Add 404 handler
|
||||
return 'This page does not exist'
|
||||
with open(f'{path}/config.json') as f:
|
||||
data = json.loads(f.read())
|
||||
if not os.path.exists(f'{path}/render.html') or not os.path.exists(f'{path}/render.html.lock'):
|
||||
print(f'Rendered page or lockfile for {page} does not exist! Rendering {page}')
|
||||
@app.route(f'/{PANDOC_LINK}/<name>')
|
||||
def get_pandoc_page(name: str):
|
||||
page = get_page(name)
|
||||
if not os.path.exists(page.get_file('render.html')) or not os.path.exists(page.get_file('render.html.lock')):
|
||||
print(f'Rendered page or lockfile for {name} does not exist! Rendering {name}')
|
||||
render_page(page)
|
||||
else:
|
||||
with open(f'{path}/render.html.lock', 'r') as f:
|
||||
with open(page.get_file('render.html.lock'), 'r') as f:
|
||||
rendered_hash = f.read().strip()
|
||||
current_hash = hash_file_sha512(f'{path}/main.md')
|
||||
current_hash = hash_file_sha512(page.get_file('main.md'))
|
||||
if rendered_hash != current_hash:
|
||||
print(f'CURRENT: {current_hash}, RENDERED: {rendered_hash}')
|
||||
print(f'Integrity test failed, rendering {page}!')
|
||||
print(f'Integrity test failed, rendering {name}!')
|
||||
render_page(page)
|
||||
template = data['template']
|
||||
with open(f'{path}/render.html', 'r') as f:
|
||||
template = page.template
|
||||
with open(page.get_file('render.html'), 'r') as f:
|
||||
inserted = f.read()
|
||||
return render_template(template, markdown=inserted, config=data)
|
||||
return render_template(template, markdown=inserted, config=page)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
return render_template('index.html', pages=get_all_pages(), PANDOC_LINK=PANDOC_LINK)
|
||||
|
14
app/page_model.py
Normal file
14
app/page_model.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
from app.config import PANDOC_PATH
|
||||
|
||||
|
||||
class WikiPage(BaseModel):
|
||||
name: str
|
||||
title: str
|
||||
credits: List[str]
|
||||
standalone: bool
|
||||
template: str
|
||||
|
||||
def get_file(self, filename: str) -> str:
|
||||
return f'{PANDOC_PATH}/{self.name}/{filename}'
|
@@ -40,7 +40,7 @@ a {
|
||||
|
||||
/* BEGIN ALGORITHMICA OLD STYLE */
|
||||
|
||||
body {
|
||||
.pagebody {
|
||||
/* color: #444; */
|
||||
font-family: "Times New Roman", Times, "Tinos", serif;
|
||||
font-size: 16px;
|
||||
@@ -53,7 +53,7 @@ body {
|
||||
padding-bottom: 25px;
|
||||
}
|
||||
|
||||
.credits {
|
||||
.pagebody .credits {
|
||||
font-size: 14px;
|
||||
margin: 25px 10px -40px 15px;
|
||||
padding: 16px 50px 0 50px;
|
||||
@@ -62,26 +62,26 @@ body {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.credits table {
|
||||
.pagebody .credits table {
|
||||
border: none;
|
||||
margin-left: 46px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.credits table td{
|
||||
.pagebody .credits table td{
|
||||
border: none;
|
||||
padding: 0;
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
#header {
|
||||
.pagebody #header {
|
||||
height: 55px;
|
||||
margin-top: -8px;
|
||||
margin-bottom: 20px;
|
||||
border-bottom: 1px solid #666;
|
||||
}
|
||||
|
||||
#links {
|
||||
.pagebody #links {
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
font-size: 16px;
|
||||
@@ -90,27 +90,27 @@ body {
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
#links a {
|
||||
.pagebody #links a {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
#header a:hover {
|
||||
.pagebody #header a:hover {
|
||||
color: #0645ad!important;
|
||||
}
|
||||
|
||||
#header a {
|
||||
.pagebody #header a {
|
||||
color: #111 !important;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#logo {
|
||||
.pagebody #logo {
|
||||
margin-top: 10px;
|
||||
font-size: 22px;
|
||||
height: 0;
|
||||
font-family: 'Garamond', serif;
|
||||
}
|
||||
|
||||
.contents {
|
||||
.pagebody .contents {
|
||||
position: inline-block;
|
||||
float: left;
|
||||
position: relative;
|
||||
@@ -119,13 +119,13 @@ body {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.contents ul {
|
||||
.pagebody .contents ul {
|
||||
padding-left: 22px;
|
||||
margin-top: 10px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.contents li {
|
||||
.pagebody .contents li {
|
||||
font-size: 8px;
|
||||
color: lightgrey;
|
||||
font-family: 'Open Sans', sans;
|
||||
@@ -135,16 +135,16 @@ body {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.contents li:hover {
|
||||
.pagebody .contents li:hover {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.contents li:first-letter {
|
||||
.pagebody .contents li:first-letter {
|
||||
font-size: 13px;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.contents a {
|
||||
.pagebody .contents a {
|
||||
font-family: "Times New Roman", Times, "Tinos", serif;
|
||||
font-size: 16px;
|
||||
line-height: 1em;
|
||||
@@ -152,16 +152,16 @@ body {
|
||||
width: 252px;
|
||||
}
|
||||
|
||||
.contents a:first-letter {
|
||||
.pagebody .contents a:first-letter {
|
||||
font-size: 16px; /* the only way to fix */
|
||||
}
|
||||
|
||||
.contents a:after {
|
||||
.pagebody .contents a:after {
|
||||
content: "\A";
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.contents li:before {
|
||||
.pagebody .contents li:before {
|
||||
content: '•';
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
@@ -171,45 +171,45 @@ body {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
a {
|
||||
.pagebody a {
|
||||
color: #0645ad;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
.pagebody a:visited {
|
||||
color: #0b0080;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
.pagebody a:hover {
|
||||
color: #06e;
|
||||
}
|
||||
|
||||
a:active {
|
||||
.pagebody a:active {
|
||||
color: #faa700;
|
||||
}
|
||||
|
||||
a:focus {
|
||||
.pagebody a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
p {
|
||||
.pagebody p {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
img {
|
||||
.pagebody img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
.pagebody .title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
.pagebody h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 0.8em !important;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
.pagebody h1, h2, h3, h4, h5, h6 {
|
||||
font-family: 'Garamond', serif;
|
||||
color: #111;
|
||||
line-height: 125%;
|
||||
@@ -218,54 +218,54 @@ h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h2, h3 {
|
||||
.pagebody h2, h3 {
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 1px solid #eaecef;
|
||||
}
|
||||
|
||||
.contents h2, .contents h3 {
|
||||
.pagebody .contents h2, .contents h3 {
|
||||
padding-bottom: 0;
|
||||
border-bottom: none;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
h4, h5, h6 {
|
||||
.pagebody h4, h5, h6 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h1 {
|
||||
.pagebody h1 {
|
||||
font-size: 2.5em;
|
||||
margin-top: 0.8em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
.pagebody h2 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
.pagebody h3 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
.pagebody h4 {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
h5 {
|
||||
.pagebody h5 {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
h6 {
|
||||
.pagebody h6 {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
.pagebody blockquote {
|
||||
color: #666666;
|
||||
margin: 0;
|
||||
padding-left: 1em;
|
||||
border-left: 0.5em #EEE solid;
|
||||
}
|
||||
|
||||
hr {
|
||||
.pagebody hr {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 0px;
|
||||
@@ -275,101 +275,101 @@ hr {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
pre, code, kbd, samp {
|
||||
.pagebody pre, code, kbd, samp {
|
||||
color: #000;
|
||||
font-family: 'Inconsolata', monospace;
|
||||
}
|
||||
|
||||
pre {
|
||||
.pagebody pre {
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
b, strong {
|
||||
.pagebody b, strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
dfn {
|
||||
.pagebody dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
ins {
|
||||
.pagebody ins {
|
||||
background: #ff9;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
mark {
|
||||
.pagebody mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
sub, sup {
|
||||
.pagebody sub, sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
.pagebody sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
.pagebody sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
.pagebody ul, ol {
|
||||
margin: 1em 0;
|
||||
padding: 0 0 0 2em;
|
||||
}
|
||||
|
||||
li p:last-child {
|
||||
.pagebody li p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
li ul {
|
||||
.pagebody li ul {
|
||||
padding-left: 18px;
|
||||
padding-top: 1px;
|
||||
}
|
||||
|
||||
ul ul, ol ol {
|
||||
.pagebody ul ul, ol ol {
|
||||
margin: .3em 0;
|
||||
}
|
||||
|
||||
dl {
|
||||
.pagebody dl {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
dt {
|
||||
.pagebody dt {
|
||||
font-weight: bold;
|
||||
margin-bottom: .8em;
|
||||
}
|
||||
|
||||
dd {
|
||||
.pagebody dd {
|
||||
margin: 0 0 .8em 2em;
|
||||
}
|
||||
|
||||
dd:last-child {
|
||||
.pagebody dd:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
.pagebody img {
|
||||
border: 0;
|
||||
-ms-interpolation-mode: bicubic;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
figure {
|
||||
.pagebody figure {
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
img {
|
||||
.pagebody img {
|
||||
border: none;
|
||||
margin: auto;
|
||||
display: block;
|
||||
@@ -377,13 +377,13 @@ img {
|
||||
max-height: 320px;
|
||||
}
|
||||
|
||||
figcaption {
|
||||
.pagebody figcaption {
|
||||
font-size: 0.8em;
|
||||
font-style: italic;
|
||||
margin: 0 0 .8em;
|
||||
}
|
||||
|
||||
table {
|
||||
.pagebody table {
|
||||
margin-bottom: 2em;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-right: 1px solid #ddd;
|
||||
@@ -391,21 +391,21 @@ table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table th {
|
||||
.pagebody table th {
|
||||
padding: .2em 1em;
|
||||
background-color: #eee;
|
||||
border-top: 1px solid #ddd;
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
|
||||
table td {
|
||||
.pagebody table td {
|
||||
padding: .2em 1em;
|
||||
border-top: 1px solid #ddd;
|
||||
border-left: 1px solid #ddd;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.author {
|
||||
.pagebody .author {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
@@ -417,7 +417,7 @@ table td {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
code:not([class]) {
|
||||
.pagebody code:not([class]) {
|
||||
border: 1px solid #ddd !important;
|
||||
background-color: #f8f8f8 !important;
|
||||
border-radius: 3px !important;
|
||||
@@ -426,7 +426,7 @@ code:not([class]) {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
pre {
|
||||
.pagebody pre {
|
||||
border: 1px solid #ddd !important;
|
||||
background-color: #f8f8f8 !important;
|
||||
border-radius: 3px !important;
|
||||
@@ -436,7 +436,7 @@ pre {
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
.pagebody {
|
||||
font-size: 12pt;
|
||||
width: 190mm;
|
||||
margin: 0;
|
||||
@@ -449,11 +449,11 @@ pre {
|
||||
display: none;
|
||||
}
|
||||
|
||||
pre, ul, ol {
|
||||
.pagebody pre, ul, ol {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
h1::after, h2::after, h3::after {
|
||||
.pagebody h1::after, h2::after, h3::after {
|
||||
/* page-break-after: avoid; */
|
||||
content: "";
|
||||
display: block;
|
||||
@@ -470,7 +470,7 @@ pre {
|
||||
}
|
||||
*/
|
||||
|
||||
a, a:visited {
|
||||
.pagebody a, a:visited {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@@ -480,68 +480,25 @@ pre {
|
||||
}
|
||||
*/
|
||||
|
||||
p, h2, h3 {
|
||||
.pagebody p, h2, h3 {
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
a[href^='http://sereja.me']:before {
|
||||
content: url('http://sereja.me/favicon.ico');
|
||||
margin-right: 4px;
|
||||
}
|
||||
*/
|
||||
|
||||
a[href^='http://e-maxx.ru']:before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url('http://e-maxx.ru/favicon.ico') no-repeat;
|
||||
background-size: 18px;
|
||||
}
|
||||
|
||||
/*
|
||||
a[href^='https://algorithmica.org']:before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url('https://algorithmica.org/favicon.ico') no-repeat;
|
||||
background-size: 18px;
|
||||
}
|
||||
*/
|
||||
|
||||
/* https://habrahabr.ru/favicon.ico */
|
||||
|
||||
a[href^='https://neerc.ifmo.ru']:before {
|
||||
.pagebody a[href^='https://neerc.ifmo.ru']:before {
|
||||
content: url('https://neerc.ifmo.ru/favicon.ico');
|
||||
margin-right: 4px;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
}
|
||||
|
||||
a[href^='https://www.youtube.com']:before {
|
||||
content: url('https://www.youtube.com/favicon.ico');
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
a[href^='https://codeforces.com']:before {
|
||||
.pagebody a[href^='https://codeforces.com']:before {
|
||||
content: url('http://codeforces.com/favicon.ico');
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
a[href^='https://www.topcoder.com/']:before {
|
||||
content: url('https://s3.amazonaws.com/app.topcoder.com/favicon.ico');
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
a[href=''] {
|
||||
.pagebody a[href=''] {
|
||||
color: black;
|
||||
cursor: default;
|
||||
}
|
||||
@@ -550,32 +507,29 @@ a[href=''] {
|
||||
|
||||
/* BEGIN PANDOC EMBEDDED STYLE FOR CODE */
|
||||
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
pre > code.sourceCode { white-space: pre; position: relative; }
|
||||
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
||||
pre > code.sourceCode > span:empty { height: 1.2em; }
|
||||
.sourceCode { overflow: visible; }
|
||||
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
||||
div.sourceCode { margin: 1em 0; }
|
||||
pre.sourceCode { margin: 0; }
|
||||
.pagebody code{white-space: pre-wrap;}
|
||||
.pagebody span.smallcaps{font-variant: small-caps;}
|
||||
.pagebody span.underline{text-decoration: underline;}
|
||||
.pagebody div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
.pagebody div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
.pagebody ul.task-list{list-style: none;}
|
||||
.pagebody pre > code.sourceCode { white-space: pre; position: relative; }
|
||||
.pagebody pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
||||
.pagebody pre > code.sourceCode > span:empty { height: 1.2em; }
|
||||
.pagebody .sourceCode { overflow: visible; }
|
||||
.pagebody code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
||||
.pagebody div.sourceCode { margin: 1em 0; }
|
||||
.pagebody pre.sourceCode { margin: 0; }
|
||||
@media screen {
|
||||
div.sourceCode { overflow: auto; }
|
||||
.pagebody div.sourceCode { overflow: auto; }
|
||||
}
|
||||
@media print {
|
||||
pre > code.sourceCode { white-space: pre-wrap; }
|
||||
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
||||
.pagebody pre > code.sourceCode { white-space: pre-wrap; }
|
||||
.pagebody pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
||||
}
|
||||
pre.numberSource code
|
||||
{ counter-reset: source-line 0; }
|
||||
pre.numberSource code > span
|
||||
{ position: relative; left: -4em; counter-increment: source-line; }
|
||||
pre.numberSource code > span > a:first-child::before
|
||||
{ content: counter(source-line);
|
||||
.pagebody pre.numberSource code { counter-reset: source-line 0; }
|
||||
.pagebody pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; }
|
||||
.pagebody pre.numberSource code > span > a:first-child::before { content: counter(source-line);
|
||||
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
||||
border: none; display: inline-block;
|
||||
-webkit-touch-callout: none; -webkit-user-select: none;
|
||||
@@ -584,40 +538,39 @@ pre.numberSource code > span > a:first-child::before
|
||||
padding: 0 4px; width: 4em;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
|
||||
div.sourceCode
|
||||
{ }
|
||||
.pagebody pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
|
||||
.pagebody div.sourceCode { }
|
||||
@media screen {
|
||||
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
||||
.pagebody pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
||||
}
|
||||
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code span.at { color: #7d9029; } /* Attribute */
|
||||
code span.bn { color: #40a070; } /* BaseN */
|
||||
code span.bu { } /* BuiltIn */
|
||||
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code span.ch { color: #4070a0; } /* Char */
|
||||
code span.cn { color: #880000; } /* Constant */
|
||||
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code span.dt { color: #902000; } /* DataType */
|
||||
code span.dv { color: #40a070; } /* DecVal */
|
||||
code span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code span.ex { } /* Extension */
|
||||
code span.fl { color: #40a070; } /* Float */
|
||||
code span.fu { color: #06287e; } /* Function */
|
||||
code span.im { } /* Import */
|
||||
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code span.op { color: #666666; } /* Operator */
|
||||
code span.ot { color: #007020; } /* Other */
|
||||
code span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code span.ss { color: #bb6688; } /* SpecialString */
|
||||
code span.st { color: #4070a0; } /* String */
|
||||
code span.va { color: #19177c; } /* Variable */
|
||||
code span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
.pagebody code span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
.pagebody code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
.pagebody code span.at { color: #7d9029; } /* Attribute */
|
||||
.pagebody code span.bn { color: #40a070; } /* BaseN */
|
||||
.pagebody code span.bu { } /* BuiltIn */
|
||||
.pagebody code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
.pagebody code span.ch { color: #4070a0; } /* Char */
|
||||
.pagebody code span.cn { color: #880000; } /* Constant */
|
||||
.pagebody code span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
.pagebody code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
.pagebody code span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
.pagebody code span.dt { color: #902000; } /* DataType */
|
||||
.pagebody code span.dv { color: #40a070; } /* DecVal */
|
||||
.pagebody code span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
.pagebody code span.ex { } /* Extension */
|
||||
.pagebody code span.fl { color: #40a070; } /* Float */
|
||||
.pagebody code span.fu { color: #06287e; } /* Function */
|
||||
.pagebody code span.im { } /* Import */
|
||||
.pagebody code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
.pagebody code span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
.pagebody code span.op { color: #666666; } /* Operator */
|
||||
.pagebody code span.ot { color: #007020; } /* Other */
|
||||
.pagebody code span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
.pagebody code span.sc { color: #4070a0; } /* SpecialChar */
|
||||
.pagebody code span.ss { color: #bb6688; } /* SpecialString */
|
||||
.pagebody code span.st { color: #4070a0; } /* String */
|
||||
.pagebody code span.va { color: #19177c; } /* Variable */
|
||||
.pagebody code span.vs { color: #4070a0; } /* VerbatimString */
|
||||
.pagebody code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
|
||||
/* END PANDOC EMBEDDED STYLE FOR CODE */
|
||||
|
@@ -1 +1,13 @@
|
||||
Wiki index page
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Статьи:
|
||||
{% for page in pages %}
|
||||
<br>
|
||||
<a href="/{{PANDOC_LINK}}/{{page.name}}">{{page.title}}</a>(Авторы: {{', '.join(page.credits)}})
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user