removed temporary html
This commit is contained in:
parent
d71af2078a
commit
57ccecf3fa
64
main.py
64
main.py
|
@ -5,8 +5,8 @@ from mdutils import MdUtils
|
|||
|
||||
|
||||
markdown = True
|
||||
pdf = True
|
||||
html = False
|
||||
pdf = False
|
||||
html = True
|
||||
html_stylesheet = "styles/simple.css"
|
||||
title_animation = "fade-down"
|
||||
heading_animation = "fade-right"
|
||||
|
@ -136,52 +136,50 @@ if html:
|
|||
|
||||
|
||||
ifname = str(title.strip()) + ".md"
|
||||
ofname = "temp.html"
|
||||
fname = str(title.strip()) + ".html"
|
||||
ofname = str(title.strip()) + ".html"
|
||||
|
||||
convert = pypandoc.convert_file(ifname,'html5',outputfile=ofname,extra_args=['-s'])
|
||||
assert(convert) == ''
|
||||
|
||||
fp = open(ofname)
|
||||
with open(ofname) as fp:
|
||||
soup = BeautifulSoup(fp,'html5lib')
|
||||
|
||||
soup = BeautifulSoup(fp,'html5lib')
|
||||
aos_css = soup.new_tag('link',href='https://unpkg.com/aos@2.3.1/dist/aos.css',rel='stylesheet')
|
||||
soup.head.append(aos_css)
|
||||
|
||||
aos_css = soup.new_tag('link',href='https://unpkg.com/aos@2.3.1/dist/aos.css',rel='stylesheet')
|
||||
soup.head.append(aos_css)
|
||||
font = soup.new_tag('link',href=html_stylesheet,rel='stylesheet')
|
||||
soup.head.append(font)
|
||||
|
||||
font = soup.new_tag('link',href=html_stylesheet,rel='stylesheet')
|
||||
soup.head.append(font)
|
||||
title = soup.new_tag('title')
|
||||
title.string = "DailyDose"
|
||||
soup.head.append(title)
|
||||
|
||||
title = soup.new_tag('title')
|
||||
title.string = "DailyDose"
|
||||
soup.head.append(title)
|
||||
aos_js = soup.new_tag('script',src="https://unpkg.com/aos@2.3.1/dist/aos.js")
|
||||
soup.head.append(aos_js)
|
||||
|
||||
aos_js = soup.new_tag('script',src="https://unpkg.com/aos@2.3.1/dist/aos.js")
|
||||
soup.head.append(aos_js)
|
||||
aos_script = soup.new_tag('script')
|
||||
aos_script.string = "AOS.init();"
|
||||
|
||||
aos_script = soup.new_tag('script')
|
||||
aos_script.string = "AOS.init();"
|
||||
soup.body.append(aos_script)
|
||||
|
||||
soup.body.append(aos_script)
|
||||
for feed in rss_feeds:
|
||||
ToFindID = str("from-"+str(feed.strip().replace(":","").replace(" ","-").lower()))
|
||||
ToEdit = soup.find("h1", {"id": ToFindID})
|
||||
ToEdit['data-aos'] = 'fade-right'
|
||||
|
||||
for feed in rss_feeds:
|
||||
ToFindID = str("from-"+str(feed.strip().replace(":","").replace(" ","-").lower()))
|
||||
ToEdit = soup.find("h1", {"id": ToFindID})
|
||||
ToEdit['data-aos'] = 'fade-right'
|
||||
soup.find("h1",{"id":"daily-dose"})['data-aos'] = title_animation
|
||||
soup.find("h1",{"id":"contents"})['data-aos'] = heading_animation
|
||||
|
||||
soup.find("h1",{"id":"daily-dose"})['data-aos'] = title_animation
|
||||
soup.find("h1",{"id":"contents"})['data-aos'] = heading_animation
|
||||
paragraphs = soup.find_all("p")
|
||||
for paras in paragraphs:
|
||||
paras['data-aos'] = list_animation
|
||||
|
||||
paragraphs = soup.find_all("p")
|
||||
for paras in paragraphs:
|
||||
paras['data-aos'] = list_animation
|
||||
lis = soup.find_all("li")
|
||||
for li in lis:
|
||||
if li.a == None:
|
||||
li['data-aos'] = list_animation
|
||||
|
||||
lis = soup.find_all("li")
|
||||
for li in lis:
|
||||
if li.a == None:
|
||||
li['data-aos'] = list_animation
|
||||
|
||||
with open(fname, "w") as outf:
|
||||
with open(ofname, "w") as outf:
|
||||
outf.write(str(soup))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue