Skip to content
Permalink
Browse files
Parser updated to pre-render
  • Loading branch information
aa9863 committed Sep 4, 2020
1 parent 9b77735 commit acde0e1538bb16ed41ecb938348341e7cf9c6308
Showing 1 changed file with 20 additions and 1 deletion.
@@ -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:

0 comments on commit acde0e1

Please sign in to comment.