Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-05-06 15:09:43 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-05-06 15:09:43 +0300
commit37a5736a1f9a5a8a63aed3009a14505aa6743ca6 (patch)
tree4a405fc6228fe5632ed21e0244144ee52727b11c /sphinx/templates
parentb0d070c8572c8316bf72889d6b04b95e6ce905bf (diff)
parenta9b3ec532276b7dc0ef35273177a1c6716796d73 (diff)
Merge branch '2.0'
Diffstat (limited to 'sphinx/templates')
-rw-r--r--sphinx/templates/apidoc/module.rst9
-rw-r--r--sphinx/templates/apidoc/package.rst52
-rw-r--r--sphinx/templates/apidoc/toc.rst8
-rw-r--r--sphinx/templates/imgmath/preview.tex_t2
-rw-r--r--sphinx/templates/imgmath/template.tex_t2
5 files changed, 71 insertions, 2 deletions
diff --git a/sphinx/templates/apidoc/module.rst b/sphinx/templates/apidoc/module.rst
new file mode 100644
index 000000000..249027855
--- /dev/null
+++ b/sphinx/templates/apidoc/module.rst
@@ -0,0 +1,9 @@
+{%- if show_headings %}
+{{- [basename, "module"] | join(' ') | e | heading }}
+
+{% endif -%}
+.. automodule:: {{ qualname }}
+{%- for option in automodule_options %}
+ :{{ option }}:
+{%- endfor %}
+
diff --git a/sphinx/templates/apidoc/package.rst b/sphinx/templates/apidoc/package.rst
new file mode 100644
index 000000000..0026af34c
--- /dev/null
+++ b/sphinx/templates/apidoc/package.rst
@@ -0,0 +1,52 @@
+{%- macro automodule(modname, options) -%}
+.. automodule:: {{ modname }}
+{%- for option in options %}
+ :{{ option }}:
+{%- endfor %}
+{%- endmacro %}
+
+{%- macro toctree(docnames) -%}
+.. toctree::
+{% for docname in docnames %}
+ {{ docname }}
+{%- endfor %}
+{%- endmacro %}
+
+{%- if is_namespace %}
+{{- [pkgname, "namespace"] | join(" ") | e | heading }}
+{% else %}
+{{- [pkgname, "package"] | join(" ") | e | heading }}
+{% endif %}
+
+{%- if modulefirst and not is_namespace %}
+{{ automodule(pkgname, automodule_options) }}
+{% endif %}
+
+{%- if subpackages %}
+Subpackages
+-----------
+
+{{ toctree(subpackages) }}
+{% endif %}
+
+{%- if submodules %}
+Submodules
+----------
+{% if separatemodules %}
+{{ toctree(submodules) }}
+{%- else %}
+{%- for submodule in submodules %}
+{% if show_headings %}
+{{- [submodule, "module"] | join(" ") | e | heading(2) }}
+{% endif %}
+{{ automodule(submodule, automodule_options) }}
+{%- endfor %}
+{% endif %}
+{% endif %}
+
+{%- if not modulefirst and not is_namespace %}
+Module contents
+---------------
+
+{{ automodule(pkgname, automodule_options) }}
+{% endif %}
diff --git a/sphinx/templates/apidoc/toc.rst b/sphinx/templates/apidoc/toc.rst
new file mode 100644
index 000000000..f0877eeb2
--- /dev/null
+++ b/sphinx/templates/apidoc/toc.rst
@@ -0,0 +1,8 @@
+{{ header | heading }}
+
+.. toctree::
+ :maxdepth: {{ maxdepth }}
+{% for docname in docnames %}
+ {{ docname }}
+{%- endfor %}
+
diff --git a/sphinx/templates/imgmath/preview.tex_t b/sphinx/templates/imgmath/preview.tex_t
index 1b7af81fa..f3fdcda07 100644
--- a/sphinx/templates/imgmath/preview.tex_t
+++ b/sphinx/templates/imgmath/preview.tex_t
@@ -1,5 +1,5 @@
\documentclass[12pt]{article}
-\usepackage[utf8x]{inputenc}
+\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
diff --git a/sphinx/templates/imgmath/template.tex_t b/sphinx/templates/imgmath/template.tex_t
index 19834bdc8..92fa8b021 100644
--- a/sphinx/templates/imgmath/template.tex_t
+++ b/sphinx/templates/imgmath/template.tex_t
@@ -1,5 +1,5 @@
\documentclass[12pt]{article}
-\usepackage[utf8x]{inputenc}
+\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}