diff --git a/docs/Makefile b/docs/Makefile index c2cf05dc0e4..e8b712ce8a1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -18,6 +18,7 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" + @echo " livehtml to make standalone HTML files via sphinx-autobuild" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @@ -54,6 +55,10 @@ html: @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." +.PHONY: livehtml +livehtml: + sphinx-autobuild --port 0 -B -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + .PHONY: dirhtml dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml diff --git a/docs/source/_static/favicon.ico b/docs/source/_static/favicon.ico new file mode 100644 index 00000000000..6d12158c18b Binary files /dev/null and b/docs/source/_static/favicon.ico differ diff --git a/docs/source/_static/logo-apple.png b/docs/source/_static/logo-apple.png new file mode 100644 index 00000000000..20117d00f22 Binary files /dev/null and b/docs/source/_static/logo-apple.png differ diff --git a/docs/source/_static/logo.png b/docs/source/_static/logo.png new file mode 100644 index 00000000000..2959efdf89d Binary files /dev/null and b/docs/source/_static/logo.png differ diff --git a/docs/source/conf.py b/docs/source/conf.py index b9f5f225672..4ca74060aad 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,6 +21,13 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) +from homeassistant.const import (__version__, __short_version__, PROJECT_NAME, + PROJECT_LONG_DESCRIPTION, PROJECT_URL, + PROJECT_COPYRIGHT, PROJECT_AUTHOR, + PROJECT_GITHUB_USERNAME, + PROJECT_GITHUB_REPOSITORY, PYPI_URL, + GITHUB_URL) + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -53,18 +60,18 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = 'Home Assistant' -copyright = '2016, Home Assistant Team' -author = 'Home Assistant Team' +project = PROJECT_NAME +copyright = PROJECT_COPYRIGHT +author = PROJECT_AUTHOR # 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 = '0.27' +version = __short_version__ # The full version, including alpha/beta/rc tags. -release = '0.27.0' +release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -124,13 +131,31 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -# html_theme = 'alabaster' +html_theme = 'alabaster' # 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 # documentation. # -# html_theme_options = {} +html_theme_options = { + 'logo': 'logo.png', + 'logo_name': PROJECT_NAME, + 'description': PROJECT_LONG_DESCRIPTION, + 'github_user': PROJECT_GITHUB_USERNAME, + 'github_repo': PROJECT_GITHUB_REPOSITORY, + 'github_type': 'star', + 'github_banner': True, + 'travis_button': True, + 'touch_icon': 'logo-apple.png', + # 'fixed_sidebar': True, # Re-enable when we have more content + 'extra_nav_links': { + '🏡 Homepage': PROJECT_URL, + '📌 Community Forums': 'https://community.home-assistant.io', + '💬 Gitter': 'https://gitter.im/home-assistant/home-assistant', + '🚀 GitHub': GITHUB_URL, + '💾 Download Releases': PYPI_URL, + } +} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] @@ -147,13 +172,14 @@ todo_include_todos = False # The name of an image file (relative to this directory) to place at the top # of the sidebar. # -# html_logo = None +# html_logo = '_static/logo.png' # The name of an image file (relative to this directory) to use as a favicon of -# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# the docs. +# This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # -# html_favicon = None +html_favicon = '_static/favicon.ico' # 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, @@ -170,16 +196,23 @@ html_static_path = ['_static'] # bottom, using the given strftime format. # The empty string is equivalent to '%b %d, %Y'. # -# html_last_updated_fmt = None +html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # -# html_use_smartypants = True +html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # -# html_sidebars = {} +html_sidebars = { + '**': [ + 'about.html', + 'navigation.html', + 'relations.html', + 'searchbox.html', + ] +} # Additional templates that should be rendered to pages, maps page names to # template names. diff --git a/homeassistant/const.py b/homeassistant/const.py index a07316711d1..c367792852a 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,9 +1,42 @@ # coding: utf-8 """Constants used by Home Assistant components.""" - -__version__ = '0.28.0.dev0' +MAJOR_VERSION = 0 +MINOR_VERSION = 28 +PATCH_VERSION = '0.dev0' +__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) +__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4) +PROJECT_NAME = 'Home Assistant' +PROJECT_PACKAGE_NAME = 'homeassistant' +PROJECT_LICENSE = 'MIT License' +PROJECT_AUTHOR = 'The Home Assistant Authors' +PROJECT_COPYRIGHT = '2016, {}'.format(PROJECT_AUTHOR) +PROJECT_URL = 'https://home-assistant.io/' +PROJECT_EMAIL = 'hello@home-assistant.io' +PROJECT_DESCRIPTION = ('Open-source home automation platform ' + 'running on Python 3.') +PROJECT_LONG_DESCRIPTION = ('Home Assistant is an open-source ' + 'home automation platform running on Python 3. ' + 'Track and control all devices at home and ' + 'automate control. ' + 'Installation in less than a minute.') +PROJECT_CLASSIFIERS = [ + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3.4', + 'Topic :: Home Automation' +] + +PROJECT_GITHUB_USERNAME = 'home-assistant' +PROJECT_GITHUB_REPOSITORY = 'home-assistant' + +PYPI_URL = 'https://pypi.python.org/pypi/{}'.format(PROJECT_PACKAGE_NAME) +GITHUB_URL = 'https://github.com/{}/{}'.format(PROJECT_GITHUB_USERNAME, + PROJECT_GITHUB_REPOSITORY) + PLATFORM_FORMAT = '{}.{}' # Can be used to specify a catch all when registering state or event listeners. diff --git a/setup.py b/setup.py index caa5b177b5c..67366bd7d83 100755 --- a/setup.py +++ b/setup.py @@ -1,12 +1,15 @@ #!/usr/bin/env python3 import os from setuptools import setup, find_packages -from homeassistant.const import __version__ +from homeassistant.const import (__version__, PROJECT_PACKAGE_NAME, + PROJECT_LICENSE, PROJECT_URL, + PROJECT_EMAIL, PROJECT_DESCRIPTION, + PROJECT_CLASSIFIERS, GITHUB_URL, + PROJECT_AUTHOR) -PACKAGE_NAME = 'homeassistant' HERE = os.path.abspath(os.path.dirname(__file__)) -DOWNLOAD_URL = ('https://github.com/home-assistant/home-assistant/archive/' - '{}.zip'.format(__version__)) +DOWNLOAD_URL = ('{}/archive/' + '{}.zip'.format(GITHUB_URL, __version__)) PACKAGES = find_packages(exclude=['tests', 'tests.*']) @@ -21,14 +24,14 @@ REQUIRES = [ ] setup( - name=PACKAGE_NAME, + name=PROJECT_PACKAGE_NAME, version=__version__, - license='MIT License', - url='https://home-assistant.io/', + license=PROJECT_LICENSE, + url=PROJECT_URL, download_url=DOWNLOAD_URL, - author='Home Assistant', - author_email='hello@home-assistant.io', - description='Open-source home automation platform running on Python 3.', + author=PROJECT_AUTHOR, + author_email=PROJECT_EMAIL, + description=PROJECT_DESCRIPTION, packages=PACKAGES, include_package_data=True, zip_safe=False, @@ -41,12 +44,5 @@ setup( 'hass = homeassistant.__main__:main' ] }, - classifiers=[ - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3.4', - 'Topic :: Home Automation' - ], + classifiers=PROJECT_CLASSIFIERS, )