Site updated at 2017-09-30 11:34:16 UTC
This commit is contained in:
parent
543fd8aa87
commit
de3f36079f
26 changed files with 106 additions and 90 deletions
|
@ -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 && 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 && 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 you’re 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 you’re 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 it’s 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 `$`.
|
||||
|
||||
### <a class='title-link' name='templates' href='#templates'></a> 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.
|
||||
|
||||
### <a class='title-link' name='html' href='#html'></a> HTML
|
||||
|
||||
The direct usage of HTML is supported but not recommended. The note boxes are an exception.
|
||||
|
||||
```html
|
||||
<p class='note warning'>
|
||||
<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 #=> Required
|
||||
required: false #=> Optional
|
||||
required: inclusive #=> Inclusive
|
||||
required: exclusive #=> Exclusive
|
||||
required: any string here #=> 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 you’re 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"><p</span> <span class="na">class=</span><span class="s">'note warning'</span><span class="nt">></span>
|
||||
You need to enable telnet on your router.
|
||||
</p>
|
||||
<span class="nt"></p></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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue