Skip to content

Commit

Permalink
Merge pull request #1 from miaowware/theme
Browse files Browse the repository at this point in the history
add theme
  • Loading branch information
classabbyamp authored Dec 20, 2020
2 parents 762a830 + 3e16b6d commit 3288bbc
Show file tree
Hide file tree
Showing 18 changed files with 420 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,29 @@ 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

Copyright 2020 classabbyamp, 0x5c
Released under the BSD 3-Clause License.
See [`LICENSE`](LICENSE) for the full license text.

## Screenshots

![Theme Screenshot](example.png)
3 changes: 3 additions & 0 deletions devrequirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r requirements.txt
flake8
mypy
Binary file added example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions miaowware_sphinx_theme/__info__.py
Original file line number Diff line number Diff line change
@@ -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__ = "[email protected], [email protected]"

__license__ = "BSD 3-Clause"
14 changes: 14 additions & 0 deletions miaowware_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -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"))
38 changes: 38 additions & 0 deletions miaowware_sphinx_theme/miaowware/layout.html
Original file line number Diff line number Diff line change
@@ -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() }}
<link rel="shortcut icon" type="image/x-icon" href="{{ pathto('_static/favicon/favicon.ico', 1) }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ pathto('_static/favicon/apple-touch-icon.png', 1) }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ pathto('_static/favicon/favicon-32x32.png', 1) }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ pathto('_static/favicon/favicon-16x16.png', 1) }}">
<link rel="manifest" href="{{ pathto('_static/favicon/site.webmanifest', 1) }}">
{%- endblock %}

{%- block rootrellink %}
{%- if theme_base_site %}
<li class="nav-item nav-item-base"><a href="{{ theme_base_site|e }}">{{ theme_base_site_title|e }}</a>{{ reldelim1 }}</li>
{%- endif %}
{{ super() }}
{%- endblock %}

{%- block sidebarlogo %}
{%- if logo %}
<p class="logo">
{%- if theme_base_site %}
<a href="{{ theme_base_site|e }}">
{%- else %}
<a href="{{ pathto(master_doc)|e }}">
{%- endif %}
<img class="logo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
</a>
</p>
{%- endif %}
{%- endblock %}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -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"}
257 changes: 257 additions & 0 deletions miaowware_sphinx_theme/miaowware/static/miaowware.css_t
Original file line number Diff line number Diff line change
@@ -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 }};
}
11 changes: 11 additions & 0 deletions miaowware_sphinx_theme/miaowware/theme.conf
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx
Loading

0 comments on commit 3288bbc

Please sign in to comment.