Site updated at 2017-09-30 11:34:16 UTC

This commit is contained in:
Travis CI 2017-09-30 11:34:17 +00:00
parent 543fd8aa87
commit de3f36079f
26 changed files with 106 additions and 90 deletions

View file

@ -84,7 +84,7 @@
<li>Install <code class="highlighter-rouge">bundler</code>, a dependency manager for Ruby: <code class="highlighter-rouge">$ gem install bundler</code></li>
<li>In your home-assistant.github.io root directory, run <code class="highlighter-rouge">$ bundle</code> to install the gems you need.</li>
</ul>
<p>Short cut for Fedora: <code class="highlighter-rouge">$ sudo dnf -y install gcc-c++ ruby ruby-devel rubygem-bundler &amp;&amp; bundle</code></p>
<p>Short cut for Fedora: <code class="highlighter-rouge">$ sudo dnf -y install gcc-c++ ruby ruby-devel rubygem-bundler rubygem-json &amp;&amp; bundle</code></p>
<p>Then you can work on the documentation:</p>
<ul>
<li>Fork home-assistant.io <a href="https://github.com/home-assistant/home-assistant.github.io">git repository</a>.</li>
@ -127,42 +127,58 @@ Content...Written in markdown.
<li>Document the needed steps to retrieve API keys or access token for the third party service or device if needed.</li>
<li>Keep the configuration sample minimal by only adding the <code class="highlighter-rouge">Required</code> options. Full configuration details with further explanations should go into a seperate section.</li>
<li>The description of all the configuration variables should contains information about the used defaults.</li>
<li>If youre adding a new component, for the <code class="highlighter-rouge">ha_release</code> part of the header, just increment off the current release. If the current release is 0.37, make <code class="highlighter-rouge">ha_release</code> 0.38.</li>
<li>If youre adding a new component, for the <code class="highlighter-rouge">ha_release</code> part of the header, just increment of the current release. If the current release is 0.37, make <code class="highlighter-rouge">ha_release</code> 0.38. If its 0.30 or 0.40 please quote it with <code class="highlighter-rouge">" "</code>.</li>
</ul>
<h3><a class="title-link" name="embedding-code" href="#embedding-code"></a> Embedding Code</h3>
<p>You can use the default markdown syntax to generate syntax highlighted code. For inline code wrap your code in `. For multi-line, syntax wrap your code as shown below.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code> ```yaml
sensor:
platform: template
<h3><a class="title-link" name="configuration-variables" href="#configuration-variables"></a> Configuration variables</h3>
<p>The <strong><em>Configuration Variables</em></strong> section must use the <code class="highlighter-rouge"><span class="p">{</span><span class="err">%</span><span class="w"> </span><span class="err">configuration</span><span class="w"> </span><span class="err">%</span><span class="p">}</span><span class="w"> </span><span class="err">...</span><span class="w"> </span><span class="p">{</span><span class="err">%</span><span class="w"> </span><span class="err">endconfiguration</span><span class="w"> </span><span class="err">%</span><span class="p">}</span></code> tag.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>
{% configuration %}
api_key:
description: The API key to access the service.
required: true
type: string
name:
description: Name to use in the frontend.
required: false
type: string
{% endconfiguration %}
</code></pre>
</div>
<div class="highlighter-rouge"><pre class="highlight"><code>
Note that you can replace `yaml` next to \`\`\` with the language that is within the block.
When you're writing code that is to be executed on the terminal, prefix it with `$`.
### &lt;a class='title-link' name='templates' href='#templates'&gt;&lt;/a&gt; Templates
For the [configuration templating](/topics/templating/) is [Jinja](http://jinja.pocoo.org/) used.
If you are using templates then those parts needs to be [escaped](http://stackoverflow.com/a/24102537). Otherwise they will be rendered and appear blank on the website.
### &lt;a class='title-link' name='html' href='#html'&gt;&lt;/a&gt; HTML
The direct usage of HTML is supported but not recommended. The note boxes are an exception.
```html
&lt;p class='note warning'&gt;
<ul>
<li><strong><code class="highlighter-rouge">description:</code></strong>: That the variable is about.</li>
<li><strong><code class="highlighter-rouge">required:</code></strong>: If the variable is required.
<div class="language-text highlighter-rouge"><pre class="highlight"><code>required: true #=&gt; Required
required: false #=&gt; Optional
required: inclusive #=&gt; Inclusive
required: exclusive #=&gt; Exclusive
required: any string here #=&gt; Any string here
</code></pre>
</div>
</li>
<li><strong><code class="highlighter-rouge">type:</code></strong>: The type of the variable. Allowed entries: <code class="highlighter-rouge">string</code>, <code class="highlighter-rouge">int</code> or <code class="highlighter-rouge">map</code>. For multiple possibilities use <code class="highlighter-rouge">[string, int]</code>. If you use <code class="highlighter-rouge">map</code> then you need to define <code class="highlighter-rouge">keys:</code> (see the <a href="/components/sensor.template/"><code class="highlighter-rouge">template</code> sensor</a> for an example).</li>
</ul>
<h3><a class="title-link" name="embedding-code" href="#embedding-code"></a> Embedding Code</h3>
<p>You can use the <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code">default markdown syntax</a> to generate syntax highlighted code. For inline code wrap your code in `.</p>
<p>When youre writing code that is to be executed on the terminal, prefix it with <code class="highlighter-rouge">$</code>.</p>
<h3><a class="title-link" name="templates" href="#templates"></a> Templates</h3>
<p>For the <a href="/topics/templating/">configuration templating</a> is <a href="http://jinja.pocoo.org/">Jinja</a> used.</p>
<p>If you are using templates then those parts needs to be <a href="http://stackoverflow.com/a/24102537">escaped</a>. Otherwise they will be rendered and appear blank on the website.</p>
<h3><a class="title-link" name="html" href="#html"></a> HTML</h3>
<p>The direct usage of HTML is supported but not recommended. The note boxes are an exception.</p>
<div class="language-html highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;p</span> <span class="na">class=</span><span class="s">'note warning'</span><span class="nt">&gt;</span>
You need to enable telnet on your router.
&lt;/p&gt;
<span class="nt">&lt;/p&gt;</span>
</code></pre>
</div>
<h3><a class="title-link" name="redirects" href="#redirects"></a> Redirects</h3>
<p>If you rename or move an existing platform or component, create the redirect. Add the old location of the page to the header of the new one.</p><pre><code class="language-test">---
<p>If you rename or move an existing platform or component, create the redirect. Add the old location of the page to the header of the new one.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>---
...
redirect_from: /getting-started/android/
---
</code></pre>
</div>
<h3><a class="title-link" name="images-icons-and-logos" href="#images-icons-and-logos"></a> Images, icons, and logos</h3>
<p>The images which are displayed on the pages are stored in various directories according to their purpose.</p>
<table>