removed unnecessary title in description
This commit is contained in:
@ -8,6 +8,7 @@ https://github.com/tlgkccampbell/ultraviolet
|
||||
https://github.com/amerkoleci/Vortice.Windows
|
||||
https://github.com/horde3d/Horde3D
|
||||
https://github.com/cxong/cdogs-sdl
|
||||
https://moaiwebsite.github.io/
|
||||
http://cyxdown.free.fr/bs/
|
||||
http://cyxdown.free.fr/f2b/
|
||||
https://github.com/nfprojects/nfengine
|
||||
|
@ -39,7 +39,7 @@ if __name__ == "__main__":
|
||||
print('took {}s'.format(time.process_time()-t0))
|
||||
t0 = time.process_time()
|
||||
# entries = osg.assemble_infos()
|
||||
osg.write_entries(entries)
|
||||
# osg.write_entries(entries)
|
||||
print('took {}s'.format(time.process_time()-t0))
|
||||
|
||||
|
||||
|
@ -582,22 +582,46 @@ def read_entries():
|
||||
# parse and transform entry content
|
||||
try:
|
||||
tree = parser.parse(content)
|
||||
|
||||
entry = transformer.transform(tree)
|
||||
# add file information
|
||||
entry['file'] = file
|
||||
|
||||
check_entry(entry)
|
||||
except Exception as e:
|
||||
print(file)
|
||||
print(e)
|
||||
print('{} - {}'.format(file, e))
|
||||
continue
|
||||
|
||||
# TODO check entry
|
||||
|
||||
# add file information
|
||||
entry['file'] = file
|
||||
|
||||
# add to list
|
||||
entries.append(entry)
|
||||
|
||||
return entries
|
||||
|
||||
|
||||
def check_entry(entry):
|
||||
"""
|
||||
|
||||
:param entry:
|
||||
:return:
|
||||
"""
|
||||
message = ''
|
||||
|
||||
file = entry['file']
|
||||
|
||||
# check canonical file name
|
||||
canonical_file_name = canonical_entry_name(entry['title']) + '.md'
|
||||
# we also allow -X with X =2..9 as possible extension (because of duplicate canonical file names)
|
||||
if canonical_file_name != file and canonical_file_name != file[:-5] + '.md':
|
||||
message += 'file name should be {}\n'.format(canonical_file_name)
|
||||
|
||||
# title should not be also in description
|
||||
if entry['title'] in entry['description']:
|
||||
message += 'title included in description, should be removed'
|
||||
|
||||
if message:
|
||||
raise RuntimeError(message)
|
||||
|
||||
|
||||
def write_entries(entries):
|
||||
"""
|
||||
|
||||
|
Reference in New Issue
Block a user