From 0184842ee811ecbb20b601c1e2438690dbf87c96 Mon Sep 17 00:00:00 2001 From: Dave Machado Date: Fri, 22 Dec 2017 20:10:19 -0500 Subject: [PATCH] Update Category split logic --- build/md2json.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/md2json.py b/build/md2json.py index bcf0616c..86414e3f 100755 --- a/build/md2json.py +++ b/build/md2json.py @@ -14,7 +14,7 @@ def markdown_to_json(filename, anchor): and line.startswith(anchor) or line.startswith('| ')) for line in lines: if line.startswith(anchor): - category = line.split()[1] + category = line.split(anchor)[1].strip() continue chunks = [x.strip() for x in line.split('|')[1:-1]] entry = { @@ -26,7 +26,11 @@ def markdown_to_json(filename, anchor): 'Category': category, } entries.append(entry) - return json.dumps(entries) + final = { + 'count': len(entries), + 'entries': entries, + } + return json.dumps(final) def main():