[fix] Documentation fixesversion-14
@@ -1,5 +0,0 @@ | |||||
# Pages | |||||
You can make your website by adding pages to the `/www` folder of your website. The urls of your site will match the path of your pages within the `/www` folder. | |||||
Pages must be `.html` or `.md` (Markdown) files. Basic HTML template is provided in frappe in `frappe/templates/base_template.html` |
@@ -305,19 +305,19 @@ img { | |||||
margin: 0 auto; | margin: 0 auto; | ||||
max-width: 870px; | max-width: 870px; | ||||
} | } | ||||
.page-container .webpage-content ol > li, | |||||
.page-container .webpage-content ul > li { | |||||
.page-container .page-content ol > li, | |||||
.page-container .page-content ul > li { | |||||
margin: 13px auto; | margin: 13px auto; | ||||
} | } | ||||
.page-container .webpage-content ol > li li, | |||||
.page-container .webpage-content ul > li li { | |||||
.page-container .page-content ol > li li, | |||||
.page-container .page-content ul > li li { | |||||
margin: 4px auto; | margin: 4px auto; | ||||
} | } | ||||
.page-container .webpage-content ol li ol { | |||||
.page-container .page-content ol li ol { | |||||
list-style-type: disc; | list-style-type: disc; | ||||
} | } | ||||
.page-container .webpage-content ul, | |||||
.page-container .webpage-content ol { | |||||
.page-container .page-content ul, | |||||
.page-container .page-content ol { | |||||
margin-bottom: 32px; | margin-bottom: 32px; | ||||
} | } | ||||
@media (min-width: 768px) { | @media (min-width: 768px) { | ||||
@@ -520,7 +520,7 @@ p { | |||||
margin-top: 24px; | margin-top: 24px; | ||||
font-size: 16px; | font-size: 16px; | ||||
} | } | ||||
.docs-footer img.frappe-bird { | |||||
.docs-footer img.frappe-bird-grey { | |||||
width: 40px; | width: 40px; | ||||
height: 40px; | height: 40px; | ||||
background: #fff; | background: #fff; | ||||
@@ -13,6 +13,8 @@ | |||||
{% include "templates/includes/navbar/navbar_link.html" %} | {% include "templates/includes/navbar/navbar_link.html" %} | ||||
{%- endif -%} | {%- endif -%} | ||||
{%- endfor %} | {%- endfor %} | ||||
{% block navbar_right_extension %}{% endblock %} | |||||
{% if not only_static %} | |||||
{% block navbar_right_extension %}{% endblock %} | |||||
{% endif %} | |||||
{% include "templates/includes/navbar/navbar_login.html" %} | {% include "templates/includes/navbar/navbar_login.html" %} | ||||
</ul> | |||||
</ul> |
@@ -119,9 +119,11 @@ def get_jloader(): | |||||
from jinja2 import ChoiceLoader, PackageLoader, PrefixLoader | from jinja2 import ChoiceLoader, PackageLoader, PrefixLoader | ||||
apps = frappe.local.flags.web_pages_apps or frappe.get_installed_apps(sort=True) | apps = frappe.local.flags.web_pages_apps or frappe.get_installed_apps(sort=True) | ||||
apps.reverse() | apps.reverse() | ||||
if not "frappe" in apps: | |||||
apps.append('frappe') | |||||
frappe.local.jloader = ChoiceLoader( | frappe.local.jloader = ChoiceLoader( | ||||
# search for something like app/templates/... | # search for something like app/templates/... | ||||
[PrefixLoader(dict( | [PrefixLoader(dict( | ||||
@@ -348,7 +348,7 @@ class setup_docs(object): | |||||
source_link = self.docs_config.source_link, | source_link = self.docs_config.source_link, | ||||
app_name = self.app, | app_name = self.app, | ||||
branch = context.app.branch, | branch = context.app.branch, | ||||
target = target_path_fragment)) | |||||
target = context.template)) | |||||
if not os.path.exists(os.path.dirname(target_filename)): | if not os.path.exists(os.path.dirname(target_filename)): | ||||
os.makedirs(os.path.dirname(target_filename)) | os.makedirs(os.path.dirname(target_filename)) | ||||
@@ -437,7 +437,7 @@ edit_link = ''' | |||||
<div class="page-content"> | <div class="page-content"> | ||||
<div class="edit-container text-center"> | <div class="edit-container text-center"> | ||||
<i class="icon icon-smile"></i> | <i class="icon icon-smile"></i> | ||||
<a class="text-muted edit" href="{source_link}/blob/{branch}/{app_name}/docs/{target}"> | |||||
<a class="text-muted edit" href="{source_link}/blob/{branch}/{app_name}/{target}"> | |||||
Improve this page | Improve this page | ||||
</a> | </a> | ||||
</div> | </div> | ||||
@@ -238,7 +238,7 @@ def setup_source(page_info): | |||||
def setup_index(page_info): | def setup_index(page_info): | ||||
'''Build page sequence from index.txt''' | '''Build page sequence from index.txt''' | ||||
if page_info.basename=='index': | |||||
if page_info.basename=='': | |||||
# load index.txt if loading all pages | # load index.txt if loading all pages | ||||
index_txt_path = os.path.join(page_info.basepath, 'index.txt') | index_txt_path = os.path.join(page_info.basepath, 'index.txt') | ||||
if os.path.exists(index_txt_path): | if os.path.exists(index_txt_path): | ||||
@@ -284,6 +284,8 @@ def load_properties(page_info): | |||||
import re | import re | ||||
if "<!-- title:" in page_info.source: | if "<!-- title:" in page_info.source: | ||||
page_info.title = re.findall('<!-- title:([^>]*) -->', page_info.source)[0].strip() | page_info.title = re.findall('<!-- title:([^>]*) -->', page_info.source)[0].strip() | ||||
elif "<h1>" in page_info.source: | |||||
page_info.title = re.findall('<h1>([^>]*)</h1>', page_info.source)[0].strip() | |||||
else: | else: | ||||
page_info.title = os.path.basename(page_info.name).replace('_', ' ').replace('-', ' ').title() | page_info.title = os.path.basename(page_info.name).replace('_', ' ').replace('-', ' ').title() | ||||
@@ -201,7 +201,7 @@ def get_full_index(route=None, extn = False): | |||||
new_children = [] | new_children = [] | ||||
for name in page_info.index: | for name in page_info.index: | ||||
child_route = page_info.route + '/' + name | child_route = page_info.route + '/' + name | ||||
if pages[child_route]: | |||||
if child_route in pages: | |||||
new_children.append(pages[child_route]) | new_children.append(pages[child_route]) | ||||
# add remaining pages not in index.txt | # add remaining pages not in index.txt | ||||