-
Notifications
You must be signed in to change notification settings - Fork 2
Vertical split breaks #66
Copy link
Copy link
Open
Description
Vsplit breaks this file
After V split then moving down the file a bit

After moving the entire way down the file on the right.

Moving down the file on the left:
code:
1
2 from datetime import datetime, date, timedelta
3 from pathlib import Path
4
5 def getPath(DAY, OBSIDIAN_PATH, DAILY_NOTES_FOLDER, CUSTOM_FORMAT):
6
7 date = datetime.strptime(DAY, "%Y-%m-%d")
8
9 # Splits day up into its values
10 year = date.year
11 month = date.month
12 day = date.day
13
14 note_path = CUSTOM_FORMAT
15
16 date_dict = {
17 # Year
18 "YYYY": "%Y",
19 "YY": "%y",
20 # Month
21 "MMMM": "%B",
22 "MMM": "%b",
23 "MM": "%m",
24 # Day
25 "dddd": "%A",
26 "ddd": "%a",
27 # Day of Month
28 "DD": "%d",
29 }
30
31 for key, value in date_dict.items():
32 note_path = note_path.replace(
33 key,
34 date.strftime(value)
35 )
36
37 path = OBSIDIAN_PATH + "/" + DAILY_NOTES_FOLDER + "/" + note_path + ".md"
38
39 return path
40
41 def dateRange(start_date: date, end_date: date):
42 days = int((end_date - start_date).days)
43 for n in range(days):
44 yield start_date + timedelta(n)
45
46 def checkForSource(SOURCE, PATH):
47 with open(PATH, "r", encoding="utf-8") as file:
48 for line in file:
49 print(line)
50
51 return False
52
53 def makeTemplatedFile(new_path, OBSIDIAN_PATH, DAILY_NOTE_TEMPLATE):
54 template_path = f"{OBSIDIAN_PATH}/{DAILY_NOTE_TEMPLATE}.md"
55 new_path = Path(new_path)
56 parent = new_path.parent
57
58 DEBUG = False
59 if DEBUG:
60 print(new_path)
61
62 parent.mkdir(parents=True, exist_ok=True)
63 with new_path.open("a", encoding="utf-8") as file:
64 with open(template_path, "r", encoding="utf-8") as template:
65 file.write(template.read())
66
67 def hasHeader(path, header):
68 with open(path, "r", encoding="utf=8") as file:
69 if header in file.read():
70 return True
71
72 return False
73
74 def insertData(path, header, data):
75 with path.open("a", encoding="utf=8") as file:
76 file.write(header)
77 file.write(data)
78Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
