Files
Gainsight/Scripts/API_Notes/conf_functionsonly.py

55 lines
1.6 KiB
Python
Raw Normal View History

2022-11-08 14:47:53 -05:00
from datetime import date
2022-10-10 17:28:58 -04:00
import markdown
import re
2022-11-08 14:47:53 -05:00
rootdir = "/Users/normrasmussen/Documents/Northpass/Scripts/API_Notes/SampleNotes/"
2022-10-10 17:28:58 -04:00
def findheadings():
headingsarray = []
2022-11-14 18:01:18 -05:00
with open(rootdir + "Flink.md", "r") as myfile:
2022-10-10 17:28:58 -04:00
file = myfile.readlines()
for headings in file:
if "##" in headings:
headingsarray.append(headings)
print(headingsarray)
2022-11-08 14:47:53 -05:00
# 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}$"
2022-11-08 14:47:53 -05:00
with open(rootdir+"Flink.md", "r") as f:
notes_flag = False
notes = ''
for line in f:
if line.startswith("## "):
2022-11-08 14:47:53 -05:00
notes_flag = True
elif notes_flag:
notes += line
if not line.strip(): break
print(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)
if m:
print("Found a section!")
found = m.group(1)
print(found)
2022-10-10 17:28:58 -04:00
2022-11-08 14:47:53 -05:00
def mdConvert(rootdir, notes):
conversion = markdown.markdown(notes)
print(conversion)
2022-11-14 18:01:18 -05:00
# Add Conversion variable to payload for hubspot. Copy functions from the other files.
2022-10-10 17:28:58 -04:00
if __name__ == "__main__":
meetingSections(rootdir)
#noteSections(rootdir)
2022-11-08 14:47:53 -05:00