diff --git a/frappe/build.py b/frappe/build.py
index a1d753eb44..c843a3b1aa 100644
--- a/frappe/build.py
+++ b/frappe/build.py
@@ -84,7 +84,16 @@ def make_asset_dirs(make_copy=False, restore=False):
symlinks = []
symlinks.append([os.path.join(app_base_path, 'public'), os.path.join(assets_path, app_name)])
- symlinks.append([os.path.join(app_base_path, 'docs'), os.path.join(assets_path, app_name + '_docs')])
+
+ app_doc_path = None
+ if os.path.isdir(os.path.join(app_base_path, 'docs')):
+ app_doc_path = os.path.join(app_base_path, 'docs')
+
+ elif os.path.isdir(os.path.join(app_base_path, 'www', 'docs')):
+ app_doc_path = os.path.join(app_base_path, 'www', 'docs')
+
+ if app_doc_path:
+ symlinks.append([app_doc_path, os.path.join(assets_path, app_name + '_docs')])
for source, target in symlinks:
source = os.path.abspath(source)
diff --git a/frappe/utils/help.py b/frappe/utils/help.py
index cd3972e483..3a5bc5b308 100644
--- a/frappe/utils/help.py
+++ b/frappe/utils/help.py
@@ -166,8 +166,8 @@ class HelpDatabase(object):
docs_app=docs_app, web_folder=web_folder)
if os.path.exists(docs_folder):
app_name = getattr(frappe.get_module(app), '__title__', None) or app.title()
- doc_contents += '
{app_name}'.format(
- docs_app=docs_app, app_name=app_name)
+ doc_contents += '{app_name}'.format(
+ app=app, app_name=app_name)
for basepath, folders, files in os.walk(docs_folder):
files = self.reorder_files(files)
@@ -177,14 +177,14 @@ class HelpDatabase(object):
with io.open(fpath, 'r', encoding = 'utf-8') as f:
try:
content = frappe.render_template(f.read(),
- {'docs_base_url': '/assets/{app}_docs'.format(app=app)})
+ {'docs_base_url': '/assets/{docs_app}_docs'.format(docs_app=docs_app)})
relpath = self.get_out_path(fpath)
relpath = relpath.replace("user", app)
content = frappe.utils.md_to_html(content)
title = self.make_title(basepath, fname, content)
intro = self.make_intro(content)
- content = self.make_content(content, fpath, relpath, app)
+ content = self.make_content(content, fpath, relpath, app, docs_app)
self.db.sql('''insert into help(path, content, title, intro, full_path)
values (%s, %s, %s, %s, %s)''', (relpath, content, title, intro, fpath))
except jinja2.exceptions.TemplateSyntaxError:
@@ -212,7 +212,7 @@ class HelpDatabase(object):
intro = "Help Video: " + intro
return intro
- def make_content(self, html, path, relpath, app_name):
+ def make_content(self, html, path, relpath, app_name, doc_app):
if '' in html:
html = html.split('
', 1)[1]
@@ -222,7 +222,7 @@ class HelpDatabase(object):
soup = BeautifulSoup(html, 'html.parser')
self.fix_links(soup, app_name)
- self.fix_images(soup, app_name)
+ self.fix_images(soup, doc_app)
parent = self.get_parent(relpath)
if parent: