From d8c97bdedf84426a1bbefd236b1cfcdc6b033f28 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 3 Sep 2013 10:19:09 +0530 Subject: [PATCH] [docs] moved into folders --- .../documentation_tool/documentation_tool.py | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/core/doctype/documentation_tool/documentation_tool.py b/core/doctype/documentation_tool/documentation_tool.py index 9a43182fe7..8a932a4789 100644 --- a/core/doctype/documentation_tool/documentation_tool.py +++ b/core/doctype/documentation_tool/documentation_tool.py @@ -35,21 +35,22 @@ def get_docs(options): def get_static_pages(): mydocs = {} for repo in ("lib", "app"): - for fname in os.listdir(get_path(repo, "docs")): - if fname.endswith(".md"): - fpath = get_path(repo, "docs", fname) - with open(fpath, "r") as docfile: - src = unicode(docfile.read(), "utf-8") - try: - temp, headers, body = src.split("---", 2) - d = json.loads(headers) - except Exception, e: - webnotes.msgprint("Bad Headers in: " + fname) - continue - d["_intro"] = body - d["_gh_source"] = get_gh_url(fpath) - d["_modified"] = get_timestamp(fpath) - mydocs[fname[:-3]] = d + for basepath, folders, files in os.walk(get_path(repo, "docs")): + for fname in files: + if fname.endswith(".md"): + fpath = get_path(basepath, fname) + with open(fpath, "r") as docfile: + src = unicode(docfile.read(), "utf-8") + try: + temp, headers, body = src.split("---", 2) + d = json.loads(headers) + except Exception, e: + webnotes.msgprint("Bad Headers in: " + fname) + continue + d["_intro"] = body + d["_gh_source"] = get_gh_url(fpath) + d["_modified"] = get_timestamp(fpath) + mydocs[fname[:-3]] = d return mydocs