diff --git a/docs/source/index.rst b/docs/source/index.rst index e833b72cdfdd..c9ee1ce1f9ad 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,7 +3,7 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to Mypy documentation! +Welcome to mypy documentation! ============================== Mypy is a static type checker for Python 3 and Python 2.7. diff --git a/mypyc/doc/conf.py b/mypyc/doc/conf.py index 305af1f2cecf..e28c2cc45040 100644 --- a/mypyc/doc/conf.py +++ b/mypyc/doc/conf.py @@ -4,16 +4,15 @@ # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html -# -- Path setup -------------------------------------------------------------- +import sys +import os # If extensions (or modules to document with autodoc) are in another directory, # 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 os -# import sys -# sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('../..')) +from mypy.version import __version__ as mypy_version # -- Project information ----------------------------------------------------- @@ -21,6 +20,14 @@ copyright = '2020, mypyc team' author = 'mypyc team' +# 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 = mypy_version.split('-')[0] +# The full version, including alpha/beta/rc tags. +release = mypy_version # -- General configuration --------------------------------------------------- diff --git a/mypyc/doc/index.rst b/mypyc/doc/index.rst index ea38714fb883..7098c03946d6 100644 --- a/mypyc/doc/index.rst +++ b/mypyc/doc/index.rst @@ -3,20 +3,34 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to mypyc's documentation! -================================= +Welcome to mypyc documentation! +=============================== + +Mypyc compiles Python modules to C extensions. It uses standard Python +`type hints +`_ to +generate fast code. .. toctree:: :maxdepth: 2 - :caption: Contents: + :caption: First steps introduction getting_started + +.. toctree:: + :maxdepth: 2 + :caption: Using mypyc + using_type_annotations native_classes differences_from_python compilation_units +.. toctree:: + :maxdepth: 2 + :caption: Native operations reference + native_operations int_operations bool_operations @@ -27,6 +41,10 @@ Welcome to mypyc's documentation! set_operations tuple_operations +.. toctree:: + :maxdepth: 2 + :caption: Advanced topics + performance_tips_and_tricks Indices and tables diff --git a/mypyc/doc/introduction.rst b/mypyc/doc/introduction.rst index 84317ef51555..a0579ec2a2a0 100644 --- a/mypyc/doc/introduction.rst +++ b/mypyc/doc/introduction.rst @@ -26,7 +26,7 @@ runtime): * Existing code with type annotations often gets **1.5x to 5x** faster. -* Code tuned for mypyc can be **5x to 15x** faster. +* Code tuned for mypyc can be **5x to 10x** faster. There is no simple answer to how fast your code will be when compiled. You should try it out!