forked from gbadev-org/tonc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpelicanconf.py
152 lines (130 loc) · 3.68 KB
/
pelicanconf.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import sys
sys.path.append('.')
from extensions.xnos import XNosExtension
AUTHOR = 'J. Vijn & gbadev.net community'
SITENAME = 'Tonc'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'Europe/London'
DEFAULT_LANG = 'en'
# Don't put pages in a subdirectory
PAGE_URL = '{slug}.html'
PAGE_SAVE_AS = '{slug}.html'
PAGE_LANG_URL = '{slug}-{lang}.html'
PAGE_LANG_SAVE_AS = '{slug}-{lang}.html'
DISPLAY_PAGES_ON_MENU = False
MARKDOWN = {
'extensions': [
'fenced_code',
'toc',
'attr_list',
'md_in_html',
'codehilite',
XNosExtension(),
],
'extension_configs': {
'markdown.extensions.toc': {
'anchorlink': True,
'toc_depth': '2-2',
},
},
}
PAGE_LIST = [
{
'name': "Preface",
'pages': [
('i', 'toc', "Contents"),
('ii', 'intro', "Introduction to Tonc"),
]
}, {
'name': "GBA Basics",
'pages': [
('1', 'hardware', "GBA Hardware"),
('2', 'setup', "Setting up a development environment"),
('3', 'first', "My First GBA Demo"),
('4', 'video', "Video Introduction"),
('5', 'bitmaps', "The bitmap modes"),
('6', 'keys', "The GBA keypad"),
('7', 'objbg', "Sprite and tiled background overview"),
('8', 'regobj', "Regular sprites"),
('9', 'regbg', "Regular tiled backgrounds"),
]
}, {
'name': "GBA Extended",
'pages': [
('10', 'affine', "The affine transformation matrix"),
('11', 'affobj', "Affine sprites"),
('12', 'affbg', "Affine tiled backgrounds"),
('13', 'gfx', "Graphic effects"),
('14', 'dma', "Direct Memory Access"),
('15', 'timers', "Timers"),
('16', 'interrupts', "Hardware interrupts"),
('17', 'swi', "BIOS calls"),
('18', 'sndsqr', "Beep! GBA sound introduction"),
]
}, {
'name': "Advanced / Applications",
'pages': [
('19', 'text', "Text systems"),
('20', 'mode7', "Mode 7"),
('21', 'mode7ex', "More Mode7 tricks"),
('22', 'tte', "Tonc's Text Engine"),
('23', 'asm', "Whirlwind tour of ARM assembly"),
('24', 'lab', "The Lab"),
]
}, {
'name': "Appendixes",
'pages': [
('A', 'numbers', "Numbers, bits and bit operations"),
('B', 'fixed', "Fixed-point math & LUTs"),
('C', 'matrix', "Vector and matrix math"),
('D', 'makefile', "More on makefiles and compiler options"),
('E', 'edmake', "Make via editors"),
('F', 'refs', "References"),
('G', 'log', "Change Log"),
]
}
]
# These aren't great but eh.
def prev_page(page):
prev_num = None
prev_slug = None
prev_name = None
for section in PAGE_LIST:
for (num, slug, name) in section['pages']:
if slug == page.slug:
return (prev_num, prev_slug, prev_name)
prev_num = num
prev_slug = slug
prev_name = name
return (None, None, None)
def next_page(page):
prev_slug = None
for section in PAGE_LIST:
for (num, slug, name) in section['pages']:
if prev_slug == page.slug:
return (num, slug, name)
prev_slug = slug
return (None, None, None)
# Make these utilities available in page template.
PREV = prev_page
NEXT = next_page
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
THEME = 'theme'
STATIC_PATHS = ['img']
# PAGE_URL = 'pages/{slug}.html'
# PAGE_URL = '{slug}.html'
# use filenames for slug
SLUGIFY_SOURCE = 'basename'
DEFAULT_PAGINATION = False
PLUGIN_PATHS = ['plugins']
PLUGINS = []
# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True
# DIRECT_TEMPLATES = ['index', 'authors', 'categories', 'tags', 'archives']
DIRECT_TEMPLATES = ['index']