-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpelicanconf.py
More file actions
56 lines (41 loc) · 1.39 KB
/
pelicanconf.py
File metadata and controls
56 lines (41 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import sys
import os
from markdown import Markdown
import shutil
sys.path = ['./'] + sys.path
PLUGIN_PATH = './plugins'
TIMEZONE = 'Europe/London'
from plugins import citations, latex
PLUGINS = [citations,latex]
SITENAME = 'Program Analysis: Analysis'
SITEURL = 'http://www.doc.ic.ac.uk/project/2013/163/g12163xx/web'
DEFAULT_LANG = u'en'
DEFAULT_PAGINATION = False
ARTICLE_DIR = './summaries/'
PAGE_DIR = './pages/'
OUTPUT_DIR = './output/'
INTRODUCTION_DIR = './introductions/'
THEME = './theme'
APP_DIR = './app/'
# TODO: REFACTOR ALL THIS
DEPENDENCY_DIR_JS = './script'
DEPENDENCY_DIR_CSS = './style'
DEPENDENCY_DIR_IMAGES = './images'
shutil.rmtree(OUTPUT_DIR)
shutil.copytree(APP_DIR, OUTPUT_DIR + APP_DIR)
shutil.copytree(DEPENDENCY_DIR_JS, OUTPUT_DIR + DEPENDENCY_DIR_JS)
shutil.copytree(DEPENDENCY_DIR_CSS, OUTPUT_DIR + DEPENDENCY_DIR_CSS)
shutil.copytree(DEPENDENCY_DIR_IMAGES, OUTPUT_DIR + DEPENDENCY_DIR_IMAGES)
RELATIVE_URLS = True
# TODO: Move these into their own files.
INTROS = {}
md = Markdown()
for root, _, files in os.walk(INTRODUCTION_DIR):
for name in files:
category, ext = os.path.splitext(name)
if ext != '.md':
print 'Skipping ' + name + ' as doesn\'t end in .md'
continue
with open(os.path.join(root, name), 'r') as f:
print 'Considering ' + name
INTROS[category.strip().lower()] = md.convert(f.read())