small changes to notes

This commit is contained in:
Norm Rasmussen
2023-02-10 15:15:33 -05:00
parent ad47dfbf9f
commit 747bb47464
22 changed files with 633 additions and 437 deletions

View File

@ -1,9 +1,8 @@
from datetime import date
import markdown
import re
import markdown
rootdir = "/Users/normrasmussen/Documents/Northpass/Scripts/API_Notes/SampleNotes/"
def findheadings():
headingsarray = []
with open(rootdir + "Flink.md", "r") as myfile:
@ -12,43 +11,49 @@ def findheadings():
if "##" in headings:
headingsarray.append(headings)
print(headingsarray)
# From StackOverflow:
def noteSections(rootdir):
#today = date.today()
#today = today.strftime("%m/%d/%Y")
#dateregex = "^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$"
with open(rootdir+"Flink.md", "r") as f:
def noteSections(rootdir):
# today = date.today()
# today = today.strftime("%m/%d/%Y")
# dateregex = "^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$"
with open(rootdir + "Flink.md", "r") as f:
notes_flag = False
notes = ''
notes = ""
for line in f:
if line.startswith("## "):
notes_flag = True
elif notes_flag:
notes += line
if not line.strip(): break
if not line.strip():
break
print(notes)
# mdConvert(rootdir, notes)
# mdConvert(rootdir, notes)
def meetingSections(rootdir):
dateregex = "^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$"
currentnote = rootdir + "Flink.md"
with open(currentnote, "r") as f:
text = f.read()
#print(text)
#m = re.search(f"##(.^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$)\n(.*)\n\n")
#m = re.search("##"+dateregex+"(.*)"+"##"+dateregex, text)
# print(text)
# m = re.search(f"##(.^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$)\n(.*)\n\n")
# m = re.search("##"+dateregex+"(.*)"+"##"+dateregex, text)
if m:
print("Found a section!")
found = m.group(1)
print(found)
def mdConvert(rootdir, notes):
conversion = markdown.markdown(notes)
print(conversion)
# Add Conversion variable to payload for hubspot. Copy functions from the other files.
# FEAT: Add Conversion variable to payload for hubspot. Copy functions from the other files.
if __name__ == "__main__":
meetingSections(rootdir)
#noteSections(rootdir)
# noteSections(rootdir)