Skip to content

[Docs] New docs theme based on ESP-IDF style #6512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Aug 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 61 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ReadTheDocs CI
name: Docs CI

on:
push:
@@ -16,7 +16,7 @@ on:
jobs:

build-docs:
name: Build ReadTheDocs
name: Build Docs
runs-on: ubuntu-latest
defaults:
run:
@@ -35,4 +35,62 @@ jobs:
# GitHub CI installs pip3 and setuptools outside the path.
# Update the path to include them and run.
PATH=/home/runner/.local/bin:$PATH pip3 install --user -r ./docs/requirements.txt
cd ./docs && PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" make html
cd ./docs && PATH=/home/runner/.local/bin:$PATH build-docs -l en

deploy-docs:
name: Deploy Docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Deploy Production
env:
DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PROD_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PROD_SERVER_USER }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
run: |
PATH=/home/runner/.local/bin:$PATH pip install -r ./docs/requirements.txt --prefer-binary
PATH=/home/runner/.local/bin:$PATH source ./docs/utils.sh
PATH=/home/runner/.local/bin:$PATH add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
PATH=/home/runner/.local/bin:$PATH export GIT_VER=$(git describe --always)
cd ./docs && PATH=/home/runner/.local/bin:$PATH build-docs -l en
PATH=/home/runner/.local/bin:$PATH deploy-docs

deploy-preview-docs:
name: Deploy Preview Docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Deploy Preview
env:
DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PREV_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PREV_SERVER_USER }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PREV_PATH }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_PREV_URL }}
run: |
PATH=/home/runner/.local/bin:$PATH pip install -r ./docs/requirements.txt --prefer-binary
PATH=/home/runner/.local/bin:$PATH source ./docs/utils.sh
PATH=/home/runner/.local/bin:$PATH add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
PATH=/home/runner/.local/bin:$PATH export GIT_VER=$(git describe --always)
cd ./docs && PATH=/home/runner/.local/bin:$PATH build-docs -l en
PATH=/home/runner/.local/bin:$PATH deploy-docs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -23,6 +23,8 @@ boards.sloeber.txt
# Ignore docs build (Sphinx)
docs/build
docs/source/_build
docs/__pycache__/
docs/_build/

# Test log files
*.log
28 changes: 0 additions & 28 deletions docs/Makefile

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
26 changes: 26 additions & 0 deletions docs/conf_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from esp_docs.conf_docs import * # noqa: F403,F401

languages = ["en"]

# link roles config
github_repo = "espressif/arduino-esp32"

# context used by sphinx_idf_theme
html_context["github_user"] = "espressif"
html_context["github_repo"] = "arduino-esp32"

html_static_path = ["../_static"]

# Conditional content

extensions += ['sphinx_copybutton',
'sphinx_tabs.tabs',
'esp_docs.esp_extensions.dummy_build_system',
]

ESP32_DOCS = [
"index.rst",
]

# Extra options required by sphinx_idf_theme
project_slug = "arduino-esp32"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/source/api/i2c.rst → docs/en/api/i2c.rst
Original file line number Diff line number Diff line change
@@ -19,15 +19,15 @@ The I2C can be used in two different modes:
* **I2C Master Mode**
* In this mode, the ESP32 generates the clock signal and initiates the communication with the slave device.

.. figure:: ../_static/arduino_i2c_master.png
.. figure:: ../../_static/arduino_i2c_master.png
:align: center
:width: 720
:figclass: align-center

* **I2C Slave Mode**
* The slave mode, the clock is generated by the master device and responds to the master if the destination address is the same as the destination.

.. figure:: ../_static/arduino_i2c_slave.png
.. figure:: ../../_static/arduino_i2c_slave.png
:align: center
:width: 520
:figclass: align-center
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/source/api/wifi.rst → docs/en/api/wifi.rst
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Working as AP
In this mode, the ESP32 is configured as an Access Point (AP) and it's capable of receiving incoming connections from other devices (stations) by providing
a Wi-Fi network.

.. figure:: ../_static/wifi_esp32_ap.png
.. figure:: ../../_static/wifi_esp32_ap.png
:align: center
:width: 520
:figclass: align-center
@@ -33,7 +33,7 @@ Working as STA

The STA mode is used to connect the ESP32 to a Wi-Fi network, provided by an Access Point.

.. figure:: ../_static/wifi_esp32_sta.png
.. figure:: ../../_static/wifi_esp32_sta.png
:align: center
:width: 520
:figclass: align-center
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ No. Name Type [1]_ Function
Pin Layout
----------

.. figure:: ../_static/esp32-c3_devkitM-1_pinlayout.png
.. figure:: ../../_static/esp32-c3_devkitM-1_pinlayout.png
:align: center
:width: 600
:alt: ESP32-C3-DevKitM-1 (click to enlarge)
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ No. Name Type Function
Pin Layout
----------

.. figure:: ../_static/esp32_devkitC_pinlayout.png
.. figure:: ../../_static/esp32_devkitC_pinlayout.png
:align: center
:width: 600
:alt: ESP32-DevKitC-1 (click to enlarge)
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ No. Name Type Function
Pin Layout
----------

.. figure:: ../_static/esp32-s2_saola1_pinlayout.png
.. figure:: ../../_static/esp32-s2_saola1_pinlayout.png
:align: center
:width: 600
:alt: ESP32-S2-Saola-1 (click to enlarge)
4 changes: 2 additions & 2 deletions docs/source/boards/boards.rst → docs/en/boards/boards.rst
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ For each family, we have SoC variants with some differentiation. The differences
The modules use the SoC internally, including the external flash, PSRAM (in some models) and other essential electronic components. Essentially, all
modules from the same family use the same SoC.

.. figure:: ../_static/soc-module.png
.. figure:: ../../_static/soc-module.png
:align: center
:width: 250
:alt: ESP32 SoC and Module (click to enlarge)
@@ -58,7 +58,7 @@ Before buying: Keep in mind that for some "must have" features when choosing the
Espressif
---------

.. figure:: ../_static/logo_espressif.png
.. figure:: ../../_static/logo_espressif.png
:align: center
:width: 250
:alt: Espressif Logo
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions docs/en/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
#
# English Language RTD & Sphinx config file
#
# Uses ../conf_common.py for most non-language-specific settings.

# Importing conf_common adds all the non-language-specific
# parts to this conf module

import datetime

try:
from conf_common import * # noqa: F403,F401
except ImportError:
import os
import sys

sys.path.insert(0, os.path.abspath("../"))
from conf_common import * # noqa: F403,F401

# General information about the project.
project = "Arduino-ESP32"
copyright = "2016 - {}, Espressif Systems (Shanghai) Co., Ltd".format(
datetime.datetime.now().year
)

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = "en"
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/source/getting_started.rst → docs/en/getting_started.rst
Original file line number Diff line number Diff line change
@@ -62,9 +62,9 @@ Supported Operating Systems
| Windows | Linux | macOS |
+-------------------+-------------------+-------------------+

.. |windows-logo| image:: _static/logo_windows.png
.. |linux-logo| image:: _static/logo_linux.png
.. |macos-logo| image:: _static/logo_macos.png
.. |windows-logo| image:: ../_static/logo_windows.png
.. |linux-logo| image:: ../_static/logo_linux.png
.. |macos-logo| image:: ../_static/logo_macos.png

Supported IDEs
---------------------------
@@ -77,8 +77,8 @@ Here is the list of supported IDE for Arduino ESP32 support integration.
| Arduino IDE | PlatformIO |
+-------------------+-------------------+

.. |arduino-logo| image:: _static/logo_arduino.png
.. |pio-logo| image:: _static/logo_pio.png
.. |arduino-logo| image:: ../_static/logo_arduino.png
.. |pio-logo| image:: ../_static/logo_pio.png

See `Installing Guides <installing.html>`_ for more details on how to install the Arduino ESP32 support.

Original file line number Diff line number Diff line change
@@ -309,7 +309,7 @@ After that, you can use the following structure to include the image in the docs

.. code-block::

.. figure:: ../_static/arduino_i2c_master.png
.. figure:: ../../_static/arduino_i2c_master.png
:align: center
:width: 720
:figclass: align-center
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -232,7 +232,7 @@ The USB Mass Storage Class, or USB MSC, is a class used for storage devices, lik
This option can be used to ``Enable`` or ``Disable`` this function at the boot. If this option is ``Enabled``, once the device is connected via USB, one new storage device will appear in the system as a storage drive.
Use this new storage drive to write and read files or to drop a new firmware binary to flash the device.

.. figure:: ../_static/usb_msc_drive.png
.. figure:: ../../_static/usb_msc_drive.png
:align: center
:width: 720
:figclass: align-center
1 change: 0 additions & 1 deletion docs/source/index.rst → docs/en/index.rst
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ Here you will find all the relevant information about the project.

.. toctree::
:maxdepth: 1
:caption: Contents:

Getting Started <getting_started>
Libraries <libraries>
Loading