diff --git a/frappe/config/docs.py b/frappe/config/docs.py index 4d3178e3fd..eafaeeb19e 100644 --- a/frappe/config/docs.py +++ b/frappe/config/docs.py @@ -2,5 +2,5 @@ from __future__ import unicode_literals -source_link = "https://github.com/frappe/frappe" +source_link = "https://github.com/frappe/frappe_io" docs_base_url = "/docs" diff --git a/frappe/hooks.py b/frappe/hooks.py index 2c984992d0..cfb72027a3 100755 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -15,6 +15,8 @@ develop_version = '10.x.x-develop' app_email = "info@frappe.io" +docs_app = "frappe_io" + before_install = "frappe.utils.install.before_install" after_install = "frappe.utils.install.after_install" diff --git a/frappe/utils/help.py b/frappe/utils/help.py index c76e977dd8..352923bbf3 100644 --- a/frappe/utils/help.py +++ b/frappe/utils/help.py @@ -38,7 +38,7 @@ def get_help_content(path): def get_improve_page_html(app_name, target): docs_config = frappe.get_module(app_name + ".config.docs") source_link = docs_config.source_link - branch = getattr(docs_config, "branch", "develop") + branch = getattr(docs_config, "branch", "master") html = '''
@@ -125,6 +125,9 @@ class HelpDatabase(object): apps = os.listdir('../apps') if self.global_help_setup else frappe.get_installed_apps() for app in apps: + # Expect handling of cloning docs apps in bench + docs_app = frappe.get_hooks('docs_app', app, app)[0] + docs_folder = '../apps/{app}/{app}/docs/user'.format(app=app) self.out_base_path = '../apps/{app}/{app}/docs'.format(app=app) if os.path.exists(docs_folder): @@ -147,7 +150,7 @@ class HelpDatabase(object): content = markdown(content) title = self.make_title(basepath, fname, content) intro = self.make_intro(content) - content = self.make_content(content, fpath, relpath) + 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: @@ -175,7 +178,7 @@ class HelpDatabase(object): intro = "Help Video: " + intro return intro - def make_content(self, html, path, relpath): + def make_content(self, html, path, relpath, app_name, doc_app): if '

' in html: html = html.split('

', 1)[1] @@ -183,6 +186,9 @@ class HelpDatabase(object): html = html.replace('{next}', '') target = path.split('/', 3)[-1] + + if app_name != doc_app: + target = target.replace(app_name, doc_app + '/www') app_name = path.split('/', 3)[2] html += get_improve_page_html(app_name, target)