{# This is the main template of Simrofy theme. It doesn't explicitly import other templates, but it does borrow many ideas from following themes: * basic * sphinx-doc * python-docs-theme * sphinx-rtd-theme And Simrofy direcly borrowed these macros from Sphinx basic/layout.html to ensure its extendability for most extensions. A small number of extensions (e.g. MathJax) have been confirmed to work under Simrofy properly, yet others may or may not. * css() * script() #} {%- block doctype -%} {# Borrow from basic/layout.html #} {%- if html5_doctype -%} {%- else -%} {%- endif -%} {%- endblock -%} {%- set simrofy_url = "https://github.com/wklchris/sphinx-simrofy-theme" %} {%- set simrofy_version = '0.2.0' %} {%- set titlesuffix = ' - ' + project %} {%- set url_mainsite = pathto(master_doc) %} {# --- MACROS --- #} {%- macro css() %} {%- for css in css_files %} {%- if css|attr("filename") %} {{ css_tag(css) }} {%- else %} {%- endif %} {%- endfor %} {%- endmacro %} {%- macro script() %} {%- for js in script_files %} {{ js_tag(js) }} {%- endfor %} {%- endmacro %} {%- macro pathto_static(filepath, static_build_path='_static/') -%} {# static_build_path is the static file path AFTER sphinx build. Usually it is '_static/' (attention the tailing slash). #} {{ pathto(static_build_path + filepath|e, 1) }} {%- endmacro %} {%- macro pathto_source(filepath, source_path='_sources/') -%} {{ pathto(source_path + filepath|e, 1) }} {%- endmacro %} {%- macro simrofy_headlinks() -%} {%- set tocstr = toctree(titles_only=true, includehidden=true) | replace("href=", ">") | replace("", ";;") | striptags -%} {%- set headlinks = ''.join(tocstr.split(':')[1:]).strip(';;').split(';;') -%} {%- for item in headlinks -%} {% set plink = item.split('>')[0] | trim | trim('"') %} {% set ptitle = item.split('>')[1] %} {%- if plink != "#" and (not theme_headbar_links) or plink|replace(".html", "") in theme_headbar_links %} {{ ptitle }} {%- endif %} {%- endfor -%} {%- endmacro -%} {%- macro simrofy_sidebar() %} {%- if theme_sidebar_position in ['right', 'left'] %}
{%- endif %} {% endmacro %} {# --- HEAD --- #} {% block head %} {%- block htmltitle %}