Compare commits
2 commits
c05161eb4a
...
908112fe9c
Author | SHA1 | Date | |
---|---|---|---|
908112fe9c | |||
37ea872f5c |
2 changed files with 20 additions and 0 deletions
12
Example_note.txt
Executable file
12
Example_note.txt
Executable file
|
@ -0,0 +1,12 @@
|
|||
Content-Type: text/x-zim-wiki
|
||||
Wiki-Format: zim 0.26
|
||||
Creation-Date: Not found
|
||||
Modification-Date: Not found
|
||||
|
||||
====== Example note ======
|
||||
|
||||
This is a line.
|
||||
|
||||
This is another line.
|
||||
|
||||
http://example.com
|
|
@ -13,6 +13,14 @@ def rewrite_file(filepath):
|
|||
or (i == 4 and line == "\n")
|
||||
):
|
||||
continue
|
||||
if (i == 5):
|
||||
title_pieces = line.split("======")
|
||||
if len(title_pieces) == 3:
|
||||
title = title_pieces[1].strip()
|
||||
w.write("---\n")
|
||||
w.write("title: " + title + "\n")
|
||||
w.write("---\n")
|
||||
continue
|
||||
|
||||
w.write(line)
|
||||
|
||||
|
|
Loading…
Reference in a new issue