Changes to new build system to include URI keyword/building.
This commit is contained in:
parent
d64781b7c2
commit
f1607b3d25
19
build.py
19
build.py
@ -112,12 +112,18 @@ def GetFileStructure():
|
|||||||
level = PartToLevel(hdr['part'])
|
level = PartToLevel(hdr['part'])
|
||||||
hdr['level'] = level
|
hdr['level'] = level
|
||||||
fnames[level] = MakeFilename(hdr['title'])
|
fnames[level] = MakeFilename(hdr['title'])
|
||||||
fullName = ''
|
|
||||||
|
|
||||||
for i in range(level + 1):
|
# Ickyness--user specified URIs
|
||||||
fullName = fullName + fnames[i] + '/'
|
if 'uri' in hdr:
|
||||||
|
hdr['filename'] = hdr['uri']
|
||||||
|
else:
|
||||||
|
fullName = ''
|
||||||
|
|
||||||
|
for i in range(level + 1):
|
||||||
|
fullName = fullName + fnames[i] + '/'
|
||||||
|
|
||||||
|
hdr['filename'] = fullName.rstrip('/')
|
||||||
|
|
||||||
hdr['filename'] = fullName.rstrip('/')
|
|
||||||
fs.append(hdr)
|
fs.append(hdr)
|
||||||
|
|
||||||
if ('include' not in hdr) and (level > 0):
|
if ('include' not in hdr) and (level > 0):
|
||||||
@ -466,7 +472,10 @@ for header in fileStruct:
|
|||||||
page = page.replace('{{ content }}', content + more)
|
page = page.replace('{{ content }}', content + more)
|
||||||
|
|
||||||
# Create the directory for the index.html file to go into
|
# 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!
|
# Finally, write the file!
|
||||||
destFile = open(siteDir + header['filename'] + '/index.html', 'w')
|
destFile = open(siteDir + header['filename'] + '/index.html', 'w')
|
||||||
|
@ -114,6 +114,9 @@ for line in master:
|
|||||||
if 'link' in header:
|
if 'link' in header:
|
||||||
explode.write('link: ' + header['link'] + '\n')
|
explode.write('link: ' + header['link'] + '\n')
|
||||||
|
|
||||||
|
if 'uri' in header:
|
||||||
|
explode.write('uri: ' + header['uri'] + '\n')
|
||||||
|
|
||||||
if 'style' in header:
|
if 'style' in header:
|
||||||
explode.write('style: ' + header['style'] + '\n')
|
explode.write('style: ' + header['style'] + '\n')
|
||||||
|
|
||||||
|
@ -94,6 +94,9 @@ for line in master:
|
|||||||
if 'link' in header:
|
if 'link' in header:
|
||||||
implode.write('link: ' + header['link'] + '\n')
|
implode.write('link: ' + header['link'] + '\n')
|
||||||
|
|
||||||
|
if 'uri' in header:
|
||||||
|
implode.write('uri: ' + header['uri'] + '\n')
|
||||||
|
|
||||||
if 'style' in header:
|
if 'style' in header:
|
||||||
implode.write('style: ' + header['style'] + '\n')
|
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