[Python-modules-commits] [quark-sphinx-theme] 01/07: Import quark-sphinx-theme_0.4.0.orig.tar.bz2
Felix Krull
fkrull-guest at moszumanska.debian.org
Tue Oct 18 20:52:46 UTC 2016
This is an automated email from the git hooks/post-receive script.
fkrull-guest pushed a commit to branch master
in repository quark-sphinx-theme.
commit c8c1b531f8ff473e439ca0a27f178c85a65d6194
Author: Felix Krull <f_krull at gmx.de>
Date: Tue Oct 18 22:03:43 2016 +0200
Import quark-sphinx-theme_0.4.0.orig.tar.bz2
---
LICENSE | 26 ++++
MANIFEST.in | 9 +-
PKG-INFO | 18 ++-
README.rst | 13 ++
quark_sphinx_theme.egg-info/SOURCES.txt | 46 ------
setup.py | 15 +-
.../quark_sphinx_theme.egg-info}/PKG-INFO | 18 ++-
src/quark_sphinx_theme.egg-info/SOURCES.txt | 49 +++++++
.../dependency_links.txt | 0
.../quark_sphinx_theme.egg-info}/entry_points.txt | 0
.../quark_sphinx_theme.egg-info}/not-zip-safe | 0
src/quark_sphinx_theme.egg-info/requires.txt | 1 +
.../quark_sphinx_theme.egg-info}/top_level.txt | 0
.../quark_sphinx_theme}/__init__.py | 0
.../quark_sphinx_theme}/__version__.py | 2 +-
.../quark_sphinx_theme}/_lovelace.py | 0
.../quark_sphinx_theme}/_mixin.py | 0
.../quark_sphinx_theme}/ext/__init__.py | 0
.../quark_sphinx_theme}/ext/html_compat.py | 0
.../ext/html_rewrite/__init__.py | 21 ++-
.../quark_sphinx_theme}/ext/html_rewrite/boxes.py | 0
.../quark_sphinx_theme}/ext/html_rewrite/compat.py | 0
.../ext/html_rewrite/literal_blocks.py | 0
.../quark_sphinx_theme}/quark/domainindex.html | 0
.../quark_sphinx_theme}/quark/genindex-single.html | 0
.../quark_sphinx_theme}/quark/genindex.html | 0
.../quark_sphinx_theme}/quark/layout.html | 0
.../quark_sphinx_theme}/quark/static/quark.css_t | 81 +++++++----
.../quark_sphinx_theme}/quark/theme.conf | 0
test/test_core.py | 8 +-
test/test_html_rewrite.py | 61 ++++++--
test/test_import.py | 10 +-
test/test_mixin.py | 13 +-
test/test_sdist.py | 160 +++++++++++++++++++++
test/test_theme.py | 12 +-
test/util.py | 98 ++++++++-----
tox.ini | 23 +--
37 files changed, 526 insertions(+), 158 deletions(-)
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..4d6eb7f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,26 @@
+License for quark-sphinx-theme
+==============================
+
+Unless otherwise noted:
+Copyright (c) 2016 Felix Krull <f_krull at gmx.de>
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
diff --git a/MANIFEST.in b/MANIFEST.in
index 7ee478d..203fdf4 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,7 @@
-recursive-include quark_sphinx_theme/quark *
-recursive-include test/testdoc-* *
-include test/*.py
+include LICENSE
include tox.ini
+
+recursive-include src *.py
+recursive-include src/quark_sphinx_theme/quark *
+
+recursive-include test *.py *.rst
diff --git a/PKG-INFO b/PKG-INFO
index ec4378c..0618d7b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: quark-sphinx-theme
-Version: 0.3.2
+Version: 0.4.0
Summary: A Sphinx theme designed for QTextBrowser
Home-page: https://bitbucket.org/fk/quark-sphinx-theme
Author: Felix Krull
@@ -37,6 +37,19 @@ Description: ========================================
Changelog
=========
+ * quark-sphinx-theme 0.4 *(2016-10-18)*
+
+ - Add an explicit dependency on Sphinx.
+ - Rename ``quark_html_rewrite_features`` to ``quark_html_features``.
+ - Add ``quark_html_disabled_features`` to explicitly turn off certain rewrite
+ features.
+ - Style changes:
+
+ - More visually appealing code blocks on full browsers.
+ - Add styling for compact lists produced by ``::hlist`` directive.
+ - Correctly set width for topic blocks.
+ - Clean up definition list margins.
+
* quark-sphinx-theme 0.3.2 "I'll get it right some day" *(2016-05-23)*
- Include a copy of the lovelace style for compatibility with Pygments < 2.1.
@@ -100,3 +113,4 @@ Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Software Development :: Documentation
+Requires-Python: ~=2.7, ~=3.3
diff --git a/README.rst b/README.rst
index cb1f2c0..d895b90 100644
--- a/README.rst
+++ b/README.rst
@@ -29,6 +29,19 @@ Installation
Changelog
=========
+* quark-sphinx-theme 0.4 *(2016-10-18)*
+
+ - Add an explicit dependency on Sphinx.
+ - Rename ``quark_html_rewrite_features`` to ``quark_html_features``.
+ - Add ``quark_html_disabled_features`` to explicitly turn off certain rewrite
+ features.
+ - Style changes:
+
+ - More visually appealing code blocks on full browsers.
+ - Add styling for compact lists produced by ``::hlist`` directive.
+ - Correctly set width for topic blocks.
+ - Clean up definition list margins.
+
* quark-sphinx-theme 0.3.2 "I'll get it right some day" *(2016-05-23)*
- Include a copy of the lovelace style for compatibility with Pygments < 2.1.
diff --git a/quark_sphinx_theme.egg-info/SOURCES.txt b/quark_sphinx_theme.egg-info/SOURCES.txt
deleted file mode 100644
index 966ccfc..0000000
--- a/quark_sphinx_theme.egg-info/SOURCES.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-MANIFEST.in
-README.rst
-setup.cfg
-setup.py
-tox.ini
-quark_sphinx_theme/__init__.py
-quark_sphinx_theme/__version__.py
-quark_sphinx_theme/_lovelace.py
-quark_sphinx_theme/_mixin.py
-quark_sphinx_theme.egg-info/PKG-INFO
-quark_sphinx_theme.egg-info/SOURCES.txt
-quark_sphinx_theme.egg-info/dependency_links.txt
-quark_sphinx_theme.egg-info/entry_points.txt
-quark_sphinx_theme.egg-info/not-zip-safe
-quark_sphinx_theme.egg-info/top_level.txt
-quark_sphinx_theme/ext/__init__.py
-quark_sphinx_theme/ext/html_compat.py
-quark_sphinx_theme/ext/html_rewrite/__init__.py
-quark_sphinx_theme/ext/html_rewrite/boxes.py
-quark_sphinx_theme/ext/html_rewrite/compat.py
-quark_sphinx_theme/ext/html_rewrite/literal_blocks.py
-quark_sphinx_theme/quark/domainindex.html
-quark_sphinx_theme/quark/genindex-single.html
-quark_sphinx_theme/quark/genindex.html
-quark_sphinx_theme/quark/layout.html
-quark_sphinx_theme/quark/theme.conf
-quark_sphinx_theme/quark/static/quark.css_t
-test/__init__.py
-test/test_core.py
-test/test_html_rewrite.py
-test/test_import.py
-test/test_mixin.py
-test/test_theme.py
-test/util.py
-test/testdoc-html_rewrite/conf.py
-test/testdoc-html_rewrite/contents.rst
-test/testdoc-html_rewrite/test_admonition.rst
-test/testdoc-html_rewrite/test_citation.rst
-test/testdoc-html_rewrite/test_footnote.rst
-test/testdoc-html_rewrite/test_literal_block.rst
-test/testdoc-html_rewrite/test_pre_block.rst
-test/testdoc-html_rewrite/test_sidebar.rst
-test/testdoc-html_rewrite/test_topic.rst
-test/testdoc-html_rewrite/test_warning.rst
-test/testdoc-theme/conf.py
-test/testdoc-theme/contents.rst
\ No newline at end of file
diff --git a/setup.py b/setup.py
index cca1a0c..a64c57a 100644
--- a/setup.py
+++ b/setup.py
@@ -2,15 +2,18 @@
# -*- coding: utf-8 -*-
from io import open
import os
+import sys
from setuptools import setup, find_packages
-from quark_sphinx_theme.__version__ import __version__
-
dist_dir = os.path.dirname(os.path.abspath(__file__))
readme = os.path.join(dist_dir, 'README.rst')
with open(readme, 'r', encoding='utf-8') as f:
long_description = f.read()
+sys.path.insert(0, os.path.join(dist_dir, 'src', 'quark_sphinx_theme'))
+from __version__ import __version__ # noqa
+del sys.path[0]
+
setup(
name='quark-sphinx-theme',
version=__version__,
@@ -32,9 +35,11 @@ setup(
'Topic :: Software Development :: Documentation',
],
zip_safe=False,
+ install_requires=['sphinx>=1.1'],
+ python_requires='~=2.7, ~=3.3',
- packages=find_packages(include=['quark_sphinx_theme',
- 'quark_sphinx_theme.*']),
+ packages=find_packages('src'),
+ package_dir={'': 'src'},
include_package_data=True,
entry_points={
'sphinx_themes': [
@@ -43,5 +48,5 @@ setup(
},
test_suite='test',
- tests_require=['sphinx', 'html5lib', 'tinycss'],
+ tests_require=['html5lib', 'tinycss'],
)
diff --git a/quark_sphinx_theme.egg-info/PKG-INFO b/src/quark_sphinx_theme.egg-info/PKG-INFO
similarity index 83%
rename from quark_sphinx_theme.egg-info/PKG-INFO
rename to src/quark_sphinx_theme.egg-info/PKG-INFO
index ec4378c..0618d7b 100644
--- a/quark_sphinx_theme.egg-info/PKG-INFO
+++ b/src/quark_sphinx_theme.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: quark-sphinx-theme
-Version: 0.3.2
+Version: 0.4.0
Summary: A Sphinx theme designed for QTextBrowser
Home-page: https://bitbucket.org/fk/quark-sphinx-theme
Author: Felix Krull
@@ -37,6 +37,19 @@ Description: ========================================
Changelog
=========
+ * quark-sphinx-theme 0.4 *(2016-10-18)*
+
+ - Add an explicit dependency on Sphinx.
+ - Rename ``quark_html_rewrite_features`` to ``quark_html_features``.
+ - Add ``quark_html_disabled_features`` to explicitly turn off certain rewrite
+ features.
+ - Style changes:
+
+ - More visually appealing code blocks on full browsers.
+ - Add styling for compact lists produced by ``::hlist`` directive.
+ - Correctly set width for topic blocks.
+ - Clean up definition list margins.
+
* quark-sphinx-theme 0.3.2 "I'll get it right some day" *(2016-05-23)*
- Include a copy of the lovelace style for compatibility with Pygments < 2.1.
@@ -100,3 +113,4 @@ Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Software Development :: Documentation
+Requires-Python: ~=2.7, ~=3.3
diff --git a/src/quark_sphinx_theme.egg-info/SOURCES.txt b/src/quark_sphinx_theme.egg-info/SOURCES.txt
new file mode 100644
index 0000000..a619770
--- /dev/null
+++ b/src/quark_sphinx_theme.egg-info/SOURCES.txt
@@ -0,0 +1,49 @@
+LICENSE
+MANIFEST.in
+README.rst
+setup.cfg
+setup.py
+tox.ini
+src/quark_sphinx_theme/__init__.py
+src/quark_sphinx_theme/__version__.py
+src/quark_sphinx_theme/_lovelace.py
+src/quark_sphinx_theme/_mixin.py
+src/quark_sphinx_theme.egg-info/PKG-INFO
+src/quark_sphinx_theme.egg-info/SOURCES.txt
+src/quark_sphinx_theme.egg-info/dependency_links.txt
+src/quark_sphinx_theme.egg-info/entry_points.txt
+src/quark_sphinx_theme.egg-info/not-zip-safe
+src/quark_sphinx_theme.egg-info/requires.txt
+src/quark_sphinx_theme.egg-info/top_level.txt
+src/quark_sphinx_theme/ext/__init__.py
+src/quark_sphinx_theme/ext/html_compat.py
+src/quark_sphinx_theme/ext/html_rewrite/__init__.py
+src/quark_sphinx_theme/ext/html_rewrite/boxes.py
+src/quark_sphinx_theme/ext/html_rewrite/compat.py
+src/quark_sphinx_theme/ext/html_rewrite/literal_blocks.py
+src/quark_sphinx_theme/quark/domainindex.html
+src/quark_sphinx_theme/quark/genindex-single.html
+src/quark_sphinx_theme/quark/genindex.html
+src/quark_sphinx_theme/quark/layout.html
+src/quark_sphinx_theme/quark/theme.conf
+src/quark_sphinx_theme/quark/static/quark.css_t
+test/__init__.py
+test/test_core.py
+test/test_html_rewrite.py
+test/test_import.py
+test/test_mixin.py
+test/test_sdist.py
+test/test_theme.py
+test/util.py
+test/testdoc-html_rewrite/conf.py
+test/testdoc-html_rewrite/contents.rst
+test/testdoc-html_rewrite/test_admonition.rst
+test/testdoc-html_rewrite/test_citation.rst
+test/testdoc-html_rewrite/test_footnote.rst
+test/testdoc-html_rewrite/test_literal_block.rst
+test/testdoc-html_rewrite/test_pre_block.rst
+test/testdoc-html_rewrite/test_sidebar.rst
+test/testdoc-html_rewrite/test_topic.rst
+test/testdoc-html_rewrite/test_warning.rst
+test/testdoc-theme/conf.py
+test/testdoc-theme/contents.rst
\ No newline at end of file
diff --git a/quark_sphinx_theme.egg-info/dependency_links.txt b/src/quark_sphinx_theme.egg-info/dependency_links.txt
similarity index 100%
rename from quark_sphinx_theme.egg-info/dependency_links.txt
rename to src/quark_sphinx_theme.egg-info/dependency_links.txt
diff --git a/quark_sphinx_theme.egg-info/entry_points.txt b/src/quark_sphinx_theme.egg-info/entry_points.txt
similarity index 100%
rename from quark_sphinx_theme.egg-info/entry_points.txt
rename to src/quark_sphinx_theme.egg-info/entry_points.txt
diff --git a/quark_sphinx_theme.egg-info/not-zip-safe b/src/quark_sphinx_theme.egg-info/not-zip-safe
similarity index 100%
rename from quark_sphinx_theme.egg-info/not-zip-safe
rename to src/quark_sphinx_theme.egg-info/not-zip-safe
diff --git a/src/quark_sphinx_theme.egg-info/requires.txt b/src/quark_sphinx_theme.egg-info/requires.txt
new file mode 100644
index 0000000..b8f7aa6
--- /dev/null
+++ b/src/quark_sphinx_theme.egg-info/requires.txt
@@ -0,0 +1 @@
+sphinx>=1.1
diff --git a/quark_sphinx_theme.egg-info/top_level.txt b/src/quark_sphinx_theme.egg-info/top_level.txt
similarity index 100%
rename from quark_sphinx_theme.egg-info/top_level.txt
rename to src/quark_sphinx_theme.egg-info/top_level.txt
diff --git a/quark_sphinx_theme/__init__.py b/src/quark_sphinx_theme/__init__.py
similarity index 100%
rename from quark_sphinx_theme/__init__.py
rename to src/quark_sphinx_theme/__init__.py
diff --git a/quark_sphinx_theme/__version__.py b/src/quark_sphinx_theme/__version__.py
similarity index 86%
rename from quark_sphinx_theme/__version__.py
rename to src/quark_sphinx_theme/__version__.py
index 4cb45cd..a2988ca 100644
--- a/quark_sphinx_theme/__version__.py
+++ b/src/quark_sphinx_theme/__version__.py
@@ -3,5 +3,5 @@
# Copyright (c) 2016 Felix Krull <f_krull at gmx.de>
# Released under the terms of the BSD license; see LICENSE.
-__version_info__ = (0, 3, 2)
+__version_info__ = (0, 4, 0)
__version__ = '.'.join(map(str, __version_info__))
diff --git a/quark_sphinx_theme/_lovelace.py b/src/quark_sphinx_theme/_lovelace.py
similarity index 100%
rename from quark_sphinx_theme/_lovelace.py
rename to src/quark_sphinx_theme/_lovelace.py
diff --git a/quark_sphinx_theme/_mixin.py b/src/quark_sphinx_theme/_mixin.py
similarity index 100%
rename from quark_sphinx_theme/_mixin.py
rename to src/quark_sphinx_theme/_mixin.py
diff --git a/quark_sphinx_theme/ext/__init__.py b/src/quark_sphinx_theme/ext/__init__.py
similarity index 100%
rename from quark_sphinx_theme/ext/__init__.py
rename to src/quark_sphinx_theme/ext/__init__.py
diff --git a/quark_sphinx_theme/ext/html_compat.py b/src/quark_sphinx_theme/ext/html_compat.py
similarity index 100%
rename from quark_sphinx_theme/ext/html_compat.py
rename to src/quark_sphinx_theme/ext/html_compat.py
diff --git a/quark_sphinx_theme/ext/html_rewrite/__init__.py b/src/quark_sphinx_theme/ext/html_rewrite/__init__.py
similarity index 71%
rename from quark_sphinx_theme/ext/html_rewrite/__init__.py
rename to src/quark_sphinx_theme/ext/html_rewrite/__init__.py
index 2c4cf0d..54f2402 100644
--- a/quark_sphinx_theme/ext/html_rewrite/__init__.py
+++ b/src/quark_sphinx_theme/ext/html_rewrite/__init__.py
@@ -28,6 +28,13 @@ ALL_FEATURES = [f[0] for f in FEATURE_CLASSES]
DEFAULT_FEATURES = ALL_FEATURES
+def create_translator_class(cls, enabled_features, disabled_features):
+ return create_compound_class(cls, (
+ mixin for feature, mixin in FEATURE_CLASSES
+ if feature in enabled_features and feature not in disabled_features
+ ))
+
+
def setup_translators(app):
# So this is a bit hacky; the "proper" way would be to use the new
# app.set_translator function added in Sphinx 1.3, but that's much more
@@ -39,16 +46,16 @@ def setup_translators(app):
cls = app.builder.translator_class
is_html = isinstance(app.builder, StandaloneHTMLBuilder)
if is_html and cls in KNOWN_TRANSLATORS:
- mixins = []
- for feature, mixin in FEATURE_CLASSES:
- if feature in app.config.quark_html_rewrite_features:
- mixins.append(mixin)
- app.builder.translator_class = create_compound_class(cls, mixins)
+ app.builder.translator_class = create_translator_class(
+ cls,
+ app.config.quark_html_features,
+ app.config.quark_html_disabled_features
+ )
def setup(app):
- app.add_config_value('quark_html_rewrite_features',
- DEFAULT_FEATURES, 'html')
+ app.add_config_value('quark_html_features', DEFAULT_FEATURES, 'html')
+ app.add_config_value('quark_html_disabled_features', [], 'html')
app.connect('builder-inited', setup_translators)
return {
'version': __version__,
diff --git a/quark_sphinx_theme/ext/html_rewrite/boxes.py b/src/quark_sphinx_theme/ext/html_rewrite/boxes.py
similarity index 100%
rename from quark_sphinx_theme/ext/html_rewrite/boxes.py
rename to src/quark_sphinx_theme/ext/html_rewrite/boxes.py
diff --git a/quark_sphinx_theme/ext/html_rewrite/compat.py b/src/quark_sphinx_theme/ext/html_rewrite/compat.py
similarity index 100%
rename from quark_sphinx_theme/ext/html_rewrite/compat.py
rename to src/quark_sphinx_theme/ext/html_rewrite/compat.py
diff --git a/quark_sphinx_theme/ext/html_rewrite/literal_blocks.py b/src/quark_sphinx_theme/ext/html_rewrite/literal_blocks.py
similarity index 100%
rename from quark_sphinx_theme/ext/html_rewrite/literal_blocks.py
rename to src/quark_sphinx_theme/ext/html_rewrite/literal_blocks.py
diff --git a/quark_sphinx_theme/quark/domainindex.html b/src/quark_sphinx_theme/quark/domainindex.html
similarity index 100%
rename from quark_sphinx_theme/quark/domainindex.html
rename to src/quark_sphinx_theme/quark/domainindex.html
diff --git a/quark_sphinx_theme/quark/genindex-single.html b/src/quark_sphinx_theme/quark/genindex-single.html
similarity index 100%
rename from quark_sphinx_theme/quark/genindex-single.html
rename to src/quark_sphinx_theme/quark/genindex-single.html
diff --git a/quark_sphinx_theme/quark/genindex.html b/src/quark_sphinx_theme/quark/genindex.html
similarity index 100%
rename from quark_sphinx_theme/quark/genindex.html
rename to src/quark_sphinx_theme/quark/genindex.html
diff --git a/quark_sphinx_theme/quark/layout.html b/src/quark_sphinx_theme/quark/layout.html
similarity index 100%
rename from quark_sphinx_theme/quark/layout.html
rename to src/quark_sphinx_theme/quark/layout.html
diff --git a/quark_sphinx_theme/quark/static/quark.css_t b/src/quark_sphinx_theme/quark/static/quark.css_t
similarity index 84%
rename from quark_sphinx_theme/quark/static/quark.css_t
rename to src/quark_sphinx_theme/quark/static/quark.css_t
index 874e14d..47e9da8 100644
--- a/quark_sphinx_theme/quark/static/quark.css_t
+++ b/src/quark_sphinx_theme/quark/static/quark.css_t
@@ -12,9 +12,11 @@
body {
color: {{ text_color }};
+
{% if theme_body_font -%}
font-family: {{ theme_body_font }};
{%- endif %}
+
{% if theme_body_font_size -%}
font-size: {{ theme_body_font_size }};
{%- endif %}
@@ -32,9 +34,9 @@ li {
}
{% for x in range(2, 10) -%}
- {{ 'li ' * x }}{
- text-indent: {{ theme_li_extra_indent | int * x }}px;
- }
+{{ 'li ' * x }}{
+ text-indent: {{ theme_li_extra_indent | int * x }}px;
+}
{% endfor %}
blockquote {
@@ -46,12 +48,22 @@ dt {
font-weight: bold;
}
-dd {
+dd > * {
+ margin-top: 0;
+}
+
+li > dl > dd {
margin-left: 0;
}
-dd .first {
+/* Compact list produced by hlist:: directive */
+table.hlist {
+ margin-top: 1em;
+}
+
+table.hlist ul {
margin-top: 0;
+ margin-bottom: 0;
}
@@ -97,10 +109,12 @@ dd .first {
margin: 2em;
background-color: {{ theme_sidebar_bgcolor or 'transparent' }};
float: right;
+
{% if theme_sidebar_border -%}
border-style: solid;
border-width: 1px;
{%- endif %}
+
border-color: {{ text_color }};
width: 20%;
@@ -111,10 +125,10 @@ dd .first {
}
{% for i in range(1, 7) -%}
- .sphinxsidebar h{{ i }} {
- font-size: medium;
- font-weight: bold;
- }
+.sphinxsidebar h{{ i }} {
+ font-size: medium;
+ font-weight: bold;
+}
{% endfor %}
@@ -173,6 +187,7 @@ code, pre {
{% if theme_code_font -%}
font-family: {{ theme_code_font }};
{%- endif %}
+
{% if theme_code_font_size -%}
font-size: {{ theme_code_font_size }};
{%- endif %}
@@ -194,12 +209,12 @@ code.descclassname {
pre {
margin: 0.5em;
margin-top: 1.5em;
+
{% if theme_pre_bgcolor -%}
background-color: {{ theme_pre_bgcolor }} !important;
{%- endif %}
}
-
/* Extra rules for literal blocks wrapped by ``html_rewrite`` */
.-x-quark-literal-block {
margin-top: 1em;
@@ -329,6 +344,10 @@ table.docutils.footnote td.label, table.docutils.citation td.label {
border-color: {{ text_color }};
}
+.-x-quark-topic {
+ width: 100%;
+}
+
.-x-quark-sidebar {
margin-left: 1em;
float: right;
@@ -340,9 +359,10 @@ table.docutils.footnote td.label, table.docutils.citation td.label {
background-color: {{ theme_admonition_bgcolor or 'transparent' }};
{% if theme_admonition_border -%}
- border-style: solid;
- border-width: 1px;
+ border-style: solid;
+ border-width: 1px;
{%- endif %}
+
border-color: {{ theme_admonition_fgcolor or text_color }};
width: 100%;
@@ -389,18 +409,27 @@ div.line-block > div.line {
{% if theme_full_browser_extras -%}
- /* Some extra hover niceties for full browsers *
- * ------------------------------------------- */
- a:hover {
- text-decoration: underline;
- }
-
- a.headerlink:hover {
- color: {{ link_color }};
- text-decoration: none;
- }
-
- .navbar a:hover {
- color: {{ link_color }};
- }
+
+/* Some extra niceties for full browsers *
+ * ------------------------------------------- */
+a:hover {
+ text-decoration: underline;
+}
+
+a.headerlink:hover {
+ color: {{ link_color }};
+ text-decoration: none;
+}
+
+.navbar a:hover {
+ color: {{ link_color }};
+}
+
+pre:only-child {
+ /* This gets us nicer literal blocks even without html_rewrite */
+ margin: 0;
+ margin-top: 1em;
+ padding: 0.5em;
+}
+
{%- endif %}
diff --git a/quark_sphinx_theme/quark/theme.conf b/src/quark_sphinx_theme/quark/theme.conf
similarity index 100%
rename from quark_sphinx_theme/quark/theme.conf
rename to src/quark_sphinx_theme/quark/theme.conf
diff --git a/test/test_core.py b/test/test_core.py
index 5cebccc..697393e 100644
--- a/test/test_core.py
+++ b/test/test_core.py
@@ -4,14 +4,18 @@
# Released under the terms of the BSD license; see LICENSE.
import os
-from unittest import TestCase
+import unittest
import quark_sphinx_theme
-class TestGetPath(TestCase):
+class TestGetPath(unittest.TestCase):
def test_get_path(self):
p = quark_sphinx_theme.get_path()
self.assertTrue(os.path.isdir(p))
conf = os.path.join(p, 'quark', 'theme.conf')
self.assertTrue(os.path.isfile(conf))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_html_rewrite.py b/test/test_html_rewrite.py
index ed2b862..c4600db 100644
--- a/test/test_html_rewrite.py
+++ b/test/test_html_rewrite.py
@@ -4,16 +4,22 @@
# Released under the terms of the BSD license; see LICENSE.
import os
-from unittest import TestCase
+import sys
+import unittest
-from .util import SphinxBuildFixture, with_elements
+from quark_sphinx_theme.ext.html_rewrite import (
+ create_translator_class, HTMLCompatMixin, BoxesMixin, LiteralBlocksMixin)
+from sphinx.writers.html import HTMLTranslator
+DIR = os.path.abspath(os.path.dirname(__file__))
+sys.path.insert(0, DIR)
+from util import SphinxBuildFixture, with_document, with_elements # noqa
-_package_dir = os.path.dirname(os.path.abspath(__file__))
+testdoc_html_rewrite = os.path.join(DIR, 'testdoc-html_rewrite')
class TestHTMLRewriteOutputTestCases(SphinxBuildFixture):
- source_dir = os.path.join(_package_dir, 'testdoc-html_rewrite')
+ source_dir = testdoc_html_rewrite
@with_elements('test_pre_block', './/div[@class="highlight"]//pre//span')
def test_pre_block(self, elems):
@@ -75,18 +81,18 @@ class TestHTMLRewriteOutputTestCases(SphinxBuildFixture):
self.assertIn('-x-quark-literal-block', par.get('class'))
-class TestHTMLRewriteOutput(TestHTMLRewriteOutputTestCases, TestCase):
+class TestHTMLRewriteOutput(TestHTMLRewriteOutputTestCases, unittest.TestCase):
pass
-class TestHTMLCompatOutput(TestHTMLRewriteOutputTestCases, TestCase):
+class TestHTMLCompatOutput(TestHTMLRewriteOutputTestCases, unittest.TestCase):
tags = ['test_html_compat_alias']
-class TestHTMLRewriteFeaturesSetting(SphinxBuildFixture, TestCase):
- source_dir = os.path.join(_package_dir, 'testdoc-html_rewrite')
+class TestHTMLRewriteFeatures(SphinxBuildFixture, unittest.TestCase):
+ source_dir = testdoc_html_rewrite
config = {
- 'quark_html_rewrite_features': '',
+ 'quark_html_features': '',
}
@with_elements('test_footnote', './/table[@class="docutils footnote"]/..')
@@ -124,3 +130,40 @@ class TestHTMLRewriteFeaturesSetting(SphinxBuildFixture, TestCase):
for par in elems:
self.assertNotEqual(par.tag, 'table')
self.assertNotIn('-x-quark-literal-block', par.get('class'))
+
+
+class TestCreateTranslatorClass(unittest.TestCase):
+ CLS = HTMLTranslator
+
+ def test_no_enabled_no_disabled(self):
+ cls = create_translator_class(self.CLS, [], [])
+ self.assertTrue(issubclass(cls, self.CLS))
+ self.assertFalse(issubclass(cls, HTMLCompatMixin))
+ self.assertFalse(issubclass(cls, BoxesMixin))
+ self.assertFalse(issubclass(cls, LiteralBlocksMixin))
+
+ def test_some_enabled_no_disabled(self):
+ cls = create_translator_class(self.CLS, ['compat'], [])
+ self.assertTrue(issubclass(cls, self.CLS))
+ self.assertTrue(issubclass(cls, HTMLCompatMixin))
+ self.assertFalse(issubclass(cls, BoxesMixin))
+ self.assertFalse(issubclass(cls, LiteralBlocksMixin))
+
+ def test_no_enabled_some_disabled(self):
+ cls = create_translator_class(self.CLS, [], ['boxes', 'literal_blocks'])
+ self.assertTrue(issubclass(cls, self.CLS))
+ self.assertFalse(issubclass(cls, HTMLCompatMixin))
+ self.assertFalse(issubclass(cls, BoxesMixin))
+ self.assertFalse(issubclass(cls, LiteralBlocksMixin))
+
+ def test_some_enabled_some_disabled(self):
+ cls = create_translator_class(self.CLS, ['compat', 'boxes'],
+ ['literal_blocks', 'compat'])
+ self.assertTrue(issubclass(cls, self.CLS))
+ self.assertFalse(issubclass(cls, HTMLCompatMixin))
+ self.assertTrue(issubclass(cls, BoxesMixin))
+ self.assertFalse(issubclass(cls, LiteralBlocksMixin))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_import.py b/test/test_import.py
index 3a0a77d..ad66975 100644
--- a/test/test_import.py
+++ b/test/test_import.py
@@ -3,11 +3,11 @@
# Copyright (c) 2016 Felix Krull <f_krull at gmx.de>
# Released under the terms of the BSD license; see LICENSE.
-from unittest import TestCase
+import unittest
-class TestModuleImport(TestCase):
- def assertImports(self, modname): # noqa
+class TestModuleImport(unittest.TestCase):
+ def assertImports(self, modname):
try:
__import__(modname)
except ImportError as exc:
@@ -27,3 +27,7 @@ class TestModuleImport(TestCase):
def test_ext_html_compat(self):
self.assertImports('quark_sphinx_theme.ext.html_compat')
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_mixin.py b/test/test_mixin.py
index e0ed033..6262b8f 100644
--- a/test/test_mixin.py
+++ b/test/test_mixin.py
@@ -3,9 +3,8 @@
# Copyright (c) 2016 Felix Krull <f_krull at gmx.de>
# Released under the terms of the BSD license; see LICENSE.
-from unittest import TestCase
+import unittest
-from .util import ExtraAsserts
from quark_sphinx_theme import _mixin
@@ -68,7 +67,11 @@ class MixinNoTag:
__name_tag__ = ''
-class TestMixins(ExtraAsserts, TestCase):
+class TestMixins(unittest.TestCase):
+ def assertBases(self, cls, *bases):
+ for base in bases:
+ self.assertTrue(issubclass(cls, base))
+
def test_no_mixins(self):
cls = _mixin.create_compound_class(BaseClass, [])
self.assertBases(cls, BaseClass, object)
@@ -121,3 +124,7 @@ class TestMixins(ExtraAsserts, TestCase):
def test_explicit_name(self):
cls = _mixin.create_compound_class(BaseClass, [], 'ExplicitName')
self.assertEqual(cls.__name__, 'ExplicitName')
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_sdist.py b/test/test_sdist.py
new file mode 100644
index 0000000..dbb8bf9
--- /dev/null
+++ b/test/test_sdist.py
@@ -0,0 +1,160 @@
+# -*- coding: utf-8 -*-
+# This file is part of quark-sphinx-theme.
+# Copyright (c) 2016 Felix Krull <f_krull at gmx.de>
+# Released under the terms of the BSD license; see LICENSE.
+
+from contextlib import contextmanager
+import glob
+import os
+import shutil
+import sys
+import tempfile
+import unittest
+import zipfile
+
+DIR = os.path.abspath(os.path.dirname(__file__))
+sys.path.insert(0, DIR)
+from util import attrs, capture_output # noqa
+
+
+ at contextmanager
+def cwd(dir):
+ oldcwd = os.getcwd()
+ os.chdir(dir)
+ try:
+ yield
+ finally:
+ os.chdir(oldcwd)
+
+
+def run_setup(*args):
+ argv = ['setup.py']
+ argv.extend(args)
+ with attrs(sys, argv=argv):
+ with capture_output() as stdout:
+ try:
+ import setup # noqa
+ except Exception as exc:
+ raise Exception('%s\n--- Output:\n%s-----' %
+ (exc, stdout.getvalue()))
+ finally:
+ try:
+ del sys.modules['setup']
+ except Exception:
+ pass
+
+
+SDIST_FILE_LIST = [
+ ('src', [
+ ('quark_sphinx_theme', [
+ '__init__.py',
+ '__version__.py',
+ '_lovelace.py',
+ '_mixin.py',
+ ('ext', [
+ '__init__.py',
+ 'html_compat.py',
+ ('html_rewrite', [
+ '__init__.py',
+ 'boxes.py',
+ 'compat.py',
+ 'literal_blocks.py',
+ ]),
+ ]),
+ ('quark', [
+ 'domainindex.html',
+ 'genindex-single.html',
+ 'genindex.html',
+ 'layout.html',
+ 'theme.conf',
+ 'static/quark.css_t',
+ ]),
+ ]),
+ ]),
+ ('test', [
+ '__init__.py',
+ 'test_core.py',
+ 'test_html_rewrite.py',
+ 'test_import.py',
+ 'test_mixin.py',
+ 'test_sdist.py',
+ 'test_theme.py',
+ 'util.py',
+ ('testdoc-html_rewrite', [
+ 'conf.py',
+ 'contents.rst',
+ 'test_admonition.rst',
+ 'test_citation.rst',
+ 'test_footnote.rst',
+ 'test_literal_block.rst',
+ 'test_pre_block.rst',
+ 'test_sidebar.rst',
+ 'test_topic.rst',
+ 'test_warning.rst',
+ ]),
+ ('testdoc-theme', [
+ 'conf.py',
+ 'contents.rst',
+ ]),
+ ]),
+ 'LICENSE',
+ 'MANIFEST.in',
+ 'README.rst',
+ 'setup.cfg',
+ 'setup.py',
+ 'tox.ini',
+]
+
+
+def flatten_file_list(ls):
+ for item in ls:
+ if isinstance(item, str):
+ yield item
+ else:
+ prefix, subls = item
+ for subitem in flatten_file_list(subls):
+ yield '%s/%s' % (prefix, subitem)
+
+
+def verify_zipfile(z, ls, p=1):
+ with zipfile.ZipFile(z, mode='r') as arc:
+ names = [n.split('/', p)[-1] for n in arc.namelist()]
+ for f in flatten_file_list(ls):
+ if f not in names:
+ yield f
+
+
+class TestSourceDistContents(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls.distdir = tempfile.mkdtemp(prefix='tmp-test-sdist')
+ try:
+ with cwd(os.path.join(DIR, os.pardir)):
+ run_setup('egg_info', '--egg-base', cls.distdir,
+ 'sdist', '--formats=zip', '--dist-dir', cls.distdir)
+ cls.sdist_name = glob.glob(os.path.join(cls.distdir,
+ 'quark-sphinx-theme-*.zip'))[0]
+ except:
+ cls.tearDownClass()
+ raise
+
+ @classmethod
+ def tearDownClass(cls):
+ if cls.distdir:
+ shutil.rmtree(cls.distdir, True)
+ cls.distdir = None
+
+ def test_sdist_contents(self):
+ missing = list(verify_zipfile(self.sdist_name, SDIST_FILE_LIST))
+ if len(missing) != 0:
+ self.fail('Missing expected sdist contents:\n' + '\n'.join(missing))
+
+ def test_sdist_no_pyc(self):
+ with zipfile.ZipFile(self.sdist_name, mode='r') as arc:
... 217 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/quark-sphinx-theme.git
More information about the Python-modules-commits
mailing list