Skip to content

Use Furo theme for documentation #12348

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 6 commits into from
Mar 24, 2022
Merged
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: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
paths:
- 'docs/**'
- 'mypyc/doc/**'
- '**/*.rst'
- '**/*.md'
- CREDITS
Expand All @@ -21,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.10'
- name: Install tox
run: pip install --upgrade 'setuptools!=50' 'virtualenv>=20.6.0' tox==3.24.5
- name: Setup tox environment
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
paths-ignore:
- 'docs/**'
- 'mypyc/doc/**'
- '**/*.rst'
- '**/*.md'
- .gitignore
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx>=4.2.0,<5.0.0
sphinx-rtd-theme>=1.0.0,<2.0.0
furo>=2022.3.4
16 changes: 5 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
master_doc = 'index'

# General information about the project.
project = u'Mypy'
copyright = u'2016, Jukka Lehtosalo'
project = u'mypy'
copyright = u'2012-2022 Jukka Lehtosalo and mypy contributors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -103,13 +103,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
try:
import sphinx_rtd_theme
except:
html_theme = 'default'
else:
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "furo"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -128,7 +122,7 @@

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
html_logo = "http://mypy-lang.org/static/mypy_light.svg"

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand Down Expand Up @@ -187,7 +181,7 @@
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'Mypydoc'
htmlhelp_basename = 'mypydoc'


# -- Options for LaTeX output ---------------------------------------------
Expand Down
41 changes: 39 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,43 @@
Welcome to mypy documentation!
==============================

Mypy is a static type checker for Python 3 and Python 2.7.
Mypy is a static type checker for Python 3 and Python 2.7. If you sprinkle
your code with type annotations, mypy can type check your code and find common
bugs. As mypy is a static analyzer, or a lint-like tool, the type
annotations are just hints for mypy and don't interfere when running your program.
You run your program with a standard Python interpreter, and the annotations
are treated effectively as comments.

Using the Python 3 annotation syntax (using :pep:`484` and :pep:`526` notation)
or a comment-based annotation syntax for Python 2 code, you will be able to
efficiently annotate your code and use mypy to check the code for common errors.
Mypy has a powerful and easy-to-use type system with modern features such as
type inference, generics, callable types, tuple types, union types, and
structural subtyping.

As a developer, you decide how to use mypy in your workflow. You can always
escape to dynamic typing as mypy's approach to static typing doesn't restrict
what you can do in your programs. Using mypy will make your programs easier to
understand, debug, and maintain.

This documentation provides a short introduction to mypy. It will help you
get started writing statically typed code. Knowledge of Python and a
statically typed object-oriented language, such as Java, are assumed.

.. note::

Mypy is used in production by many companies and projects, but mypy is
officially beta software. There will be occasional changes
that break backward compatibility. The mypy development team tries to
minimize the impact of changes to user code.

Contents
--------

.. toctree::
:maxdepth: 2
:caption: First steps

introduction
getting_started
existing_code

Expand Down Expand Up @@ -74,6 +104,13 @@ Mypy is a static type checker for Python 3 and Python 2.7.
additional_features
faq

.. toctree::
:hidden:
:caption: Project Links

GitHub <https://github.com/python/mypy>
Website <http://mypy-lang.org/>

Indices and tables
==================

Expand Down
32 changes: 0 additions & 32 deletions docs/source/introduction.rst

This file was deleted.

10 changes: 2 additions & 8 deletions mypyc/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# -- Project information -----------------------------------------------------

project = 'mypyc'
copyright = '2020, mypyc team'
copyright = '2020-2022, mypyc team'
author = 'mypyc team'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -50,13 +50,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
try:
import sphinx_rtd_theme # type: ignore
except:
html_theme = 'default'
else:
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = 'furo'

# 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,
Expand Down
6 changes: 6 additions & 0 deletions mypyc/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ generate fast code.

performance_tips_and_tricks

.. toctree::
:hidden:
:caption: Project Links

GitHub <https://github.com/python/mypy>

Indices and tables
==================

Expand Down