diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4653e7e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog for miaowware_sphinx_theme +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [Unreleased] + + +## [1.0.0] - 2020-12-20 +### Changed +- Adapted bizstyle theme with a new stylesheet. + + +[Unreleased]: https://github.com/miaowware/miaowware_sphinx_theme/compare/1.0.0...HEAD +[1.0.0]: https://github.com/miaowware/miaowware_sphinx_theme/releases/tag/1.0.0 \ No newline at end of file diff --git a/README.md b/README.md index a296561..66b9bc2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,22 @@ This theme is used for sphinx documentation of Miaowware projects. ## Usage +Install with `pip install -e https://github.com/miaowware/miaowware-sphinx-theme.git`, +or add `-e https://github.com/miaowware/miaowware-sphinx-theme.git` to your sphinx `requirements.txt`. + +In your sphinx `conf.py`, add: + +```py +import miaowware_sphinx_theme + +# ... + +html_theme = "miaowware" +html_theme_path = miaowware_sphinx_theme.get_html_theme_path() + +# If you want a logo +html_logo = "_static/your_logo.png" +``` ## Copyright @@ -11,3 +27,6 @@ Copyright 2020 classabbyamp, 0x5c Released under the BSD 3-Clause License. See [`LICENSE`](LICENSE) for the full license text. +## Screenshots + +![Theme Screenshot](example.png) diff --git a/devrequirements.txt b/devrequirements.txt new file mode 100644 index 0000000..9937b8f --- /dev/null +++ b/devrequirements.txt @@ -0,0 +1,3 @@ +-r requirements.txt +flake8 +mypy diff --git a/example.png b/example.png new file mode 100644 index 0000000..1f8a240 Binary files /dev/null and b/example.png differ diff --git a/miaowware_sphinx_theme/__info__.py b/miaowware_sphinx_theme/__info__.py new file mode 100644 index 0000000..5afc1a9 --- /dev/null +++ b/miaowware_sphinx_theme/__info__.py @@ -0,0 +1,14 @@ +"Package information file" +# Format and usage strongly inspired by AGProjects/python-application. + + +__project__ = "miaowware_sphinx_theme" +__summary__ = "A sphinx theme for miaowware projects" +__webpage__ = "https://github.com/miaowware/miaowware_sphinx_theme" + +__version__ = "1.0.0" + +__author__ = "classabbyamp, 0x5c" +__email__ = "dev@kb6.ee, dev@0x5c.io" + +__license__ = "BSD 3-Clause" diff --git a/miaowware_sphinx_theme/__init__.py b/miaowware_sphinx_theme/__init__.py new file mode 100644 index 0000000..8ccb2d7 --- /dev/null +++ b/miaowware_sphinx_theme/__init__.py @@ -0,0 +1,14 @@ + +import os + + +def get_html_theme_path(): + """Return a list of HTML theme paths""" + theme_path = os.path.abspath(os.path.dirname(__file__)) + return [theme_path] + + +def setup(app): + """Setup the theme""" + theme_path = get_html_theme_path()[0] + app.add_html_theme("miaowware", os.path.join(theme_path, "miaowware")) diff --git a/miaowware_sphinx_theme/miaowware/layout.html b/miaowware_sphinx_theme/miaowware/layout.html new file mode 100644 index 0000000..7871f8d --- /dev/null +++ b/miaowware_sphinx_theme/miaowware/layout.html @@ -0,0 +1,38 @@ +{# + miaowware/layout.html + + Copyright (c) 2020 classabbyamp, 0x5c + Released under the BSD 3-Clause License +#} + +{% extends "bizstyle/layout.html" %} + +{%- block extrahead %} + {{ super() }} + + + + + +{%- endblock %} + +{%- block rootrellink %} + {%- if theme_base_site %} +
+ {%- if theme_base_site %} + + {%- else %} + + {%- endif %} + + +
+ {%- endif %} +{%- endblock %} \ No newline at end of file diff --git a/miaowware_sphinx_theme/miaowware/static/favicon/android-chrome-192x192.png b/miaowware_sphinx_theme/miaowware/static/favicon/android-chrome-192x192.png new file mode 100644 index 0000000..2844e8a Binary files /dev/null and b/miaowware_sphinx_theme/miaowware/static/favicon/android-chrome-192x192.png differ diff --git a/miaowware_sphinx_theme/miaowware/static/favicon/android-chrome-512x512.png b/miaowware_sphinx_theme/miaowware/static/favicon/android-chrome-512x512.png new file mode 100644 index 0000000..139c021 Binary files /dev/null and b/miaowware_sphinx_theme/miaowware/static/favicon/android-chrome-512x512.png differ diff --git a/miaowware_sphinx_theme/miaowware/static/favicon/apple-touch-icon.png b/miaowware_sphinx_theme/miaowware/static/favicon/apple-touch-icon.png new file mode 100644 index 0000000..84fa059 Binary files /dev/null and b/miaowware_sphinx_theme/miaowware/static/favicon/apple-touch-icon.png differ diff --git a/miaowware_sphinx_theme/miaowware/static/favicon/favicon-16x16.png b/miaowware_sphinx_theme/miaowware/static/favicon/favicon-16x16.png new file mode 100644 index 0000000..2d9c3b7 Binary files /dev/null and b/miaowware_sphinx_theme/miaowware/static/favicon/favicon-16x16.png differ diff --git a/miaowware_sphinx_theme/miaowware/static/favicon/favicon-32x32.png b/miaowware_sphinx_theme/miaowware/static/favicon/favicon-32x32.png new file mode 100644 index 0000000..aa1d49c Binary files /dev/null and b/miaowware_sphinx_theme/miaowware/static/favicon/favicon-32x32.png differ diff --git a/miaowware_sphinx_theme/miaowware/static/favicon/favicon.ico b/miaowware_sphinx_theme/miaowware/static/favicon/favicon.ico new file mode 100644 index 0000000..3a00356 Binary files /dev/null and b/miaowware_sphinx_theme/miaowware/static/favicon/favicon.ico differ diff --git a/miaowware_sphinx_theme/miaowware/static/favicon/site.webmanifest b/miaowware_sphinx_theme/miaowware/static/favicon/site.webmanifest new file mode 100644 index 0000000..501b148 --- /dev/null +++ b/miaowware_sphinx_theme/miaowware/static/favicon/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"favicon/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"favicon/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} diff --git a/miaowware_sphinx_theme/miaowware/static/miaowware.css_t b/miaowware_sphinx_theme/miaowware/static/miaowware.css_t new file mode 100644 index 0000000..9e3e4fc --- /dev/null +++ b/miaowware_sphinx_theme/miaowware/static/miaowware.css_t @@ -0,0 +1,257 @@ +@import url("bizstyle.css"); + +/* -- logo ------------------------------------------------------------------ */ + +img.logo { + width: 128px; +} + +p.logo { + text-align: center; +} + +/* -- page layout ----------------------------------------------------------- */ + +body { + background-color: {{ theme_darkercolor }}; + background-image: none; + color: white; +} + +div.document { + background-color: {{ theme_darkcolor }}; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; +} + +div.bodywrapper { + border-left: 1px solid #ccc; +} + +div.related { + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; +} + +div.related ul { + border-top: 1px solid {{ theme_maincolor }}; + border-bottom: 1px solid {{ theme_maincolor }}; +} + +div.related ul li { + color: {{ theme_darkercolor }}; +} + +div.related ul li a { + color: {{ theme_darkercolor }}; +} + +div.related ul li a:hover { + color: {{ theme_darkercolor }}; +} + +div.sphinxsidebar h3, div.sphinxsidebar h4 { + color: {{ theme_darkercolor }}; +} + +div.sphinxsidebar h3 a { + color: {{ theme_darkercolor }}; +} + +div.sphinxsidebar #searchbox { + border-radius: 4px; +} + +div.sphinxsidebar #searchbox input[type="text"] { + background-color: {{ theme_darkercolor }}; + color: white; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + background-color: {{ theme_maincolor }}; + color: {{ theme_darkercolor }}; +} + +div.footer { + background-color: {{ theme_darkcolor }}; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; +} + +/* -- body styles ----------------------------------------------------------- */ + +h3 { + border-bottom: 1px solid #CCCCCC; +} + +div.body h1 a, div.body h2 a, div.body h3 a, +div.body h4 a, div.body h5 a, div.body h6 a { + color: {{ theme_maincolor }} !important; +} + +h1 a.anchor, h2 a.anchor, h3 a.anchor, +h4 a.anchor, h5 a.anchor, h6 a.anchor { + color: #aaa; +} + +h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, +h5 a.anchor:hover, h6 a.anchor:hover { + color: #777; + background-color: #eee; +} + +a.headerlink { + color: {{ theme_maincolor }} !important; +} + +a.headerlink:hover { + background-color: {{ theme_maincolor }}; + color: {{ theme_darkercolor }} !important; +} + +code { + background-color: {{ theme_darkercolor }}; + padding: 4px; + border-bottom: none; + border-radius: 4px; + color: #eee; +} + +hr { + border: 1px solid #abc; +} + +a { + color: {{ theme_maincolor }}; +} + +a:hover { + color: white; +} + +a code { + color: {{ theme_maincolor }}; +} + +a code:hover { + color: white; +} + +pre { + border-left: 5px solid {{ theme_darkercolor }}; + border-right: 5px solid {{ theme_darkercolor }}; +} + +div.quotebar { + background-color: #f8f8f8; + border: 1px solid #ccc; +} + +div.topic { + background-color: #f8f8f8; +} + +div.admonition { + border: 3px solid #cccccc; + background-color: #f7f7f7; +} + +div.admonition p.admonition-title { + color: white; + border-bottom: 3px solid #cccccc; + background-color: #165e83; +} + +div.danger { border: 3px solid #b7282e; background-color: {{ theme_darkcolor }}; } +div.error { border: 3px solid #b7282e; background-color: {{ theme_darkcolor }}; } +div.warning { border: 3px solid #f19072; background-color: {{ theme_darkcolor }}; } +div.caution { border: 3px solid #f19072; background-color: {{ theme_darkcolor }}; } +div.attention { border: 3px solid #f19072; background-color: {{ theme_darkcolor }}; } +div.important { border: 3px solid #f8b862; background-color: {{ theme_darkcolor }}; } +div.note { border: 3px solid #f8b862; background-color: {{ theme_darkcolor }}; } +div.hint { border: 3px solid #7ebea5; background-color: {{ theme_darkcolor }}; } +div.tip { border: 3px solid #7ebea5; background-color: {{ theme_darkcolor }}; } + +div.danger p.admonition-title, div.error p.admonition-title { + background-color: #b7282e; + border-bottom: none; +} + +div.caution p.admonition-title, +div.warning p.admonition-title, +div.attention p.admonition-title { + background-color: #f19072; + border-bottom: none; + color: {{ theme_darkcolor }}; +} + +div.note p.admonition-title, div.important p.admonition-title { + background-color: #f8b862; + border-bottom: none; + color: {{ theme_darkcolor }}; +} + +div.hint p.admonition-title, div.tip p.admonition-title { + background-color: #7ebea5; + border-bottom: none; + color: {{ theme_darkcolor }}; +} + +div.versioninfo { + border: 1px solid #ccc; + background-color: #DDEAF0; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +p.versionchanged span.versionmodified { + background-color: #DCE6A0; +} + +dl.field-list > dt { + color: {{ theme_maincolor }}; + background-color: transparent; +} + +dl.field-list > dd { + background-color: transparent; +} + +/* -- table styles ---------------------------------------------------------- */ + +table.docutils { + border: 1px solid {{ theme_maincolor }}; + background-color: {{ theme_darkcolor }}; +} + +table.docutils td, table.docutils th { + border-right: 1px solid {{ theme_maincolor }}; + border-bottom: 1px solid {{ theme_maincolor }}; +} + +th { + color: {{ theme_darkcolor }}; + background-color: {{ theme_maincolor }}; +} + +div.literal-block-wrapper div.code-block-caption { + background-color: transparent; + border: none; + padding: 0 !important; +} + +div.literal-block-wrapper div.code-block-caption span.caption-text { + background-color: #202020; + padding: 2px 5px; + border: 0; + border-left: 5px; + border-style: solid; + border-color: {{ theme_darkercolor }}; +} diff --git a/miaowware_sphinx_theme/miaowware/theme.conf b/miaowware_sphinx_theme/miaowware/theme.conf new file mode 100644 index 0000000..86445f6 --- /dev/null +++ b/miaowware_sphinx_theme/miaowware/theme.conf @@ -0,0 +1,11 @@ +[theme] +inherit = bizstyle +stylesheet = miaowware.css +pygments_style = native + +[options] +base_site = https://www.miaow.io +base_site_title = MiaowWare +maincolor = #d0bcff +darkcolor = #1d2a35 +darkercolor = #121a21 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1b3a6e8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +sphinx \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2d24688 --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +import pathlib +from setuptools import setup +import miaowware_sphinx_theme.__info__ as info + +# The directory containing this file +HERE = pathlib.Path(__file__).parent + +# The text of the README file +README = (HERE / "README.md").read_text() + +setup( + name=info.__project__, + version=info.__version__, + description=info.__summary__, + long_description=README, + long_description_content_type="text/markdown", + url=info.__webpage__, + author=info.__author__, + author_email=info.__email__, + license=info.__license__, + classifiers=[ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Topic :: Internet", + "Topic :: Software Development :: Documentation", + "Framework :: Sphinx :: Theme" + ], + packages=["miaowware_sphinx_theme"], + package_data={ + "miaowware_sphinx_theme": ["py.typed"] + }, + install_requires=["sphinx>=1.6.0"], + entry_points={ + "sphinx.html_themes": [ + "miaowware = miaowware_sphinx_theme", + ] + }, +)