Skip to content
Permalink
Browse files
Merge pull request aa9863#27 from aa9863/redered-vars
Redered vars
  • Loading branch information
aa9863 committed Sep 4, 2020
2 parents 9b77735 + f7a0ce6 commit 2f13e31cf34adeb1a250aef7f88cc3b52d995544
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
@@ -41,3 +41,6 @@ passwords of any length, with (almost) all ASCII characters as valid
symbols, making use of a flaw in the binaries that allows a "timing
attack".

## Due date

The couresework is due by {{page.meta.due}}
@@ -19,6 +19,7 @@
import logging
import re

import jinja2
import yaml

import remarkable.section as section
@@ -43,6 +44,7 @@ class MarkdownParser():
#And things we are storing
self.sections = None
self.header = None
self.page = None
#Add this for the generic template
self.sectionOrder = []

@@ -163,10 +165,27 @@ class MarkdownParser():
sections based on the line headings.
"""





#TODO: ---------- Fix this Kludge ------------
tempHeader = {"page":{"meta":self.header}}

#First pass of the text with jinja
preRender = jinja2.Template("\n".join(theText))
postRender = preRender.render(tempHeader)
print(postRender)
postRender = postRender.split("\n")

currentSection = None
out = []
sections = {}
for line in theText:
#for line in theText:
for line in postRender:
print("------")
print(line)
print("-------")
#self.log.debug(" {0}".format(line))
if line.startswith("# "): #Kludgy Space for matching
if currentSection:
@@ -138,5 +138,6 @@ class HTMLRenderer(Renderer):
out = self.template.render({"content":sections,
"header": header,
"order": theParser.sectionOrder,
"calcs": calcs})
"calcs": calcs,
"page":{"meta": header}})
return out

0 comments on commit 2f13e31

Please sign in to comment.