ソースを参照

docs: update docs style

Mikael Koli 3 年 前
コミット
0623562893
4 ファイル変更76 行追加12 行削除
  1. 38 3
      docs/conf.py
  2. 28 0
      docs/header.html
  3. 10 9
      docs/index.rst
  4. BIN
      docs/logo.png

+ 38 - 3
docs/conf.py

@@ -10,7 +10,6 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
-import sphinx_book_theme
 import os
 import sys
 sys.path.insert(0, os.path.abspath('..'))
@@ -33,7 +32,6 @@ extensions = [
     'sphinx.ext.autodoc', 
     'sphinx.ext.coverage', 
     'sphinx.ext.napoleon',
-    'sphinx_book_theme',
     'sphinx.ext.extlinks',
     'sphinx_copybutton',
 ]
@@ -79,7 +77,7 @@ html_theme_options = {
 # a list of builtin themes.
 #
 html_title = "Red Mail"
-html_theme = 'sphinx_book_theme'
+html_theme = 'sphinx_material'
 html_favicon = 'favicon.ico'
 
 # Add any paths that contain custom static files (such as style sheets) here,
@@ -92,6 +90,43 @@ html_css_files = [
     'css/colors.css',
 ]
 
+html_sidebars = {
+    "**": [
+        "logo-text.html",
+        "globaltoc.html",
+        "localtoc.html",
+        "searchbox.html"
+    ]
+}
+
+html_theme_options = {
+    'nav_title': 'Red Box',
+
+    'color_primary': 'red',
+    'color_accent': 'grey',
+
+    'repo_url': 'https://github.com/Miksus/red-mail/',
+    'repo_name': 'Red Mail',
+    "repo_type": "github",
+
+    # Visible levels of the global TOC; -1 means unlimited
+    'globaltoc_depth': 3,
+    # If False, expand all TOC entries
+    'globaltoc_collapse': True,
+    # If True, show hidden TOC entries
+    'globaltoc_includehidden': False,
+
+    "html_minify": False,
+    "html_prettify": False,
+    "css_minify": True,
+
+    "heroes": {
+        "index": "Advanced email sending library.",
+    },
+    "nav_links": [
+    ],
+}
+
 # Cross references
 extlinks = {
     "stdlib": ("https://docs.python.org/3/library/%s", None)

+ 28 - 0
docs/header.html

@@ -0,0 +1,28 @@
+
+ <div>
+    
+    <p style="text-align: center;">
+        <img src="_static/logo.png" alt="Redbox logo">
+    </p>
+    
+    <h1 style="text-align: center;"><a href="https://red-mail.readthedocs.io">Red Mail</a></h1>
+
+    <div style="text-align: center;">
+        <a href="https://github.com/Miksus/red-mail/actions/workflows/main.yml/badge.svg?branch=master" target="_blank">
+            <img src="https://github.com/Miksus/red-mail/actions/workflows/main.yml/badge.svg?branch=master" alt="Test">
+        </a>
+        <a href="https://codecov.io/gh/Miksus/red-mail" target="_blank">
+            <img src="https://codecov.io/gh/Miksus/red-mail/branch/master/graph/badge.svg?token=U2KF1QA5HT" alt="Test coverage">
+        </a>
+        <a href="https://pypi.org/project/redmail" target="_blank">
+            <img src="https://badgen.net/pypi/v/redmail?color=969696" alt="Package version">
+        </a>
+        <a href="https://pypi.org/project/redmail" target="_blank">
+            <img src="https://badgen.net/pypi/python/redmail?color=969696&labelColor=red" alt="Supported Python versions">
+        </a>
+    </div>
+    <div style="text-align: center;">
+        <iframe src="https://github.com/sponsors/Miksus/button" title="Sponsor Miksus" height="35" width="116" style="border: 0;"></iframe>
+    </div>
+</div>
+   <hr>

+ 10 - 9
docs/index.rst

@@ -3,14 +3,14 @@
    :description: Red Mail is an advanced email sender for Python. It is open source and well tested.
    :keywords: send, email, Python
 
-:red:`Red` Mail: Send Emails in Python
-=============================================
+.. raw:: html
+   :file: header.html
 
-.. image:: https://badgen.net/pypi/v/redmail
-   :target: https://pypi.org/project/redmail/
+- `Documentation <https://redbox.readthedocs.io/>`_
+- `Source code (Github) <https://github.com/Miksus/redbox>`_
+- `Releases (PyPI) <https://pypi.org/project/redbox/>`_
 
-.. image:: https://badgen.net/pypi/python/redmail
-   :target: https://pypi.org/project/redmail/
+This is a sister library for `Red Box, advanced email reader <https://red-box.readthedocs.io/>`_.
 
 Red Mail is a Python library for sending emails. 
 It makes sending emails very trivial regardless of whether 
@@ -27,9 +27,10 @@ Why Red Mail?
 -------------
 
 Sending emails is a pretty straight forward task.
-However, the standard SMTP libraries don't make 
-it particularly easy and sending emails **SHOULD NOT** 
-look like this:
+However, the SMTP and email libraries from the standard library 
+don't make it particularly easy. 
+
+Sending emails **SHOULD NOT** look like this:
 
 .. code-block:: python
 

BIN
docs/logo.png