diff --git a/docs/docs.framework.client.md b/docs/docs.dev.framework.client.md similarity index 100% rename from docs/docs.framework.client.md rename to docs/docs.dev.framework.client.md diff --git a/docs/docs.framework.md b/docs/docs.dev.framework.md similarity index 92% rename from docs/docs.framework.md rename to docs/docs.dev.framework.md index 3a9c413d3a..97a03c591c 100644 --- a/docs/docs.framework.md +++ b/docs/docs.dev.framework.md @@ -2,8 +2,8 @@ { "_label": "Framework API", "_toc": [ - "docs.framework.server", - "docs.framework.client" + "docs.dev.framework.server", + "docs.dev.framework.client" ] } --- diff --git a/docs/docs.framework.server.md b/docs/docs.dev.framework.server.md similarity index 100% rename from docs/docs.framework.server.md rename to docs/docs.dev.framework.server.md diff --git a/docs/docs.quickstart.md b/docs/docs.dev.quickstart.md similarity index 100% rename from docs/docs.quickstart.md rename to docs/docs.dev.quickstart.md diff --git a/public/js/wn/views/docs.js b/public/js/wn/views/docs.js index 4be6f7084d..207a2bc66b 100644 --- a/public/js/wn/views/docs.js +++ b/public/js/wn/views/docs.js @@ -58,8 +58,8 @@ wn.docs.generate_all = function(logarea) { parent: body, }); page.write(function() { - //logarea.append("Writing " + name + "...
"); - logarea.append("."); + logarea.append("Writing " + name + "...
"); + //logarea.append("."); // recurse if(page.obj._toc) { $.each(page.obj._toc, function(i, name) { @@ -76,8 +76,8 @@ wn.docs.generate_all = function(logarea) { // append docs.modules = r.message.modules; - wn.provide("docs.framework.server").webnotes = r.message.webnotes; - wn.provide("docs.framework.client").wn = wn; + wn.provide("docs.dev.framework.server").webnotes = r.message.webnotes; + wn.provide("docs.dev.framework.client").wn = wn; // append static pages to the "docs" object $.each(r.message.pages, function(n, content) { @@ -104,17 +104,17 @@ wn.docs.get_full_name = function(name) { */ var link_name = name; if(name.substr(0,2)==="wn") { - link_name = "docs.framework.client." + name; + link_name = "docs.dev.framework.client." + name; } if(name.substr(0,8)==="webnotes") { - link_name = "docs.framework.server." + name; + link_name = "docs.dev.framework.server." + name; } return link_name; } wn.docs.get_short_name = function(namespace) { - namespace = namespace.replace("docs.framework.server.", "") - namespace = namespace.replace("docs.framework.client.", "") + namespace = namespace.replace("docs.dev.framework.server.", "") + namespace = namespace.replace("docs.dev.framework.client.", "") return namespace; } @@ -132,8 +132,10 @@ wn.docs.DocsPage = Class.extend({ this.make(obj); }, make: function(obj) { - $("

").html(obj._label || wn.docs.get_short_name(this.namespace)) - .appendTo(this.parent); + if(!obj._no_title) { + $("

").html(obj._label || wn.docs.get_short_name(this.namespace)) + .appendTo(this.parent); + } this.make_breadcrumbs(obj); this.make_intro(obj); this.make_toc(obj); @@ -165,7 +167,7 @@ wn.docs.DocsPage = Class.extend({ }); $(repl('
  • %(label)s
  • ', { - label: obj._label || this.namespace + label: obj._label || wn.docs.get_short_name(this.namespace) })).appendTo(ul) }, make_intro: function(obj) { diff --git a/webnotes/utils/docs.py b/webnotes/utils/docs.py index e3ebd9fa0f..7d1bc81651 100644 --- a/webnotes/utils/docs.py +++ b/webnotes/utils/docs.py @@ -16,11 +16,14 @@ def get_docs(): def get_pages(): mydocs = {} for repo in ("lib", "app"): - for fname in os.listdir(os.path.join("..", repo, "docs")): - if fname.endswith(".md"): - fpath = os.path.join("..", repo, "docs", fname) - with open(fpath, "r") as docfile: - mydocs[fname[:-3]] = docfile.read() + for path, folders, files in os.walk(os.path.join("..", repo)): + if os.path.basename(path)=="docs": + # docs folder + for fname in files: + if fname.endswith(".md"): + fpath = os.path.join("..", repo, "docs", fname) + with open(fpath, "r") as docfile: + mydocs[fname[:-3]] = docfile.read() return mydocs @@ -43,7 +46,6 @@ def get_docs_for(docs, name): mydocs["_intro"] = getattr(obj, "__doc__", "") mydocs["_toc"] = getattr(obj, "_toc", "") mydocs["_type"] = inspect.isclass(obj) and "class" or "module" - mydocs["_is_server_api"] = 1 for name in dir(obj): value = getattr(obj, name) @@ -155,10 +157,25 @@ docs_template = """ --> + -
    - {{ content }} +
    + + + {{ content }}