|
|
@@ -8,7 +8,7 @@ from __future__ import unicode_literals |
|
|
|
import webnotes |
|
|
|
import inspect, os, json, datetime, shutil |
|
|
|
from webnotes.modules import get_doc_path, get_module_path, scrub |
|
|
|
from webnotes.utils import get_path, get_base_path |
|
|
|
from webnotes.utils import get_path, get_base_path, cstr |
|
|
|
|
|
|
|
class DocType: |
|
|
|
def __init__(self, d, dl): |
|
|
@@ -36,6 +36,7 @@ def get_static_pages(): |
|
|
|
for repo in ("lib", "app"): |
|
|
|
for basepath, folders, files in os.walk(get_path(repo, "docs")): |
|
|
|
for fname in files: |
|
|
|
fname = cstr(fname) |
|
|
|
if fname.endswith(".md"): |
|
|
|
fpath = get_path(basepath, fname) |
|
|
|
with open(fpath, "r") as docfile: |
|
|
@@ -78,6 +79,7 @@ def get_docs_for(docs, name): |
|
|
|
mydocs["_toc"] = [] |
|
|
|
dirname = os.path.dirname(obj.__file__) |
|
|
|
for fname in os.listdir(dirname): |
|
|
|
fname = cstr(fname) |
|
|
|
fpath = os.path.join(dirname, fname) |
|
|
|
if os.path.isdir(fpath): |
|
|
|
# append if package |
|
|
@@ -176,6 +178,7 @@ def get_modules(for_module=None): |
|
|
|
prefix = prefix + ".py_modules." |
|
|
|
for basepath, folders, files in os.walk(module_path): |
|
|
|
for f in files: |
|
|
|
f = cstr(f) |
|
|
|
if f.endswith(".py") and \ |
|
|
|
(not f.split(".")[0] in os.path.split(basepath)) and \ |
|
|
|
(not f.startswith("__")): |
|
|
@@ -436,6 +439,7 @@ def write_docs(data, build_sitemap=None, domain=None): |
|
|
|
domain = domain + "/" |
|
|
|
content = "" |
|
|
|
for fname in os.listdir(get_path("public", "docs")): |
|
|
|
fname = cstr(fname) |
|
|
|
if fname.endswith(".html"): |
|
|
|
content += sitemap_link_xml % (domain + fname, |
|
|
|
get_timestamp(get_path("public", "docs", fname))) |
|
|
|