diff --git a/plugins/linkable_title.rb b/plugins/linkable_title.rb new file mode 100644 index 00000000000..da677b296be --- /dev/null +++ b/plugins/linkable_title.rb @@ -0,0 +1,16 @@ +module Jekyll + class LinkableTitleTag < Liquid::Tag + def initialize(tag_name, text, token) + super + @title = text + end + + def render(context) + slug = @title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') + + " #{@title}" + end + end +end + +Liquid::Template.register_tag('linkable_title', Jekyll::LinkableTitleTag) diff --git a/sass/custom/_paulus.scss b/sass/custom/_paulus.scss index 36f2c26b6c5..2b48d400c9f 100644 --- a/sass/custom/_paulus.scss +++ b/sass/custom/_paulus.scss @@ -2,6 +2,25 @@ // https://fortawesome.github.io/Font-Awesome/3.2.1/icons/ +h1:hover a.title-link, +h2:hover a.title-link, +h3:hover a.title-link, +h4:hover a.title-link, +h5:hover a.title-link, +h6:hover a.title-link { + position: relative; + + &::before { + position: absolute; + left: -50px; + padding-right: 40px; + font-family: "FontAwesome"; + content: "\f0c1" + } +} + +f0c1 + .ha-title { white-space: nowrap; diff --git a/source/developers/add_new_platform.markdown b/source/developers/add_new_platform.markdown index 427d08b2576..6b13420d5d9 100644 --- a/source/developers/add_new_platform.markdown +++ b/source/developers/add_new_platform.markdown @@ -26,17 +26,17 @@ Platform logic should not interface directly with the devices but use a third-pa
-## Allowing your platform to be discovered +## {% linkable_title Allowing your platform to be discovered %} Home Assistant has a discovery service running in the background to discover new devices. Whenever a new device is discovered, an `SERVICE_DISCOVERED` event will be fired with the found service and the information. The `discovery` component has some knowledge about which components handle which type of services and will ensure those are loaded and listening before firing the `SERVICE_DISCOVERED` event. -### Add discovery instructions +### {% linkable_title Add discovery instructions %} Device discovery for Home Assistant has been extracted into an external library called [NetDisco](https://github.com/balloob/netdisco). This library is integrated using [the `discovery` component](https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/discovery.py) and scans the network in intervals for uPnP and zeroconf/mDNS services. To have your device be discovered, you will have to extend the NetDisco library to be able to find your device. This is done by adding a new discoverable. [See the repository for examples of existing discoverables.](https://github.com/balloob/netdisco/tree/master/netdisco/discoverables) -### Listening to `SERVICE_DISCOVERED` events +### {% linkable_title Listening to `SERVICE_DISCOVERED` events %} From your component, you will have to set up the listening for specific services. Below an example how one would listen for discovered Chromecasts: @@ -54,7 +54,7 @@ def setup(hass, config): hass, discovery.services.GOOGLE_CAST, chromecast_discovered) ``` -### Auto-loading your component upon discovery +### {% linkable_title Auto-loading your component upon discovery %} The Discovery component is capable of setting up your components before firing the `SERVICE_DISCOVERD` event. To do this you will have to update the [`SERVICE_HANDLERS`](https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/discovery.py#L29) constant in [the `discovery` component](https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/discovery.py). diff --git a/source/developers/api.markdown b/source/developers/api.markdown index 54b2c5592d8..54d4e39cf3f 100644 --- a/source/developers/api.markdown +++ b/source/developers/api.markdown @@ -31,7 +31,7 @@ Successful calls will return status code 200 or 201. Other status codes that can The api supports the following actions: -#### GET /api +#### {% linkable_title GET /api %} Returns message if API is up and running. ```json @@ -40,7 +40,7 @@ Returns message if API is up and running. } ``` -#### GET /api/events +#### {% linkable_title GET /api/events %} Returns an array of event objects. Each event object contain event name and listener count. ```json @@ -56,7 +56,7 @@ Returns an array of event objects. Each event object contain event name and list ] ``` -#### GET /api/services +#### {% linkable_title GET /api/services %} Returns an array of service objects. Each object contains the domain and which services it contains. ```json @@ -77,7 +77,7 @@ Returns an array of service objects. Each object contains the domain and which s ] ``` -#### GET /api/states +#### {% linkable_title GET /api/states %} Returns an array of state objects. Each state has the following attributes: entity_id, state, last_changed and attributes. ```json @@ -100,7 +100,7 @@ Returns an array of state objects. Each state has the following attributes: enti ] ``` -#### GET /api/states/<entity_id> +#### {% linkable_title GET /api/states/<entity_id> %} Returns a state object for specified entity_id. Returns 404 if not found. ```json @@ -115,7 +115,7 @@ Returns a state object for specified entity_id. Returns 404 if not found. } ``` -#### POST /api/states/<entity_id> +#### {% linkable_title POST /api/states/<entity_id> %} Updates or creates the current state of an entity. Expects a JSON object that has atleast a state attribute: @@ -142,7 +142,7 @@ Return code is 200 if the entity existed, 201 if the state of a new entity was s } ``` -#### POST /api/events/<event_type> +#### {% linkable_title POST /api/events/<event_type> %} Fires an event with event_type You can pass an optional JSON object to be used as `event_data`. @@ -161,7 +161,7 @@ Returns a message if successful. } ``` -#### POST /api/services/<domain>/<service> +#### {% linkable_title POST /api/services/<domain>/<service> %} Calls a service within a specific domain. Will return when the service has been executed or 10 seconds has past, whichever comes first. You can pass an optional JSON object to be used as `service_data`. @@ -198,7 +198,7 @@ Returns a list of states that have changed while the service was being executed. The result will include any changed states that changed while the service was being executed, even if their change was the result of something else happening in the system. -#### POST /api/event_forwarding +#### {% linkable_title POST /api/event_forwarding %} Setup event forwarding to another Home Assistant instance. Requires a JSON object that represents the API to forward to. @@ -219,7 +219,7 @@ It will return a message if event forwarding was setup successful. } ``` -#### DELETE /api/event_forwarding +#### {% linkable_title DELETE /api/event_forwarding %} Cancel event forwarding to another Home Assistant instance.config
folder in your current work directory. You can use a different folder by running Home Assistant with the --config argument: python3 homeassistant --config /YOUR/CONFIG/PATH/
.
-## Initializing components
+## {% linkable_title Initializing components %}
After loading, the bootstrapper will call `setup(hass, config)` method on the component to initialize it. The following parameters are passed in:
@@ -51,7 +51,7 @@ After loading, the bootstrapper will call `setup(hass, config)` method on the co
| hass
| The Home Assistant object. Call its methods to track time, register services, listen for events or track states: [Overview of available methods.](https://github.com/balloob/home-assistant/blob/master/homeassistant/__init__.py#L38) |
| config
| A dict containing the configuration. The keys of the config-dict are component names and the value is another dict with the component configuration. |
-### Guidance on using the Home Assistant object
+### {% linkable_title Guidance on using the Home Assistant object %}
The Home Assistant object contains three objects to help you interact with the system.
| Object | Description |
@@ -60,7 +60,7 @@ The Home Assistant object contains three objects to help you interact with the s
| hass.events
| This is the EventBus. It allows you to trigger and listen for events.hass.services
| This is the ServiceRegistry. It allows you to register services.?api_password=YOUR_PASSWORD
to any url to log in automatically.
-### Adding devices and services
+### {% linkable_title Adding devices and services %}
Home Assistant will be able to automatically discover and configure any Google Chromecasts, Belkin WeMo switches and Philips Hue bridges in your network if you have [the discovery component]({{site_root}}/components/discovery.html) enabled (which is by default).
@@ -78,7 +78,7 @@ Not all devices can be discovered, so if you hae any of the following devices or
* [Sun]({{site_root}}/components/sun.html)
* [Add support for your own device or service]({{site_root}}/developers/add_new_platform.html)
-### Setting up Home Automation
+### {% linkable_title Setting up Home Automation %}
When all your devices are set up it's time to put the cherry on the pie: automation. There are many ways to automate your home with Home Assistant so we have divided it into a couple of topics: