Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
using latest updates from sphinx-immaterial theme
  • Loading branch information
2bndy5 committed Oct 26, 2022
1 parent af01f3b commit cd8f45e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 30 deletions.
23 changes: 10 additions & 13 deletions docs/_static/extra_css.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

.viewcode-block .viewcode-back {
float: right;
}

code.literal.homie-attr::before {
content: "$";
}
Expand All @@ -27,21 +23,22 @@ code.literal.homie-prop {

*:root {
--md-admonition-seealso-color: hsl(278, 100%, 63%);
--md-admonition-icon--seealso: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>');
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M5 13.18v2.81c0 .73.4 1.41 1.04 1.76l5 2.73c.6.33 1.32.33 1.92 0l5-2.73c.64-.35 1.04-1.03 1.04-1.76v-2.81l-6.04 3.3c-.6.33-1.32.33-1.92 0L5 13.18zm6.04-9.66l-8.43 4.6c-.69.38-.69 1.38 0 1.76l8.43 4.6c.6.33 1.32.33 1.92 0L21 10.09V16c0 .55.45 1 1 1s1-.45 1-1V9.59c0-.37-.2-.7-.52-.88l-9.52-5.19c-.6-.32-1.32-.32-1.92 0z"/></svg>');
}

.admonition.seealso .admonition-title {
background-color: hsla(278, 100%, 63%, 0.1);

.md-typeset .admonition.seealso>.admonition-title::before {
/* svg data from octicons/eye-24 */
mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.5 12a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0z"/><path fill-rule="evenodd" d="M12 3.5c-3.432 0-6.125 1.534-8.054 3.24C2.02 8.445.814 10.352.33 11.202a1.6 1.6 0 0 0 0 1.598c.484.85 1.69 2.758 3.616 4.46C5.876 18.966 8.568 20.5 12 20.5c3.432 0 6.125-1.534 8.054-3.24 1.926-1.704 3.132-3.611 3.616-4.461a1.6 1.6 0 0 0 0-1.598c-.484-.85-1.69-2.757-3.616-4.46C18.124 5.034 15.432 3.5 12 3.5zM1.633 11.945c.441-.774 1.551-2.528 3.307-4.08C6.69 6.314 9.045 5 12 5c2.955 0 5.309 1.315 7.06 2.864 1.756 1.553 2.866 3.307 3.307 4.08a.111.111 0 0 1 .017.056.111.111 0 0 1-.017.056c-.441.774-1.551 2.527-3.307 4.08C17.31 17.685 14.955 19 12 19c-2.955 0-5.309-1.315-7.06-2.864-1.756-1.553-2.866-3.306-3.307-4.08A.11.11 0 0 1 1.616 12a.11.11 0 0 1 .017-.055z"/></svg>');
background-color: var(--md-admonition-seealso-color);
}

.admonition.seealso {
border: 0 solid var(--md-admonition-seealso-color);
.md-typeset :is(.admonition):is(.seealso) {
border-color: var(--md-admonition-seealso-color);
}

.md-typeset .admonition.seealso :is(.admonition-title, summary)::before {
background-color: var(--md-admonition-seealso-color);
mask-image: var(--md-admonition-icon--seealso);
.md-typeset :is(.seealso)> :is(.admonition-title) {
background-color: hsla(287, 100%, 63%, 0.1);
border-color: var(--md-admonition-seealso-color);
}

[data-md-color-scheme="default"] img.only-dark {
Expand Down
38 changes: 30 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
"repo_type": "Github",
"icon": {
"repo": "fontawesome/brands/github",
"admonition": {
"note": "material/note-edit-outline",
"tip": "material/school",
"warning": "octicons/alert-16",
},
},
"features": [
"navigation.tabs",
Expand Down Expand Up @@ -160,14 +165,31 @@
],
"toc_title_is_page_title": True,
"social": [
dict(
icon="fontawesome/brands/github",
link="https://github.com/2bndy5/CircuitPython_Homie",
),
dict(
icon="fontawesome/brands/python",
link="https://pypi.org/project/circuitpython-homie/",
),
{
"icon": "fontawesome/brands/github",
"link": "https://github.com/2bndy5/CircuitPython_Homie",
},
{
"icon": "fontawesome/brands/python",
"link": "https://pypi.org/project/circuitpython-homie/",
},
{
"icon": "fontawesome/brands/discord",
"link": "https://adafru.it/discord",
},
{
"icon": "simple/adafruit",
"link": "https://www.adafruit.com/",
},
{
"icon": "simple/sparkfun",
"link": "https://www.sparkfun.com/",
},
{
"name": "CircuitPython Downloads",
"icon": "octicons/download-24",
"link": "https://circuitpython.org",
},
],
}

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/mosquitto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ The Mosquitto broker uses a password file to store these values securely.
The above command creates a password file named ``pswd.txt`` for a user named ``username``.

.. details:: Adding another user
:class: info
:class: check

Use the ``-b`` switch to add more users:

.. code-block:: shell
mosquitto_passwd -b pswd.txt other_username user_password
.. details:: Removing a user
:class: error
:class: fail

Use the ``-D`` switch to remove a user:

Expand Down
15 changes: 8 additions & 7 deletions docs/tutorials/openhab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ Building off `OpenHAB's "Add a Thing - Simple (Install the Binding)" instruction
|click| the :homie-val:`show <n> more` button at the bottom of the OpenHAB Distribution list if
you don't see the `MQTT binding`_.

.. admonition:: Notice
:class: example
.. note::

The `MQTT binding`_ is one of the official OpenHAB addons. It is not a Community addon.

Expand Down Expand Up @@ -188,11 +187,13 @@ Once you have finished :ref:`add_broker_as_thing`, you are now ready to start us
discovery of |homie-dev|\ s. This section should be repeated for any instantiated `HomieDevice`
object.

.. note::
Once completed, there is no need to repeat these steps again for the same `HomieDevice` object
unless you have changed the ``device_id`` parameter to the `HomieDevice` constructor. Connecting
& disconnecting a |homie-dev| that are already added as |oh-thing|\ s should be automatically
handled by the OpenHAB `MQTT Homie binding`_.
.. admonition:: Only do this once
:class: check

Once completed, there is no need to repeat these steps again for the same `HomieDevice` object
unless you have changed the ``device_id`` parameter to the `HomieDevice` constructor. Connecting
& disconnecting a |homie-dev| that are already added as |oh-thing|\ s should be automatically
handled by the OpenHAB `MQTT Homie binding`_.

First lets get a library example running on a circuitPython enabled board (with WiFi support).
See the :doc:`../examples` to understand how to run a library example. For this tutorial, we'll be
Expand Down

0 comments on commit cd8f45e

Please sign in to comment.