External css on timeline

main
Bob Mottram 2020-11-10 15:12:07 +00:00
parent 7760816ec1
commit 6939c82302
2 changed files with 615 additions and 595 deletions

File diff suppressed because it is too large Load Diff

View File

@ -437,6 +437,26 @@ def htmlHeader(cssFilename: str, css: str, lang='en') -> str:
return htmlStr
def htmlHeaderWithExternalStyle(cssFilename: str, css: str, lang='en') -> str:
htmlStr = '<!DOCTYPE html>\n'
htmlStr += '<html lang="' + lang + '">\n'
htmlStr += ' <head>\n'
htmlStr += ' <meta charset="utf-8">\n'
fontName, fontFormat = getFontFromCss(css)
if fontName:
htmlStr += ' <link rel="preload" as="font" type="' + \
fontFormat + '" href="' + fontName + '" crossorigin>\n'
htmlStr += ' <style>\n' + css + '</style>\n'
cssFile = cssFilename.split('/')[-1]
htmlStr += ' <link rel="stylesheet" href="' + cssFile + '">'
htmlStr += ' <link rel="manifest" href="/manifest.json">\n'
htmlStr += ' <meta name="theme-color" content="grey">\n'
htmlStr += ' <title>Epicyon</title>\n'
htmlStr += ' </head>\n'
htmlStr += ' <body>\n'
return htmlStr
def htmlFooter() -> str:
htmlStr = ' </body>\n'
htmlStr += '</html>\n'