Changes to new build system to include URI keyword/building.
This commit is contained in:
parent
d64781b7c2
commit
f1607b3d25
11
build.py
11
build.py
@ -112,12 +112,18 @@ def GetFileStructure():
|
||||
level = PartToLevel(hdr['part'])
|
||||
hdr['level'] = level
|
||||
fnames[level] = MakeFilename(hdr['title'])
|
||||
|
||||
# Ickyness--user specified URIs
|
||||
if 'uri' in hdr:
|
||||
hdr['filename'] = hdr['uri']
|
||||
else:
|
||||
fullName = ''
|
||||
|
||||
for i in range(level + 1):
|
||||
fullName = fullName + fnames[i] + '/'
|
||||
|
||||
hdr['filename'] = fullName.rstrip('/')
|
||||
|
||||
fs.append(hdr)
|
||||
|
||||
if ('include' not in hdr) and (level > 0):
|
||||
@ -466,7 +472,10 @@ for header in fileStruct:
|
||||
page = page.replace('{{ content }}', content + more)
|
||||
|
||||
# Create the directory for the index.html file to go into
|
||||
os.mkdir(siteDir + header['filename'], 0o775)
|
||||
# (we use makedirs, because we have to in order to accomadate the 'uri'
|
||||
# keyword
|
||||
# os.mkdir(siteDir + header['filename'], 0o775)
|
||||
os.makedirs(siteDir + header['filename'], 0o775, exist_ok=True)
|
||||
|
||||
# Finally, write the file!
|
||||
destFile = open(siteDir + header['filename'] + '/index.html', 'w')
|
||||
|
@ -114,6 +114,9 @@ for line in master:
|
||||
if 'link' in header:
|
||||
explode.write('link: ' + header['link'] + '\n')
|
||||
|
||||
if 'uri' in header:
|
||||
explode.write('uri: ' + header['uri'] + '\n')
|
||||
|
||||
if 'style' in header:
|
||||
explode.write('style: ' + header['style'] + '\n')
|
||||
|
||||
|
@ -94,6 +94,9 @@ for line in master:
|
||||
if 'link' in header:
|
||||
implode.write('link: ' + header['link'] + '\n')
|
||||
|
||||
if 'uri' in header:
|
||||
implode.write('uri: ' + header['uri'] + '\n')
|
||||
|
||||
if 'style' in header:
|
||||
implode.write('style: ' + header['style'] + '\n')
|
||||
|
||||
|
241
master-doc.txt
241
master-doc.txt
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user