Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions docs/source/_static/navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.bd-header .bd-navbar-elements .nav-link {
white-space: nowrap;
}
27 changes: 25 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# 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 glob
import os
import shutil
Expand All @@ -27,9 +29,11 @@
import pytorch_sphinx_theme2 # type: ignore[import-not-found]

# To let us import ./custom_directives.py

sys.path.insert(0, os.path.abspath("."))
# -- Project information -----------------------------------------------------


project = "ExecuTorch"
copyright = "2024, ExecuTorch"
author = "ExecuTorch Contributors"
Expand All @@ -41,6 +45,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.


import os
import sys

Expand Down Expand Up @@ -78,34 +83,39 @@

# Import executorch version
# Adopted from PyTorch docs pattern

from executorch import version as et_version # type: ignore[attr-defined]

executorch_version = str(et_version.__version__)

# Check if this is a release build from environment variable
# The workflow sets RELEASE=true for tagged releases, RELEASE=false otherwise
# We need to properly parse the string as a boolean (any non-empty string is truthy in Python)

RELEASE = os.environ.get("RELEASE", "false").lower() == "true"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.

version = "main"
# The full version, including alpha/beta/rc tags.

release = "main"

# Customized html_title here.
# Default is " ".join(project, release, "documentation") if not set

if RELEASE:
# Turn 0.8.0a0+a90e907 into 0.8
# Note: the release candidates should no longer have the aHASH suffix, but in any
# case we wish to leave only major.minor, even for rc builds.

version = ".".join(executorch_version.split("+")[0].split(".")[:2])
html_title = " ".join((project, version, "documentation"))
release = version

switcher_version = "main" if not RELEASE else version

print(f"executorch_version: {executorch_version}")
Expand Down Expand Up @@ -153,13 +163,14 @@
source_dir = sphinx_gallery_conf["examples_dirs"][i]

# Create gallery dirs if it doesn't exist

os.makedirs(gallery_dir, exist_ok=True)

# Copy .md files from source dir to gallery dir

for f in glob.glob(os.path.join(source_dir, "*.md")):

shutil.copyfile(f, gallery_dir)

source_suffix = [".rst", ".md"]


Expand All @@ -171,20 +182,24 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "tutorial-template.md"]
exclude_patterns += sphinx_gallery_conf["examples_dirs"]
exclude_patterns += ["*/index.rst"]

# autosectionlabel throws warnings if section names are duplicated.
# The following tells autosectionlabel to not throw a warning for
# duplicated section names that are in different documents.

autosectionlabel_prefix_document = True

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#


html_theme = "pytorch_sphinx_theme2"
html_theme_path = [pytorch_sphinx_theme2.get_html_theme_path()]

Expand All @@ -193,6 +208,7 @@
# documentation.
#


html_theme_options = {
"logo": {
"image_light": "_static/img/et-logo.png",
Expand Down Expand Up @@ -262,20 +278,26 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".

html_static_path = ["_static"]

html_css_files = ["navbar.css"]

# Add custom 404 page for GitHub Pages

html_additional_pages = {"404": "404.html"}


# Example configuration for intersphinx: refer to the Python standard library.

intersphinx_mapping = {
"python": ("https://docs.python.org/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"torch": ("https://docs.pytorch.org/docs/stable/", None),
}

# Redirects for moved pages

redirects = {
"getting-started-setup": "getting-started.html",
"export-overview": "using-executorch-export.html",
Expand Down Expand Up @@ -304,6 +326,7 @@

# Custom directives defintions to create cards on main landing page


from custom_directives import ( # type: ignore[import-not-found]
CustomCardEnd,
CustomCardItem,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user-pathways.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(user-pathways)=
# Find Your Path in ExecuTorch
# Find Your Path

**ExecuTorch** serves a wide range of users — from ML engineers taking their first steps in on-device inference, to embedded systems developers targeting bare-metal microcontrollers, to researchers pushing the boundaries of LLM deployment. This page helps you navigate directly to the content most relevant to your experience level, goals, and target platform.

Expand Down
Loading