booklet edits

main
Stephen Kerr 1 year ago
parent 3fc27acc3e
commit e4959e0151

@ -8,7 +8,6 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
</head> </head>
<body> <body>
<p>SI20</p>
<p>The history of Tarot Cards According to History</p> <p>The history of Tarot Cards According to History</p>
<p>Some Gossip on gossip</p> <p>Some Gossip on gossip</p>
<p>yay</p> <p>yay</p>

@ -3,33 +3,49 @@ import os
import subprocess import subprocess
# https://devdocs.io/python~3.9/library/glob#glob.glob # https://devdocs.io/python~3.9/library/glob#glob.glob
files = glob("content/**", recursive=True) # files = glob("content/**", recursive=True)
print(files) # print(files)
print("---------") print("---------")
all_html = "" all_html = ""
for file in files: folders = glob("content/*")
#print(file) print(folders)
if file.endswith(".md"):
print("===========")
file = file.replace(" ", "\ ")
print(file)
html_file = file.replace(".md", ".html") for folder in folders:
pandoc_cmd = "pandoc -s -c style.css -f markdown -t html " + file + " -o " + html_file files = glob(folder + "/*")
os.system(pandoc_cmd) print(files)
print("standalone html files saved!") print("************")
pandoc2 = "pandoc -f markdown -t html " + file for file in files:
html_data = subprocess.run(pandoc2, capture_output=True, text=True).stdout #print(file)
print("This is the html data: ", html_data) if file.endswith(".md"):
print("===========")
file = file.replace(" ", "\ ")
print(file)
# and then collect all that content into a variable called "all_html" html_file = file.replace(".md", ".html")
# add this content to all_html pandoc_cmd = "pandoc -s -c style.css -f markdown -t html " + file + " -o " + html_file
all_html = all_html + html_data os.system(pandoc_cmd)
print("standalone html files saved!")
pandoc2 = "pandoc -f markdown -t html " + file
html_data = subprocess.run(pandoc2, capture_output=True, text=True).stdout
#editing the html before creatings the main file
# filename = os.path.basename(file)
# print("filename", filename)
html_data = html_data.replace('<img src="','<img src="' + folder + '/')
print("This is the html data: ", html_data)
# and then collect all that content into a variable called "all_html"
# add this content to all_html
all_html = all_html + html_data
print("----------") print("----------")
print(all_html) print(all_html)

Loading…
Cancel
Save