Skip to content

Commit

Permalink
Merge pull request #58 from Miksus/docs/update_style
Browse files Browse the repository at this point in the history
DOCS: Update style
  • Loading branch information
Miksus authored Oct 1, 2022
2 parents 2c70ae1 + 4edd37b commit dcd7ae6
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 27 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@


## What is it?
Red Mail is an advanced email sender library. It makes sending emails trivial and
has a lot of advanced features such as:
Red Mail is an advanced email sender library.
It is a sister library for [Red Box, advanced email reader](https://github.com/Miksus/red-box).
It makes sending emails trivial and has a lot of advanced features such as:

- [Attachments](https://red-mail.readthedocs.io/en/latest/tutorials/attachments.html)
- [Templating (with Jinja)](https://red-mail.readthedocs.io/en/latest/tutorials/jinja_support.html)
Expand Down
41 changes: 38 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('..'))
Expand All @@ -33,7 +32,6 @@
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinx_book_theme',
'sphinx.ext.extlinks',
'sphinx_copybutton',
]
Expand Down Expand Up @@ -79,7 +77,7 @@
# 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,
Expand All @@ -92,6 +90,43 @@
'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)
Expand Down
28 changes: 28 additions & 0 deletions docs/header.html
Original file line number Diff line number Diff line change
@@ -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>
19 changes: 10 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Binary file modified docs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions docs/tutorials/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ which is configured as this:
from smtplib import SMTP
email = EmailSender(
host="smtp.myhost.com",
port=0,
host="smtp.example.com",
port=587,
cls_smtp=SMTP,
use_starttls=True
)
Expand All @@ -46,8 +46,8 @@ You may also continue using TLS:
from redmail import EmailSender
email = EmailSender(
host="smtp.myhost.com",
port=0,
host="smtp.example.com",
port=587,
use_starttls=False
)
Expand All @@ -63,8 +63,8 @@ To use SSL:
from smtplib import SMTP_SSL
email = EmailSender(
host="smtp.myhost.com",
port=0,
host="smtp.example.com",
port=587,
cls_smtp=SMTP_SSL,
)
Expand All @@ -77,8 +77,8 @@ You may also pass the SSL context:
from ssl import SSLContext
email = EmailSender(
host="smtp.myhost.com",
port=0,
host="smtp.example.com",
port=587,
cls_smtp=SMTP_SSL,
context=SSLContext(...)
)
Expand All @@ -94,8 +94,8 @@ To use LMTP:
from smtplib import LMTP
email = EmailSender(
host="smtp.myhost.com",
port=0,
host="smtp.example.com",
port=587,
cls_smtp=LMTP
)
6 changes: 6 additions & 0 deletions docs/tutorials/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Install the package from `Pypi <https://pypi.org/project/redmail/>`_:
pip install redmail
Or install the package using Conda:

.. code-block:: console
conda install -c conda-forge redmail
.. _configure:

Configuring Email
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See:
- :ref:`This to send using HTML templates (Jinja) <templating>`
- :ref:`This to configure Red Mail to various SMTP providers (ie. Gmail) <templating>`

And see - :ref:`cookbook <cookbook>` for example use cases.
And see :ref:`cookbook <cookbook>` for example use cases.

.. toctree::
:maxdepth: 1
Expand Down
9 changes: 9 additions & 0 deletions docs/versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
Version history
===============

- ``0.4.2``

- Docs: Changed docs style.

- ``0.4.1``

- Add: Mypy stubs (thanks Waghabond!)
- Docs: Improved embedded content page.

- ``0.4.0``

- Rename: Changed ``user_name`` to ``username`` in ``redmail.EmailSender``. ``user_name`` still works but issues a warning.
Expand Down
5 changes: 3 additions & 2 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx >= 1.7.5
pydata-sphinx-theme
sphinx_book_theme
sphinx-copybutton
sphinx_material
sphinx-copybutton
sphinx_book_theme

0 comments on commit dcd7ae6

Please sign in to comment.