From 812b50f0bef7809b61a2acc018991521a4e30596 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Sat, 20 May 2017 11:22:37 +0200 Subject: [PATCH] replace story page id number by summary title sanitazed --- bin/build.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/build.py b/bin/build.py index 166ead2..ec38549 100755 --- a/bin/build.py +++ b/bin/build.py @@ -98,8 +98,10 @@ def generate_html(book, toc): pi = 0 for p in toc: - print(toc[p]['file']) - pagename = toc[p]['file'].replace('.md', '') + # print(toc[p]) + pagename = toc[p]['label'] + pageid = re.sub('[^a-z0-9]+', '-', pagename.lower()) + print(pageid) # files in_f = os.path.join(_BOOK_SRC, toc[p]['file']) @@ -152,7 +154,7 @@ def generate_html(book, toc): # append html story page to template_dom - story_page = BeautifulSoup('
', 'html.parser') + story_page = BeautifulSoup('
', 'html.parser') story_page.div.append(output_dom) story_dom.append(story_page)