Alexandre B A Villares 🐍 on Nostr: I made this so I could create a bunch of HackMD.io pages for my classes in bulk... ...
I made this so I could create a bunch of HackMD.io pages for my classes in bulk...
api = API(access_token)
title = "My Nice Course - 2024 - day {0}".format
body = """
## Course X - 2024
# My nice course - day {0}
## This page is at: `hackmd.io/@myuser/nice-course-2024-day{0}`
""".format
link = 'nice-course-2024-day-day{0}'.format
for a in range(1, 9): # 8-day class
data = api.create_note(title=title(a),
content=body(a),
permalink=link(a))
print(f"- [Day {a}](https:///hackmd.io/@myuser/{link(a)}")
api = API(access_token)
title = "My Nice Course - 2024 - day {0}".format
body = """
## Course X - 2024
# My nice course - day {0}
## This page is at: `hackmd.io/@myuser/nice-course-2024-day{0}`
""".format
link = 'nice-course-2024-day-day{0}'.format
for a in range(1, 9): # 8-day class
data = api.create_note(title=title(a),
content=body(a),
permalink=link(a))
print(f"- [Day {a}](https:///hackmd.io/@myuser/{link(a)}")