|
|
|
@ -3,13 +3,21 @@ import os
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
# https://devdocs.io/python~3.9/library/glob#glob.glob
|
|
|
|
|
files = glob("content/**", recursive=True)
|
|
|
|
|
print(files)
|
|
|
|
|
# files = glob("content/**", recursive=True)
|
|
|
|
|
# print(files)
|
|
|
|
|
print("---------")
|
|
|
|
|
|
|
|
|
|
all_html = ""
|
|
|
|
|
|
|
|
|
|
for file in files:
|
|
|
|
|
folders = glob("content/*")
|
|
|
|
|
print(folders)
|
|
|
|
|
|
|
|
|
|
for folder in folders:
|
|
|
|
|
files = glob(folder + "/*")
|
|
|
|
|
print(files)
|
|
|
|
|
print("************")
|
|
|
|
|
|
|
|
|
|
for file in files:
|
|
|
|
|
#print(file)
|
|
|
|
|
if file.endswith(".md"):
|
|
|
|
|
print("===========")
|
|
|
|
@ -23,6 +31,12 @@ for file in files:
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
@ -31,6 +45,8 @@ for file in files:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("----------")
|
|
|
|
|
print(all_html)
|
|
|
|
|
|
|
|
|
|