Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiet480 committed Sep 6, 2016
1 parent 5ec6eaf commit a5faa85
Show file tree
Hide file tree
Showing 11 changed files with 420 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ html:

.PHONY: livehtml
livehtml:
sphinx-autobuild --port 0 -B -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
sphinx-autobuild -z ../homeassistant/ --port 0 -B -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html

.PHONY: dirhtml
dirhtml:
Expand Down
47 changes: 47 additions & 0 deletions docs/source/_ext/edit_on_github.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the
sidebar.
Loosely based on https://github.com/astropy/astropy/pull/347
"""

import os
import warnings


__licence__ = 'BSD (3 clause)'


def get_github_url(app, view, path):
return (
'https://github.com/{project}/{view}/{branch}/{src_path}{path}'.format(
project=app.config.edit_on_github_project,
view=view,
branch=app.config.edit_on_github_branch,
src_path=app.config.edit_on_github_src_path,
path=path))


def html_page_context(app, pagename, templatename, context, doctree):
if templatename != 'page.html':
return

if not app.config.edit_on_github_project:
warnings.warn("edit_on_github_project not specified")
return
if not doctree:
warnings.warn("doctree is None")
return
path = os.path.relpath(doctree.get('source'), app.builder.srcdir)
show_url = get_github_url(app, 'blob', path)
edit_url = get_github_url(app, 'edit', path)

context['show_on_github_url'] = show_url
context['edit_on_github_url'] = edit_url


def setup(app):
app.add_config_value('edit_on_github_project', '', True)
app.add_config_value('edit_on_github_branch', 'master', True)
app.add_config_value('edit_on_github_src_path', '', True) # 'eg' "docs/"
app.connect('html-page-context', html_page_context)
8 changes: 8 additions & 0 deletions docs/source/_templates/links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ul>
<li><a href="https://community.home-assistant.io">📌 Community Forums</a></li>
<li><a href="https://github.com/home-assistant/home-assistant">🚀 GitHub</a></li>
<li><a href="https://home-assistant.io/">🏡 Homepage</a></li>
<li><a href="https://gitter.im/home-assistant/home-assistant">💬 Gitter</a></li>
<li><a href="https://pypi.python.org/pypi/homeassistant">💾 Download Releases</a></li>
</ul>
<hr>
13 changes: 13 additions & 0 deletions docs/source/_templates/sourcelink.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{%- if show_source and has_source and sourcename %}
<h3>{{ _('This Page') }}</h3>
<ul class="this-page-menu">
{%- if show_on_github_url %}
<li><a href="{{ show_on_github_url }}"
rel="nofollow">{{ _('Show on GitHub') }}</a></li>
{%- endif %}
{%- if edit_on_github_url %}
<li><a href="{{ edit_on_github_url }}"
rel="nofollow">{{ _('Edit on GitHub') }}</a></li>
{%- endif %}
</ul>
{%- endif %}
7 changes: 7 additions & 0 deletions docs/source/api/bootstrap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _bootstrap_module:

:mod:`homeassistant.bootstrap`
-------------------------

.. automodule:: homeassistant.bootstrap
:members:
10 changes: 10 additions & 0 deletions docs/source/api/device_tracker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _components_device_tracker_module:

:mod:`homeassistant.components.device_tracker`
----------------------------------------------

.. automodule:: homeassistant.components.device_tracker
:members:

.. autoclass:: Device
:members:
118 changes: 118 additions & 0 deletions docs/source/api/helpers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
homeassistant.helpers package
=============================

Submodules
----------

homeassistant.helpers.condition module
--------------------------------------

.. automodule:: homeassistant.helpers.condition
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.config_validation module
----------------------------------------------

.. automodule:: homeassistant.helpers.config_validation
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.discovery module
--------------------------------------

.. automodule:: homeassistant.helpers.discovery
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.entity module
-----------------------------------

.. automodule:: homeassistant.helpers.entity
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.entity_component module
---------------------------------------------

.. automodule:: homeassistant.helpers.entity_component
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.event module
----------------------------------

.. automodule:: homeassistant.helpers.event
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.event_decorators module
---------------------------------------------

.. automodule:: homeassistant.helpers.event_decorators
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.location module
-------------------------------------

.. automodule:: homeassistant.helpers.location
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.script module
-----------------------------------

.. automodule:: homeassistant.helpers.script
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.service module
------------------------------------

.. automodule:: homeassistant.helpers.service
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.state module
----------------------------------

.. automodule:: homeassistant.helpers.state
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.template module
-------------------------------------

.. automodule:: homeassistant.helpers.template
:members:
:undoc-members:
:show-inheritance:

homeassistant.helpers.typing module
-----------------------------------

.. automodule:: homeassistant.helpers.typing
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: homeassistant.helpers
:members:
:undoc-members:
:show-inheritance:
78 changes: 78 additions & 0 deletions docs/source/api/homeassistant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
homeassistant package
=====================

Subpackages
-----------

.. toctree::

helpers
util

Submodules
----------

bootstrap module
------------------------------

.. automodule:: homeassistant.bootstrap
:members:
:undoc-members:
:show-inheritance:

config module
---------------------------

.. automodule:: homeassistant.config
:members:
:undoc-members:
:show-inheritance:

const module
--------------------------

.. automodule:: homeassistant.const
:members:
:undoc-members:
:show-inheritance:

core module
-------------------------

.. automodule:: homeassistant.core
:members:
:undoc-members:
:show-inheritance:

exceptions module
-------------------------------

.. automodule:: homeassistant.exceptions
:members:
:undoc-members:
:show-inheritance:

loader module
---------------------------

.. automodule:: homeassistant.loader
:members:
:undoc-members:
:show-inheritance:

remote module
---------------------------

.. automodule:: homeassistant.remote
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: homeassistant
:members:
:undoc-members:
:show-inheritance:
78 changes: 78 additions & 0 deletions docs/source/api/util.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
homeassistant.util package
==========================

Submodules
----------

homeassistant.util.color module
-------------------------------

.. automodule:: homeassistant.util.color
:members:
:undoc-members:
:show-inheritance:

homeassistant.util.distance module
----------------------------------

.. automodule:: homeassistant.util.distance
:members:
:undoc-members:
:show-inheritance:

homeassistant.util.dt module
----------------------------

.. automodule:: homeassistant.util.dt
:members:
:undoc-members:
:show-inheritance:

homeassistant.util.location module
----------------------------------

.. automodule:: homeassistant.util.location
:members:
:undoc-members:
:show-inheritance:

homeassistant.util.package module
---------------------------------

.. automodule:: homeassistant.util.package
:members:
:undoc-members:
:show-inheritance:

homeassistant.util.temperature module
-------------------------------------

.. automodule:: homeassistant.util.temperature
:members:
:undoc-members:
:show-inheritance:

homeassistant.util.unit_system module
-------------------------------------

.. automodule:: homeassistant.util.unit_system
:members:
:undoc-members:
:show-inheritance:

homeassistant.util.yaml module
------------------------------

.. automodule:: homeassistant.util.yaml
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: homeassistant.util
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit a5faa85

Please sign in to comment.