Experimental styling support for navigation bar
This commit is contained in:
parent
5362f65c21
commit
b46b283bf2
1
example/footer
Normal file
1
example/footer
Normal file
@ -0,0 +1 @@
|
||||
[Privacy Policy](/privacy-policy)
|
@ -1 +1,5 @@
|
||||
>
|
||||
<link href="/style.css" rel="stylesheet">
|
||||
<style>.about > li > a { color: lightgreen; } </style>
|
||||
About page
|
||||
ee
|
||||
|
@ -1,3 +1,6 @@
|
||||
>
|
||||
<link href="/style.css" rel="stylesheet">
|
||||
<style>.home > li > a { color: lightgreen; } </style>
|
||||
# Welcome!
|
||||
This is the homepage of our website.....
|
||||
>
|
||||
|
@ -17,7 +17,14 @@ def generateNavigationBar(lines):
|
||||
|
||||
#parse markdown
|
||||
if not rawhtml:
|
||||
navbar = navbar.li(HTML(parseMarkdown(navbar, line)))
|
||||
if ";" in line:
|
||||
title, link = line.split(";", 1)
|
||||
|
||||
#div class for styling
|
||||
navbar = navbar(HTML("<div class='" + title.replace(" ", "-").lower() + "'>"))
|
||||
|
||||
#link and end of div
|
||||
navbar = navbar.li(HTML("<a href='" + link.strip() + "'>" + title + "</a></div>"))
|
||||
|
||||
def generateFooter(lines):
|
||||
global footer
|
||||
@ -55,6 +62,7 @@ def parseRawHTML(doc, line, htmlstring, rawhtml, id, maxlines):
|
||||
rawhtml = False
|
||||
doc.div(HTML(htmlstring))
|
||||
htmlstring = ""
|
||||
|
||||
return rawhtml, doc, htmlstring
|
||||
|
||||
def parseMarkdown(doc, line):
|
||||
|
@ -1,2 +1,2 @@
|
||||
[Home](/)
|
||||
[About](/about)
|
||||
About;/about
|
||||
Home;/
|
||||
|
Loading…
Reference in New Issue
Block a user