From ffbb098e4daf75973145b4b519abd9a5fe0b459c Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Sat, 29 Sep 2018 18:41:09 +0200 Subject: [PATCH] deactivated yphenation and added more comments --- libriis/classes/md2html.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libriis/classes/md2html.py b/libriis/classes/md2html.py index 8a15d77..01c32ae 100644 --- a/libriis/classes/md2html.py +++ b/libriis/classes/md2html.py @@ -90,27 +90,33 @@ class Compiler(): pdoc_filters = [] + # convert markdown from file to html output = pypandoc.convert_file(in_f, to='html5', format='markdown+smart+header_attributes+link_attributes+bracketed_spans', extra_args=pdoc_args, filters=pdoc_filters) + # print(output) + # convert html string to parseable html dom output_dom = BeautifulSoup(output, 'html.parser') # hyphenate paragraphes - for node in output_dom.find_all('p'): - self.hyphenate(node) + # for node in output_dom.find_all('p'): + # self.hyphenate(node) # append html story page to template_dom + # create a page dom story_page = BeautifulSoup( '
', 'html.parser' ) + # append to page dom the converted content story_page.div.append(output_dom) + # append to global dom content the page with contents story_dom.append(story_page) - + # increment pahe index pi = pi+1 # create main html file from filled template html dom @@ -129,6 +135,7 @@ class Compiler(): # print("hyphenate") nodetext = node.get_text() # print(nodetext) + nodestr = str(node) # print(nodestr) for word in nodetext.split(' '):