mirror of
https://github.com/flancian/garden.git
synced 2026-08-07 15:06:19 +00:00
Add Markdown headers where missing.
This commit is contained in:
+2
-3
@@ -5,7 +5,6 @@ import titlecase
|
||||
|
||||
for filename in pathlib.Path('.').glob('**/*.md'):
|
||||
f = open(filename, 'r')
|
||||
f_rw = open(filename, 'w')
|
||||
print('file: %s' % filename)
|
||||
lines = f.readlines()
|
||||
if lines:
|
||||
@@ -19,6 +18,6 @@ for filename in pathlib.Path('.').glob('**/*.md'):
|
||||
header = '# ' + titlecase.titlecase(sanitized_filename) + '\n'
|
||||
print('adding header:', header)
|
||||
lines.insert(0, header)
|
||||
# uncomment when this actually works.
|
||||
# f_rw.writelines(lines)
|
||||
with open(filename, 'w') as f_rw:
|
||||
f_rw.writelines(lines)
|
||||
print('---')
|
||||
|
||||
Reference in New Issue
Block a user